Skip to contentSkip to conversation

x86: ia32_setup_rt_frame(): propagate __user annotations properly

PATCH Applied Lukas Bulwahn 3 participants 5 messages Dec 7, 2020 – Dec 11, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: ia32_setup_rt_frame(): propagate __user annotations properly

Commit 57d563c82925 ("x86: ia32_setup_rt_frame(): consolidate uaccess areas") dropped a __user annotation in a cast when refactoring __put_user() to unsafe_put_user().

Hence, since then, sparse warns in arch/x86/ia32/ia32_signal.c:350:9:

warning: cast removes address space '__user' of expression
warning: incorrect type in argument 1 (different address spaces)
expected void const volatile [noderef] __user *ptr got unsigned long long [usertype] *

Add the __user annotation to restore the propagation of address spaces.

---
applies cleanly on current master (v5.10-rc7) and next-20201204

Thomas, Ingo, Boris, please pick this minor non-urgent clean-up patch.

 arch/x86/ia32/ia32_signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/ia32/ia32_signal.c +1 -1
index 81cf22398cd1..5e3d9b7fd5fb 100644
@@ -347,7 +347,7 @@ int ia32_setup_rt_frame(int sig, struct ksignal *ksig,
 	 */
 	unsafe_put_user(*((u64 *)&code), (u64 __user *)frame->retcode, Efault);
 	unsafe_put_sigcontext32(&frame->uc.uc_mcontext, fp, regs, set, Efault);
-	unsafe_put_user(*(__u64 *)set, (__u64 *)&frame->uc.uc_sigmask, Efault);
+	unsafe_put_user(*(__u64 *)set, (__u64 __user *)&frame->uc.uc_sigmask, Efault);
 	user_access_end();
 
 	if (__copy_siginfo_to_user32(&frame->info, &ksig->info))
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 1 line · Lukas Bulwahn

Thomas, Ingo, Boris, please pick this minor non-urgent clean-up patch.

Why?

Isn't it obvious that when you send a patch to us, the final goal is for it to be applied. Eventually.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#2 lore raw
Quoted 9 lines · Borislav Petkov
Quoted 1 line · Lukas Bulwahn

Thomas, Ingo, Boris, please pick this minor non-urgent clean-up patch.

Why?

Isn't it obvious that when you send a patch to us, the final goal is for it to be applied. Eventually.

Yes, agree. Other maintainers noted that I should point out that the patch is only a minor clean-up and it is not urgent to be considered.

So, I add this remark to make clear that it is not top priority to apply just that the maintainers know.

You will sure review it eventually, and hopefully accept it then.

If that comment disturbs you, please ignore it.

Lukas

maintainer
#3 lore raw
Quoted 7 lines · Lukas Bulwahn

Yes, agree. Other maintainers noted that I should point out that the patch is only a minor clean-up and it is not urgent to be considered.

So, I add this remark to make clear that it is not top priority to apply just that the maintainers know.

You will sure review it eventually, and hopefully accept it then.

Well, after I review it, I probably should know what the priority is, right?

Quoted 1 line

If that comment disturbs you, please ignore it.

I was just wondering why you're writing something which is not really needed. Notes under "---" are usually used to clarify aspects of the patch handling, versioning, etc.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
merge bot Applied
#4 lore raw

[tip: x86/cleanups] x86/ia32_signal: Propagate __user annotation properly

In reply to Lukas Bulwahn
The following commit has been merged into the x86/cleanups branch of tip:

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     9a02fd8b19247e80e2354a227b6e2392e8fae78a
Gitweb:        https://git.kernel.org/tip/9a02fd8b19247e80e2354a227b6e2392e8fae78a
Author:        Lukas Bulwahn <[email protected]>
AuthorDate:    Mon, 07 Dec 2020 13:41:41 +01:00
Committer:     Borislav Petkov <[email protected]>
CommitterDate: Fri, 11 Dec 2020 19:44:31 +01:00

x86/ia32_signal: Propagate __user annotation properly

Commit

57d563c82925 ("x86: ia32_setup_rt_frame(): consolidate uaccess areas")

dropped a __user annotation in a cast when refactoring __put_user() to unsafe_put_user().

Hence, since then, sparse warns in arch/x86/ia32/ia32_signal.c:350:9:

warning: cast removes address space '__user' of expression
warning: incorrect type in argument 1 (different address spaces)
expected void const volatile [noderef] __user *ptr got unsigned long long [usertype] *

Add the __user annotation to restore the propagation of address spaces.

---
 arch/x86/ia32/ia32_signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/ia32/ia32_signal.c +1 -1
index 81cf223..5e3d9b7 100644
@@ -347,7 +347,7 @@ int ia32_setup_rt_frame(int sig, struct ksignal *ksig,
 	 */
 	unsafe_put_user(*((u64 *)&code), (u64 __user *)frame->retcode, Efault);
 	unsafe_put_sigcontext32(&frame->uc.uc_mcontext, fp, regs, set, Efault);
-	unsafe_put_user(*(__u64 *)set, (__u64 *)&frame->uc.uc_sigmask, Efault);
+	unsafe_put_user(*(__u64 *)set, (__u64 __user *)&frame->uc.uc_sigmask, Efault);
 	user_access_end();
 
 	if (__copy_siginfo_to_user32(&frame->info, &ksig->info))