Skip to content

Commit 03e1d60

Browse files
ddissbrauner
authored andcommitted
watch_queue: fix IOC_WATCH_QUEUE_SET_SIZE alloc error paths
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: c73be61 ("pipe: Add general notification queue support") Signed-off-by: David Disseldorp <[email protected]> Signed-off-by: Christian Brauner (Microsoft) <[email protected]>
1 parent fe15c26 commit 03e1d60

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/watch_queue.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes)
273273
if (ret < 0)
274274
goto error;
275275

276+
ret = -ENOMEM;
276277
pages = kcalloc(sizeof(struct page *), nr_pages, GFP_KERNEL);
277278
if (!pages)
278279
goto error;

0 commit comments

Comments
 (0)