mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Jakub Jelinek <jakub@redhat.com>, Dave Jones <davej@redhat.com>,
	drepper@redhat.com, mingo@redhat.com, tglx@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] asmlinkage_protect sys_io_getevents
Date: Thu, 10 Apr 2008 15:38:45 -0700 (PDT)	[thread overview]
Message-ID: <20080410223845.EC4B826F992@magilla.localdomain> (raw)
In-Reply-To: Linus Torvalds's message of  Thursday, 10 April 2008 14:51:11 -0700 <alpine.LFD.1.00.0804101447240.3143@woody.linux-foundation.org>

Use asmlinkage_protect in sys_io_getevents, because GCC for i386 with
CONFIG_FRAME_POINTER=n can decide to clobber an argument word on the
stack, i.e. the user struct pt_regs.  Here the problem is not a tail
call, but just the compiler's use of the stack when it inlines and
optimizes the body of the called function.  This seems to avoid it.

Signed-off-by: Roland McGrath <roland@redhat.com>
---
 fs/aio.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 6af9219..60a4cd4 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1790,6 +1790,7 @@ asmlinkage long sys_io_getevents(aio_context_t ctx_id,
 		put_ioctx(ioctx);
 	}
 
+	asmlinkage_protect(5, ret, ctx_id, min_nr, nr, events, timeout);
 	return ret;
 }
 

      parent reply	other threads:[~2008-04-10 22:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080410155940.GA11721@redhat.com>
     [not found] ` <alpine.LFD.1.00.0804100906470.3143@woody.linux-foundation.org>
     [not found]   ` <20080410165244.GV20478@devserv.devel.redhat.com>
     [not found]     ` <alpine.LFD.1.00.0804101009420.3143@woody.linux-foundation.org>
     [not found]       ` <alpine.LFD.1.00.0804101415450.3143@woody.linux-foundation.org>
     [not found]         ` <20080410214114.GY20478@devserv.devel.redhat.com>
     [not found]           ` <alpine.LFD.1.00.0804101447240.3143@woody.linux-foundation.org>
2008-04-10 22:37             ` [PATCH 1/2] asmlinkage_protect replaces prevent_tail_call Roland McGrath
2008-04-11 11:46               ` [PATCH] Fix compile breakage caused by asmlinkage_protect Heiko Carstens
2008-04-11 14:46                 ` Linus Torvalds
2008-04-11 15:06                   ` Jakub Jelinek
2008-04-11 15:11                   ` Al Viro
2008-04-11 15:25                     ` Linus Torvalds
2008-04-11 15:37                       ` Kyle McMartin
2008-04-11 16:03                         ` Martin Schwidefsky
2008-04-11 17:09                           ` Adrian Bunk
2008-04-10 22:38             ` Roland McGrath [this message]

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=20080410223845.EC4B826F992@magilla.localdomain \
    --to=roland@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=drepper@redhat.com \
    --cc=jakub@redhat.com \
    --cc=mingo@redhat.com \
    --cc=tglx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®