lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180710051141.GB21096@outlook.office365.com>
Date:   Mon, 9 Jul 2018 22:11:42 -0700
From:   Andrei Vagin <avagin@...tuozzo.com>
To:     Christoph Hellwig <hch@....de>
Cc:     Adrian Reber <adrian@...as.de>, viro@...iv.linux.org.uk,
        Avi Kivity <avi@...lladb.com>, linux-aio@...ck.org,
        linux-fsdevel@...r.kernel.org, linux-api@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 7/7] aio: implement io_pgetevents

On Sun, Jul 08, 2018 at 10:44:00PM +0200, Christoph Hellwig wrote:
> On Wed, Jul 04, 2018 at 04:21:16PM +0200, Adrian Reber wrote:
> > In file included from /usr/include/linux/signal.h:5,
> >                  from /usr/include/linux/aio_abi.h:32,
> >                  from include.c:2:
> > /usr/include/asm/signal.h:16:23: error: conflicting types for ‘sigset_t’
> >  typedef unsigned long sigset_t;
> >                        ^~~~~~~~
> > In file included from /usr/include/signal.h:35,
> >                  from include.c:1:
> > /usr/include/bits/types/sigset_t.h:7:20: note: previous declaration of ‘sigset_t’ was here
> >  typedef __sigset_t sigset_t;
> 
> I guess we could do something like the patch below, although it is
> rather ugly:
> 
> diff --git a/include/uapi/linux/aio_abi.h b/include/uapi/linux/aio_abi.h
> index 75846164290e..b7705ad66d78 100644
> --- a/include/uapi/linux/aio_abi.h
> +++ b/include/uapi/linux/aio_abi.h
> @@ -29,7 +29,11 @@
>  
>  #include <linux/types.h>
>  #include <linux/fs.h>
> +#ifdef __KERNEL__
>  #include <linux/signal.h>
> +#else
> +#include <signal.h>
> +#endif

I think we can not do this because this header specifies the kernel
API, but signal.h is provided by libc and sigset_t can be defined
differently there:

[avagin@...top ~]$ cat test.c 
#ifdef TEST_LINUX_SIGNAL
#  include <glob.h>
#  include <linux/signal.h>
#else
#  include <signal.h>
#endif
#include <stdio.h>
int main()
{
	printf("sizeof(sigset_t) = %d\n", sizeof(sigset_t));
	return 0;
}
[avagin@...top ~]$ gcc -DTEST_LINUX_SIGNAL test.c && ./a.out
sizeof(sigset_t) = 8
[avagin@...top ~]$ gcc test.c && ./a.out
sizeof(sigset_t) = 128

[avagin@...top include]$ rpm -qf /usr/include/signal.h 
glibc-headers-2.27-8.fc28.i686
glibc-headers-2.27-8.fc28.x86_64
[avagin@...top include]$ rpm -qf /usr/include/linux/signal.h 
kernel-headers-4.16.5-300.fc28.x86_64

>  #include <asm/byteorder.h>
>  
>  typedef __kernel_ulong_t aio_context_t;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ