Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 90845 - GRUB, XFS and writable strings == segfault
Summary: GRUB, XFS and writable strings == segfault
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Robert Moss (RETIRED)
URL:
Whiteboard:
Keywords:
: 96095 97571 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-29 04:50 UTC by Sven Wegener
Modified: 2005-07-01 03:49 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
grub-xfs-writable-strings.patch (grub-xfs-writable-strings.patch,497 bytes, patch)
2005-04-29 04:51 UTC, Sven Wegener
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Wegener gentoo-dev 2005-04-29 04:50:32 UTC
This is the same issue I reported yesterday to GRUB bug mailing list. I'll just copy'n'paste the email:

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.
Comment 1 Sven Wegener gentoo-dev 2005-04-29 04:51:41 UTC
Created attachment 57568 [details, diff]
grub-xfs-writable-strings.patch
Comment 2 Sven Wegener gentoo-dev 2005-05-07 19:58:15 UTC
Patch has been accepted by upstream developers and I added it to our package.
I consider this fix important because it breaks fresh install on xfs filesystems.
Comment 3 Sven Wegener gentoo-dev 2005-07-01 03:49:04 UTC
*** Bug 96095 has been marked as a duplicate of this bug. ***
Comment 4 Sven Wegener gentoo-dev 2005-07-01 03:49:12 UTC
*** Bug 97571 has been marked as a duplicate of this bug. ***