[PATCH] fs: fcntl, avoid undefined behaviour

2016-10-14 Thread Jiri Slaby
fcntl(0, F_SETOWN, 0x8000) triggers: UBSAN: Undefined behaviour in fs/fcntl.c:118:7 negation of -2147483648 cannot be represented in type 'int': CPU: 1 PID: 18261 Comm: syz-executor Not tainted 4.8.1-0-syzkaller #1 ... Call Trace: ... [] ? f_setown+0x1d8/0x200 [] ? SyS_fcntl+0x999/0xf30 [] ?

Re: [PATCH] fs: fcntl, avoid undefined behaviour

2016-10-24 Thread Jiri Slaby
On 10/14/2016, 03:38 PM, J. Bruce Fields wrote: > On Fri, Oct 14, 2016 at 07:48:15AM -0400, Jeff Layton wrote: >> On Fri, 2016-10-14 at 11:23 +0200, Jiri Slaby wrote: >>> fcntl(0, F_SETOWN, 0x8000) triggers: >>> UBSAN: Undefined behaviour in fs/fcntl.c:118:7 >>> negation of -2147483648 cannot b

Re: [PATCH] fs: fcntl, avoid undefined behaviour

2016-10-24 Thread Jeff Layton
On Mon, 2016-10-24 at 11:15 +0200, Jiri Slaby wrote: > On 10/14/2016, 03:38 PM, J. Bruce Fields wrote: > > > > On Fri, Oct 14, 2016 at 07:48:15AM -0400, Jeff Layton wrote: > > > > > > On Fri, 2016-10-14 at 11:23 +0200, Jiri Slaby wrote: > > > > > > > > fcntl(0, F_SETOWN, 0x8000) triggers: >

Re: [PATCH] fs: fcntl, avoid undefined behaviour

2016-10-24 Thread Jiri Slaby
On 10/24/2016, 01:29 PM, Jeff Layton wrote: > It looks like it lists this as a "may fail" case: > > http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html > > [EINVAL] > The cmd argument is F_SETOWN and the value of the argument > is not valid as a process or

Re: [PATCH] fs: fcntl, avoid undefined behaviour

2016-10-14 Thread Jeff Layton
On Fri, 2016-10-14 at 11:23 +0200, Jiri Slaby wrote: > fcntl(0, F_SETOWN, 0x8000) triggers: > UBSAN: Undefined behaviour in fs/fcntl.c:118:7 > negation of -2147483648 cannot be represented in type 'int': > CPU: 1 PID: 18261 Comm: syz-executor Not tainted 4.8.1-0-syzkaller #1 > ... > Call Trace:

Re: [PATCH] fs: fcntl, avoid undefined behaviour

2016-10-14 Thread J. Bruce Fields
On Fri, Oct 14, 2016 at 07:48:15AM -0400, Jeff Layton wrote: > On Fri, 2016-10-14 at 11:23 +0200, Jiri Slaby wrote: > > fcntl(0, F_SETOWN, 0x8000) triggers: > > UBSAN: Undefined behaviour in fs/fcntl.c:118:7 > > negation of -2147483648 cannot be represented in type 'int': > > CPU: 1 PID: 18261

Re: [PATCH] fs: fcntl, avoid undefined behaviour

2017-06-11 Thread zhong jiang
On 2016/10/14 17:23, Jiri Slaby wrote: > fcntl(0, F_SETOWN, 0x8000) triggers: > UBSAN: Undefined behaviour in fs/fcntl.c:118:7 > negation of -2147483648 cannot be represented in type 'int': > CPU: 1 PID: 18261 Comm: syz-executor Not tainted 4.8.1-0-syzkaller #1 > ... > Call Trace: > ... > [] ?

Re: [PATCH] fs: fcntl, avoid undefined behaviour

2017-06-13 Thread Jiri Slaby
On 06/12/2017, 07:03 AM, zhong jiang wrote: > On 2016/10/14 17:23, Jiri Slaby wrote: >> fcntl(0, F_SETOWN, 0x8000) triggers: >> UBSAN: Undefined behaviour in fs/fcntl.c:118:7 >> negation of -2147483648 cannot be represented in type 'int': >> CPU: 1 PID: 18261 Comm: syz-executor Not tainted 4.8.

Re: [PATCH] fs: fcntl, avoid undefined behaviour

2017-06-13 Thread zhong jiang
On 2017/6/13 17:29, Jiri Slaby wrote: > On 06/12/2017, 07:03 AM, zhong jiang wrote: >> On 2016/10/14 17:23, Jiri Slaby wrote: >>> fcntl(0, F_SETOWN, 0x8000) triggers: >>> UBSAN: Undefined behaviour in fs/fcntl.c:118:7 >>> negation of -2147483648 cannot be represented in type 'int': >>> CPU: 1 P