Files
android_kernel_xiaomi_sm8450/include/linux
Qian Cai 8a018eb55e pipe: Fix memory leaks in create_pipe_files()
Calling pipe2() with O_NOTIFICATION_PIPE could results in memory
leaks unless watch_queue_init() is successful.

        In case of watch_queue_init() failure in pipe2() we are left
with inode and pipe_inode_info instances that need to be freed.  That
failure exit has been introduced in commit c73be61ced ("pipe: Add
general notification queue support") and its handling should've been
identical to nearby treatment of alloc_file_pseudo() failures - it
is dealing with the same situation.  As it is, the mainline kernel
leaks in that case.

        Another problem is that CONFIG_WATCH_QUEUE and !CONFIG_WATCH_QUEUE
cases are treated differently (and the former leaks just pipe_inode_info,
the latter - both pipe_inode_info and inode).

        Fixed by providing a dummy wacth_queue_init() in !CONFIG_WATCH_QUEUE
case and by having failures of wacth_queue_init() handled the same way
we handle alloc_file_pseudo() ones.

Fixes: c73be61ced ("pipe: Add general notification queue support")
Signed-off-by: Qian Cai <cai@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2020-10-01 09:40:35 -04:00
..
2020-08-03 18:19:23 -07:00
2020-08-12 10:57:59 -07:00
2020-07-27 14:55:22 +01:00
2020-07-21 08:24:52 -05:00
2020-07-21 13:26:26 -07:00
2020-07-27 14:29:23 -04:00
2020-08-14 19:56:56 -07:00
2020-07-24 17:12:41 -07:00
2020-08-04 21:02:38 -04:00
2020-07-24 17:12:41 -07:00
2020-07-31 18:08:59 +10:00
2020-07-24 15:41:54 -07:00
2020-07-23 17:34:18 +10:00
2020-07-16 23:19:51 +02:00
2020-07-20 09:39:11 +02:00
2020-08-07 11:33:24 -07:00
2020-08-01 11:28:17 +02:00