[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] GRUB, XFS and writable strings == segfault
From: |
Sven Wegener |
Subject: |
[PATCH] GRUB, XFS and writable strings == segfault |
Date: |
Fri, 29 Apr 2005 01:57:32 +0200 |
User-agent: |
Mutt/1.5.8i |
Hi all!
GRUB has a segfault issue that comes up, when using XFS as the
filesystem for the boot directory and GRUB has been compiled without
writable string support. With current GCC versions writable string
support is disabled by default and -fwritable-string is deprecated.
Programs should not assume that constant strings, which are stored in
the text area of the program, are writable.
The following three lines from stage2/fsys_xfs.c contain the statements
that causes GRUB to segfault:
Line 337 static char *usual[2] = {".", ".."};
Line 339 char *name = usual[0];
Line 405 name[namelen] = 0;
First we declare usual to contain two constant strings. Then we assign
one of them to name and later we (might) try to write to one character
of the string. Please find attached a patch against current CVS that
transforms usual into an array of characters, so that writing to them is
safe.
Cheers,
Sven
--
Sven Wegener
Gentoo Linux Developer
http://www.gentoo.org/
grub-xfs-writable-strings.patch
Description: Text document
pgpzNZ9mFd2ql.pgp
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] GRUB, XFS and writable strings == segfault,
Sven Wegener <=