All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Barbieri <ldb@ldb.ods.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux-Kernel ML <linux-kernel@vger.kernel.org>
Subject: [PATCH] Set TIF_IRET in more places
Date: Mon, 6 Jan 2003 15:46:01 +0100	[thread overview]
Message-ID: <20030106144601.GA2447@ldb> (raw)

[-- Attachment #1: Type: text/plain, Size: 1619 bytes --]

This patch adds code to set TIF_IRET in sigsuspend and rt_sigsuspend
(since they change registers to invoke signal handlers) and ptrace
setregs.  This prevents clobbering of %ecx and %edx.


diff --exclude-from=/home/ldb/src/exclude -urNdp --exclude='speedtouch.*' --exclude='atmsar.*' linux-2.5.54/arch/i386/kernel/ptrace.c linux-2.5.54-ldb/arch/i386/kernel/ptrace.c
--- linux-2.5.54/arch/i386/kernel/ptrace.c	2003-01-02 04:21:29.000000000 +0100
+++ linux-2.5.54-ldb/arch/i386/kernel/ptrace.c	2003-01-04 19:06:07.000000000 +0100
@@ -74,6 +74,8 @@ static inline int put_stack_long(struct 
 static int putreg(struct task_struct *child,
 	unsigned long regno, unsigned long value)
 {
+	set_tsk_thread_flag(child, TIF_IRET);
+
 	switch (regno >> 2) {
 		case FS:
 			if (value && (value & 3) != 3)
diff --exclude-from=/home/ldb/src/exclude -urNdp --exclude='speedtouch.*' --exclude='atmsar.*' linux-2.5.54/arch/i386/kernel/signal.c linux-2.5.54-ldb/arch/i386/kernel/signal.c
--- linux-2.5.54/arch/i386/kernel/signal.c	2003-01-02 04:21:53.000000000 +0100
+++ linux-2.5.54-ldb/arch/i386/kernel/signal.c	2003-01-04 19:06:07.000000000 +0100
@@ -44,6 +44,7 @@ sys_sigsuspend(int history0, int history
 	spin_unlock_irq(&current->sig->siglock);
 
 	regs->eax = -EINTR;
+	set_thread_flag(TIF_IRET);
 	while (1) {
 		current->state = TASK_INTERRUPTIBLE;
 		schedule();
@@ -73,6 +74,7 @@ sys_rt_sigsuspend(sigset_t *unewset, siz
 	spin_unlock_irq(&current->sig->siglock);
 
 	regs->eax = -EINTR;
+	set_thread_flag(TIF_IRET);	
 	while (1) {
 		current->state = TASK_INTERRUPTIBLE;
 		schedule();

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2003-01-06 14:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-06 14:46 Luca Barbieri [this message]
2003-01-06 16:04 ` [PATCH] Set TIF_IRET in more places Linus Torvalds
2003-01-06 18:17   ` Luca Barbieri
2003-01-06 18:42     ` Ulrich Drepper
2003-01-06 18:49     ` Linus Torvalds
2003-01-06 20:26       ` Luca Barbieri
  -- strict thread matches above, loose matches on Subject: below --
2003-01-06 21:34 Zack Weinberg
2003-01-07 11:19 ` Jamie Lokier
2003-01-07 17:42   ` Linus Torvalds
2003-01-07 19:27   ` Zack Weinberg
2003-01-08  1:21     ` Richard Henderson
2003-01-08  2:33       ` Linus Torvalds
2003-01-08  3:32         ` Daniel Jacobowitz
2003-01-08 16:29       ` Jamie Lokier
2003-01-09  6:49         ` Zack Weinberg

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=20030106144601.GA2447@ldb \
    --to=ldb@ldb.ods.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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.