]> git.baikalelectronics.ru Git - kernel.git/commit
fanotify: Allow copying of file handle to userspace
authorJan Kara <jack@suse.cz>
Tue, 12 Mar 2019 11:42:37 +0000 (12:42 +0100)
committerJan Kara <jack@suse.cz>
Tue, 19 Mar 2019 08:29:07 +0000 (09:29 +0100)
commit4fe29fad0ddd5af3a590b37b1ed49062a315cfdf
tree1610454690dd14fe250d0b6e8b6be1f580f1f360
parent7391a783eae28fd6875e95576c27f1e2d0999716
fanotify: Allow copying of file handle to userspace

When file handle is embedded inside fanotify_event and usercopy checks
are enabled, we get a warning like:

Bad or missing usercopy whitelist? Kernel memory exposure attempt detected
from SLAB object 'fanotify_event' (offset 40, size 8)!
WARNING: CPU: 1 PID: 7649 at mm/usercopy.c:78 usercopy_warn+0xeb/0x110
mm/usercopy.c:78

Annotate handling in fanotify_event properly to mark copying it to
userspace is fine.

Reported-by: syzbot+2c49971e251e36216d1f@syzkaller.appspotmail.com
Fixes: c4875ecc66aa ("fanotify: enable FAN_REPORT_FID init flag")
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/fanotify/fanotify_user.c