All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Eric W. Biederman" <ebiederm@xmission.com>
To: linux-kernel@vger.kernel.org
Cc: Oleg Nesterov <oleg@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-api@vger.kernel.org,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: [PATCH 02/10] signal: Properly deliver SIGILL from uprobes
Date: Mon,  3 Sep 2018 22:44:22 +0200	[thread overview]
Message-ID: <20180903204430.25473-2-ebiederm@xmission.com> (raw)
In-Reply-To: <87musyl3fa.fsf@xmission.com>

For userspace to tell the difference between a random signal and an
exception, the exception must include siginfo information.

Using SEND_SIG_FORCED for SIGILL is thus wrong, and it will result
in userspace seeing si_code == SI_USER (like a random signal) instead
of si_code == SI_KERNEL or a more specific si_code as all exceptions
deliver.

Therefore replace force_sig_info(SIGILL, SEND_SIG_FORCE, current)
with force_sig(SIG_ILL, current) which gets this right and is
shorter and easier to type.

Fixes: 014940bad8e4 ("uprobes/x86: Send SIGILL if arch_uprobe_post_xol() fails")
Fixes: 0b5256c7f173 ("uprobes: Send SIGILL if handle_trampoline() fails")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 kernel/events/uprobes.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 3207a4d26849..2bf792d22087 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1858,7 +1858,7 @@ static void handle_trampoline(struct pt_regs *regs)
 
  sigill:
 	uprobe_warn(current, "handle uretprobe, sending SIGILL.");
-	force_sig_info(SIGILL, SEND_SIG_FORCED, current);
+	force_sig(SIGILL, current);
 
 }
 
@@ -1966,7 +1966,7 @@ static void handle_singlestep(struct uprobe_task *utask, struct pt_regs *regs)
 
 	if (unlikely(err)) {
 		uprobe_warn(current, "execute the probed insn, sending SIGILL.");
-		force_sig_info(SIGILL, SEND_SIG_FORCED, current);
+		force_sig(SIGILL, current);
 	}
 }
 
-- 
2.17.1


  parent reply	other threads:[~2018-09-03 20:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-03 20:41 [PATCH 00/10] Removing SEND_SIG_FORCED Eric W. Biederman
2018-09-03 20:41 ` Eric W. Biederman
2018-09-03 20:44 ` [PATCH 01/10] signal: Always ignore SIGKILL and SIGSTOP sent to the global init Eric W. Biederman
2018-09-03 20:44 ` Eric W. Biederman [this message]
2018-09-03 20:44 ` [PATCH 03/10] signal: Properly deliver SIGSEGV from x86 uprobes Eric W. Biederman
2018-09-03 20:44 ` [PATCH 04/10] signal: Always deliver the kernel's SIGKILL and SIGSTOP to a pid namespace init Eric W. Biederman
2018-09-03 20:44 ` [PATCH 05/10] signal: send_sig_all no longer needs SEND_SIG_FORCED Eric W. Biederman
2018-09-03 20:44 ` [PATCH 06/10] signal: Remove the siginfo paramater from kernel_dqueue_signal Eric W. Biederman
2018-09-03 20:44 ` [PATCH 07/10] signal: Don't send siginfo to kthreads Eric W. Biederman
2018-09-03 20:44 ` [PATCH 08/10] signal: Never allocate siginfo for SIGKILL or SIGSTOP Eric W. Biederman
2018-09-03 20:44 ` [PATCH 09/10] signal: Use SEND_SIG_PRIV not SEND_SIG_FORCED with SIGKILL and SIGSTOP Eric W. Biederman
2018-09-03 20:44 ` [PATCH 10/10] signal: Remove SEND_SIG_FORCED Eric W. Biederman
2018-09-08 11:03 ` [PATCH 00/10] Removing SEND_SIG_FORCED Thomas Gleixner
2018-09-16 18:04 ` [PATCH 0/4] signal: Cleanups Eric W. Biederman
2018-09-16 18:04   ` [PATCH 1/4] tty_io: Use group_send_sig_info in __do_SACK to note it is a session being killed Eric W. Biederman
2018-09-16 18:05   ` [PATCH 2/4] signal: Use group_send_sig_info to kill all processes in a pid namespace Eric W. Biederman
2018-09-16 18:06   ` [PATCH 3/4] signal: Remove specific_send_sig_info Eric W. Biederman
2018-09-16 18:06   ` [PATCH 4/4] signal: Pair exports with their functions Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180903204430.25473-2-ebiederm@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.