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]
Date:   Tue, 6 Jun 2017 21:05:06 +1000
From:   Aleksa Sarai <asarai@...e.de>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jslaby@...e.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-alpha@...r.kernel.org,
        "open list:RALINK MIPS ARCHITECTURE" <linux-mips@...ux-mips.org>,
        Parisc List <linux-parisc@...r.kernel.org>,
        linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
        linux-sh@...r.kernel.org, sparclinux <sparclinux@...r.kernel.org>,
        linux-xtensa@...ux-xtensa.org,
        linux-arch <linux-arch@...r.kernel.org>,
        Christian Brauner <christian.brauner@...ntu.com>,
        Valentin Rothberg <vrothberg@...e.com>
Subject: Re: [PATCH v3 1/2] tty: add compat_ioctl callbacks

>> diff --git a/Makefile b/Makefile
>> index 470bd4d9513a..fb689286d83a 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -401,6 +401,7 @@ KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
>>                     -fno-strict-aliasing -fno-common \
>>                     -Werror-implicit-function-declaration \
>>                     -Wno-format-security \
>> +                  -Wno-error=int-in-bool-context \
>>                     -std=gnu89 $(call cc-option,-fno-PIE)
> 
> This  slipped in by accident I assume? It seems completely unrelated.

Yeah, I re-sent v4 with this removed immediately afterwards.

> 
>> diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
>> index 65799575c666..2a6bd9ae3f8b 100644
>> --- a/drivers/tty/pty.c
>> +++ b/drivers/tty/pty.c
>> @@ -481,6 +481,16 @@ static int pty_bsd_ioctl(struct tty_struct *tty,
>>          return -ENOIOCTLCMD;
>>   }
>>
>> +static long pty_bsd_compat_ioctl(struct tty_struct *tty,
>> +                                unsigned int cmd, unsigned long arg)
>> +{
>> +       /*
>> +        * PTY ioctls don't require any special translation between 32-bit and
>> +        * 64-bit userspace, they are already compatible.
>> +        */
>> +       return pty_bsd_ioctl(tty, cmd, arg);
>> +}
>> +
> 
> This looks correct but unnecessary, you can simply point both
> function pointers to the same function:

They have different types, since they have different return types:

int  (*ioctl)(struct tty_struct *tty,
	    unsigned int cmd, unsigned long arg);
long (*compat_ioctl)(struct tty_struct *tty,
		     unsigned int cmd, unsigned long arg);

If you like, I can change (*ioctl) to return longs as well, and then 
change all of the call-sites (since unlocked_ioctl also returns long).

-- 
Aleksa Sarai
Software Engineer (Containers)
SUSE Linux GmbH
https://www.cyphar.com/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ