Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20251027083745.862419776@linutronix.de

authored by

Thomas Gleixner and committed by
Ingo Molnar
3ce17e69 e02718c9

+4 -8
+4 -8
fs/select.c
··· 776 776 { 777 777 // the path is hot enough for overhead of copy_from_user() to matter 778 778 if (from) { 779 - if (can_do_masked_user_access()) 780 - from = masked_user_access_begin(from); 781 - else if (!user_read_access_begin(from, sizeof(*from))) 782 - return -EFAULT; 783 - unsafe_get_user(to->p, &from->p, Efault); 784 - unsafe_get_user(to->size, &from->size, Efault); 785 - user_read_access_end(); 779 + scoped_user_read_access(from, Efault) { 780 + unsafe_get_user(to->p, &from->p, Efault); 781 + unsafe_get_user(to->size, &from->size, Efault); 782 + } 786 783 } 787 784 return 0; 788 785 Efault: 789 - user_read_access_end(); 790 786 return -EFAULT; 791 787 } 792 788