linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: ia32_setup_rt_frame(): propagate __user annotations properly
@ 2020-12-07 12:41 Lukas Bulwahn
  2020-12-11 18:47 ` Borislav Petkov
  2020-12-11 18:54 ` [tip: x86/cleanups] x86/ia32_signal: Propagate __user annotation properly tip-bot2 for Lukas Bulwahn
  0 siblings, 2 replies; 5+ messages in thread
From: Lukas Bulwahn @ 2020-12-07 12:41 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: H . Peter Anvin, Al Viro, kernel-janitors, linux-kernel, Lukas Bulwahn

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.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
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(-)

diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index 81cf22398cd1..5e3d9b7fd5fb 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -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))
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86: ia32_setup_rt_frame(): propagate __user annotations properly
  2020-12-07 12:41 [PATCH] x86: ia32_setup_rt_frame(): propagate __user annotations properly Lukas Bulwahn
@ 2020-12-11 18:47 ` Borislav Petkov
  2020-12-11 18:55   ` Lukas Bulwahn
  2020-12-11 18:54 ` [tip: x86/cleanups] x86/ia32_signal: Propagate __user annotation properly tip-bot2 for Lukas Bulwahn
  1 sibling, 1 reply; 5+ messages in thread
From: Borislav Petkov @ 2020-12-11 18:47 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Thomas Gleixner, Ingo Molnar, x86, H . Peter Anvin, Al Viro,
	kernel-janitors, linux-kernel

On Mon, Dec 07, 2020 at 01:41:41PM +0100, Lukas Bulwahn wrote:
> 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.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip: x86/cleanups] x86/ia32_signal: Propagate __user annotation properly
  2020-12-07 12:41 [PATCH] x86: ia32_setup_rt_frame(): propagate __user annotations properly Lukas Bulwahn
  2020-12-11 18:47 ` Borislav Petkov
@ 2020-12-11 18:54 ` tip-bot2 for Lukas Bulwahn
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot2 for Lukas Bulwahn @ 2020-12-11 18:54 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Lukas Bulwahn, Borislav Petkov, x86, linux-kernel

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 <lukas.bulwahn@gmail.com>
AuthorDate:    Mon, 07 Dec 2020 13:41:41 +01:00
Committer:     Borislav Petkov <bp@suse.de>
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.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20201207124141.21859-1-lukas.bulwahn@gmail.com
---
 arch/x86/ia32/ia32_signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index 81cf223..5e3d9b7 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -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))

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86: ia32_setup_rt_frame(): propagate __user annotations properly
  2020-12-11 18:47 ` Borislav Petkov
@ 2020-12-11 18:55   ` Lukas Bulwahn
  2020-12-11 19:02     ` Borislav Petkov
  0 siblings, 1 reply; 5+ messages in thread
From: Lukas Bulwahn @ 2020-12-11 18:55 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Gleixner, Ingo Molnar, X86 ML, H . Peter Anvin, Al Viro,
	kernel-janitors, Linux Kernel Mailing List

On Fri, Dec 11, 2020 at 7:47 PM Borislav Petkov <bp@alien8.de> wrote:
>
> On Mon, Dec 07, 2020 at 01:41:41PM +0100, Lukas Bulwahn wrote:
> > 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86: ia32_setup_rt_frame(): propagate __user annotations properly
  2020-12-11 18:55   ` Lukas Bulwahn
@ 2020-12-11 19:02     ` Borislav Petkov
  0 siblings, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2020-12-11 19:02 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Thomas Gleixner, Ingo Molnar, X86 ML, H . Peter Anvin, Al Viro,
	kernel-janitors, Linux Kernel Mailing List

On Fri, Dec 11, 2020 at 07:55:50PM +0100, Lukas Bulwahn wrote:
> 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?

> 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.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-11 20:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 12:41 [PATCH] x86: ia32_setup_rt_frame(): propagate __user annotations properly Lukas Bulwahn
2020-12-11 18:47 ` Borislav Petkov
2020-12-11 18:55   ` Lukas Bulwahn
2020-12-11 19:02     ` Borislav Petkov
2020-12-11 18:54 ` [tip: x86/cleanups] x86/ia32_signal: Propagate __user annotation properly tip-bot2 for Lukas Bulwahn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).