]> git.baikalelectronics.ru Git - kernel.git/commit
fs/signalfd.c: fix inconsistent return codes for signalfd4
authorHelge Deller <deller@gmx.de>
Wed, 12 Aug 2020 01:36:04 +0000 (18:36 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Aug 2020 17:58:01 +0000 (10:58 -0700)
commit291bff61eeb86b7284c18c1ad1745753f1b975da
tree1f7ef4eccc8f472d610f70e42df59f281bdcdf8b
parent5d8e95ec8af1ad3ec98cbf3c5b958f00e4491ce3
fs/signalfd.c: fix inconsistent return codes for signalfd4

The kernel signalfd4() syscall returns different error codes when called
either in compat or native mode.  This behaviour makes correct emulation
in qemu and testing programs like LTP more complicated.

Fix the code to always return -in both modes- EFAULT for unaccessible user
memory, and EINVAL when called with an invalid signal mask.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Laurent Vivier <laurent@vivier.eu>
Link: http://lkml.kernel.org/r/20200530100707.GA10159@ls3530.fritz.box
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/signalfd.c