diff options
| author | Thomas Weißschuh <thomas.weissschuh@linutronix.de> | 2025-08-05 14:38:08 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-08-11 14:52:25 +0200 |
| commit | 708c04a5c2b78e22f56e2350de41feba74dfccd9 (patch) | |
| tree | bb4450d550e65fa3b75adea9b7745028f2e5f17a /scripts/gdb/linux/vmalloc.py | |
| parent | f7d812357e40ef3ce1c0dcdd929590f1dbc6c344 (diff) | |
fs: always return zero on success from replace_fd()
replace_fd() returns the number of the new file descriptor through the
return value of do_dup2(). However its callers never care about the
specific returned number. In fact the caller in receive_fd_replace() treats
any non-zero return value as an error and therefore never calls
__receive_sock() for most file descriptors, which is a bug.
To fix the bug in receive_fd_replace() and to avoid the same issue
happening in future callers, signal success through a plain zero.
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Link: https://lore.kernel.org/lkml/20250801220215.GS222315@ZenIV/
Fixes: 173817151b15 ("fs: Expand __receive_fd() to accept existing fd")
Fixes: 42eb0d54c08a ("fs: split receive_fd_replace from __receive_fd")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://lore.kernel.org/20250805-fix-receive_fd_replace-v3-1-b72ba8b34bac@linutronix.de
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'scripts/gdb/linux/vmalloc.py')
0 files changed, 0 insertions, 0 deletions
