]> git.baikalelectronics.ru Git - kernel.git/commit
watch_queue: fix IOC_WATCH_QUEUE_SET_SIZE alloc error paths
authorDavid Disseldorp <ddiss@suse.de>
Tue, 7 Mar 2023 15:21:06 +0000 (16:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:30 +0000 (08:50 +0100)
commitbf4945348bb6b215e748a6bc001193f2a3d0b97f
tree99074687efa15ebc408c0c9f25ffcf11e271af8c
parentb3f54fea8a1b64113af7e27caf72982172f7fbc8
watch_queue: fix IOC_WATCH_QUEUE_SET_SIZE alloc error paths

[ Upstream commit 865b5573c7c5a56ab60c0e28cbcb29474ceb4062 ]

The watch_queue_set_size() allocation error paths return the ret value
set via the prior pipe_resize_ring() call, which will always be zero.

As a result, IOC_WATCH_QUEUE_SET_SIZE callers such as "keyctl watch"
fail to detect kernel wqueue->notes allocation failures and proceed to
KEYCTL_WATCH_KEY, with any notifications subsequently lost.

Fixes: 175295c8c9fa4 ("pipe: Add general notification queue support")
Signed-off-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/watch_queue.c