tags 626488 - moreinfo + patch
thanks
On Thu, May 12, 2011 at 01:06:55PM +0200, Arne Wichmann wrote:
> anhrefn# strace extlinux --install /boot/extlinux
> [...]
> fstat64(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(3, 3), ...}) = 0
> open("/sys/dev/block/3:3/start", O_RDONLY|O_LARGEFILE) = 6
> fstat64(6, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> 0xb777e000
> read(6, "3984120\n", 4096) = 8
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> +++ killed by SIGSEGV +++
> Segmentation fault
> anhrefn#
I found the bug responsible for this. It is stack corruption from
passing a pointer to a pointer argument rather than the pointer itself.
The patch below fixes it. While I can not reproduce the bug myself, it
has fixed the problem for someone who experiences it using the Ubuntu
package of extlinux 4.04. This bug has already been fixed upstream with
git commit 73cd9bf2.
--- extlinux/main.c.orig 2011-07-21 16:08:26.720092239 +0200
+++ extlinux/main.c 2011-07-21 16:08:52.477297116 +0200
@@ -153,7 +153,7 @@
memset(geo, 0, sizeof *geo);
- if (!ioctl(devfd, HDIO_GETGEO, &geo)) {
+ if (!ioctl(devfd, HDIO_GETGEO, geo)) {
goto ok;
} else if (!ioctl(devfd, FDGETPRM, &fd_str)) {
geo->heads = fd_str.head;
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]