watch_queue: fix IOC_WATCH_QUEUE_SET_SIZE alloc error paths
stable inclusion from stable-v5.10.175 commit b1fddddf58acd6d9618a2e3e974f3a2629b2ebf5 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8711T Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b1fddddf58acd6d9618a2e3e974f3a2629b2ebf5 -------------------------------- [ Upstream commit 03e1d60e ] 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: c73be61c ("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> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment