Commit 3ce17e69 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar
Browse files

select: Convert to scoped user access



Replace the open coded implementation with the scoped user access guard.

No functional change intended.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Reviewed-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20251027083745.862419776@linutronix.de
parent e02718c9
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -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;
		scoped_user_read_access(from, Efault) {
			unsafe_get_user(to->p, &from->p, Efault);
			unsafe_get_user(to->size, &from->size, Efault);
		user_read_access_end();
		}
	}
	return 0;
Efault:
	user_read_access_end();
	return -EFAULT;
}