Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 26 Feb 2013 21:21:12 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: Fix for fields in utmp

see inline comments

* Ivan Kanakarakis <ivan.kanak@...il.com> [2013-02-26 12:34:43 +0200]:
> Linux suicidemachine 3.7.5-1-ARCH #1 SMP PREEMPT Mon Jan 28 10:03:32
> CET 2013 x86_64 GNU/Linux
> ----------------------------------
> --- data/glibc.sizeof 2013-02-26 12:27:48.112569344 +0200
> +++ data/musl.sizeof 2013-02-26 12:27:48.119236080 +0200
> @@ -90,3 +90,3 @@
>  float 4
> -float_t 4
> +float_t 8

looks like musl does not respect FLT_EVAL_METHOD on x86_64
this should be fixed

>  fpos_t 16
> @@ -112,4 +112,4 @@
>  int8_t 1
> -int_fast16_t 8
> -int_fast32_t 8
> +int_fast16_t 4
> +int_fast32_t 4
>  int_fast64_t 8

these diffs may cause problems

> @@ -122,3 +122,3 @@
>  intptr_t 8
> -jmp_buf 200
> +jmp_buf 64
>  key_t 4
> @@ -181,6 +181,6 @@
>  quad_t 8
> -regex_t 64
> +regex_t 56
>  register_t 8
> -regmatch_t 8
> -regoff_t 4
> +regmatch_t 16
> +regoff_t 8
>  res_state 8
> @@ -196,3 +196,3 @@
>  sighandler_t 8
> -siginfo_t 128
> +siginfo_t 136
>  sigjmp_buf 200
> @@ -215,3 +215,3 @@
>  struct ar_hdr 60
> -struct arpd_request 40
> +struct arpd_request 28
>  struct arphdr 8
> @@ -222,3 +222,3 @@
>  struct cmsghdr 16
> -struct crypt_data 131232
> +struct crypt_data 260
>  struct dirent 280
> @@ -282,3 +282,3 @@
>  struct itimerval 32
> -struct lastlog 292
> +struct lastlog 296
>  struct lconv 96
> @@ -312,3 +312,3 @@
>  struct ns_tsig_key 2072
> -struct ntptimeval 72
> +struct ntptimeval 32
>  struct option 32
> @@ -326,4 +326,4 @@
>  struct rtentry 120
> -struct rusage 144
> -struct sched_param 4
> +struct rusage 272
> +struct sched_param 48
>  struct sembuf 6
> @@ -348,3 +348,3 @@
>  struct sockaddr_ll 20
> -struct sockaddr_storage 128
> +struct sockaddr_storage 136
>  struct sockaddr_un 110
> @@ -361,3 +361,3 @@
>  struct strrecvfd 20
> -struct sysinfo 112
> +struct sysinfo 368
>  struct termios 60
> @@ -376,3 +376,3 @@
>  struct utimbuf 16
> -struct utmpx 384
> +struct utmpx 400

so we need the glibc hacks to be abi compatible:

struct utmpx
{
	short ut_type;
	pid_t ut_pid;
	char ut_line[UT_LINESIZE];
	char ut_id[4];
	char ut_user[32];
	char ut_host[256];
	struct {
		short e_termination;
		short e_exit;
	} ut_exit;
#if 64 bit abi
	__int32_t ut_session;
	struct {__int32_t tv_sec; __int32_t tv_usec;} ut_tv;
#else
	long ut_session;
	struct timeval ut_tv;
#endif
	unsigned ut_addr_v6[4];
	char __unused[20];
};

the comment in glibc sysdeps/gnu/bits/utmpx.h is

/* The fields ut_session and ut_tv must be the same size when compiled
   32- and 64-bit.  This allows files and shared memory to be shared
   between 32- and 64-bit applications.  */

>  struct utsname 390
> @@ -399,4 +399,4 @@
>  uint8_t 1
> -uint_fast16_t 8
> -uint_fast32_t 8
> +uint_fast16_t 4
> +uint_fast32_t 4
>  uint_fast64_t 8
> @@ -416,4 +416,4 @@
>  wchar_t 4
> -wctrans_t 8
> -wctype_t 8
> +wctrans_t 4
> +wctype_t 4
>  wint_t 4
> 

it seems wctype_t is unconditionally long in glibc

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.