]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
select: Fix unbalanced user_access_end()
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 13 Jan 2025 08:37:24 +0000 (09:37 +0100)
committerChristian Brauner <brauner@kernel.org>
Mon, 13 Jan 2025 15:24:16 +0000 (16:24 +0100)
While working on implementing user access validation on powerpc
I got the following warnings on a pmac32_defconfig build:

  CC      fs/select.o
fs/select.o: warning: objtool: sys_pselect6+0x1bc: redundant UACCESS disable
fs/select.o: warning: objtool: sys_pselect6_time32+0x1bc: redundant UACCESS disable

On powerpc/32s, user_read_access_begin/end() are no-ops, but the
failure path has a user_access_end() instead of user_read_access_end()
which means an access end without any prior access begin.

Replace that user_access_end() by user_read_access_end().

Fixes: 7e71609f64ec ("pselect6() and friends: take handling the combined 6th/7th args into helper")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/a7139e28d767a13e667ee3c79599a8047222ef36.1736751221.git.christophe.leroy@csgroup.eu
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/select.c

index e223d1fe9d5541bc51655604166a627cd24e4610..7da531b1cf6bec5da06eaae062f963e4c08f00eb 100644 (file)
@@ -786,7 +786,7 @@ static inline int get_sigset_argpack(struct sigset_argpack *to,
        }
        return 0;
 Efault:
-       user_access_end();
+       user_read_access_end();
        return -EFAULT;
 }
 
@@ -1355,7 +1355,7 @@ static inline int get_compat_sigset_argpack(struct compat_sigset_argpack *to,
        }
        return 0;
 Efault:
-       user_access_end();
+       user_read_access_end();
        return -EFAULT;
 }