All of lore.kernel.org
 help / color / mirror / Atom feed
* x86-64: PT_GNU_STACK exec bit broken under ia32 emulation?
       [not found]               ` <20050127024523.GA6511@master.debian.org>
@ 2005-01-27  9:53                 ` Colin Watson
  0 siblings, 0 replies; only message in thread
From: Colin Watson @ 2005-01-27  9:53 UTC (permalink / raw)
  To: debian-amd64, linux-kernel; +Cc: discuss

On Wed, Jan 26, 2005 at 08:45:23PM -0600, Colin Watson wrote:
> On Wed, Jan 26, 2005 at 05:49:31AM -0600, Colin Watson wrote:
> > I had the exact same problem (on Ubuntu rather than Debian, but hey).
> > Debugging-by-printf revealed that grub segfaulted after calling
> > stage2/builtins.c:disk_read_savesect_func() through the disk_read_func
> > pointer in stage2/disk_io.c:rawread(); output from a printf before that
> > call was printed, while output from a printf at the beginning of the
> > disk_read_savesect_func() call was not printed. It *looks* like the text
> > of that function is corrupt in memory, although I'm not wholly convinced
> > that my debugging techniques were sound there because I'm having trouble
> > debugging a 32-bit binary.
> 
> I think this last sentence was indeed bogus.
> 
> Anyway, I've narrowed down the introduction of the problem to somewhere
> between 2.6.9-bk1 and 2.6.9-bk2. Suggestions for changesets in there
> that could have broken grub would be gratefully appreciated.

Context for LKML and discuss@x86-64; grub segfaults when running its
'install' command (via grub-install) on Debian and Ubuntu systems
running stock kernels >= 2.6.9-bk2, up to and including 2.6.11-rc2-bk3
(haven't tried 2.6.11-rc2-bk4 yet). grub is a 32-bit binary relying on
ia32 emulation. The implementation of the 'install' command in grub uses
nested functions, which require a stack trampoline, and therefore the
executable-stack bit is set on the binary:

  $ readelf -l /sbin/grub | grep STACK
  STACK          0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4

However, booting with noexec=off cures the problem, so it would appear
that the executable stack bit isn't being checked properly at least
under ia32 emulation.

2.6.9-bk1 works fine, but noexec=on only became the default in
2.6.9-bk2; I haven't yet tried booting 2.6.9-bk1 with noexec=on, but I
can try that if it might be helpful.

Thanks,

-- 
Colin Watson                                       [cjwatson@debian.org]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-01-27  9:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <299008303.20050111201628@gmx.net>
     [not found] ` <7772a2590501111121348a6ab@mail.gmail.com>
     [not found]   ` <20050111215733.GB5049@frankengul.org>
     [not found]     ` <41E4603C.20701@comcast.net>
     [not found]       ` <20050112140833.GX10437@ns.snowman.net>
     [not found]         ` <20050112145903.GA9336@frankengul.org>
     [not found]           ` <20050112151350.GY10437@ns.snowman.net>
     [not found]             ` <20050126114931.GA9784@master.debian.org>
     [not found]               ` <20050127024523.GA6511@master.debian.org>
2005-01-27  9:53                 ` x86-64: PT_GNU_STACK exec bit broken under ia32 emulation? Colin Watson

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.