From: Thomas Gleixner Date: Mon, 27 Oct 2025 08:44:04 +0000 (+0100) Subject: select: Convert to scoped user access X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ce17e6909944b3f83b54915e36f5957f1327712;p=thirdparty%2Flinux.git select: Convert to scoped user access Replace the open coded implementation with the scoped user access guard. No functional change intended. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Mathieu Desnoyers Link: https://patch.msgid.link/20251027083745.862419776@linutronix.de --- diff --git a/fs/select.c b/fs/select.c index 082cf60c7e235..65019b8ba3f74 100644 --- a/fs/select.c +++ b/fs/select.c @@ -776,17 +776,13 @@ static inline int get_sigset_argpack(struct sigset_argpack *to, { // the path is hot enough for overhead of copy_from_user() to matter if (from) { - if (can_do_masked_user_access()) - from = masked_user_access_begin(from); - else if (!user_read_access_begin(from, sizeof(*from))) - return -EFAULT; - unsafe_get_user(to->p, &from->p, Efault); - unsafe_get_user(to->size, &from->size, Efault); - user_read_access_end(); + scoped_user_read_access(from, Efault) { + unsafe_get_user(to->p, &from->p, Efault); + unsafe_get_user(to->size, &from->size, Efault); + } } return 0; Efault: - user_read_access_end(); return -EFAULT; }