Bug 4722 - Memory corruption from gas
Summary: Memory corruption from gas
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.17
: P2 critical
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-02 18:47 UTC by Mikkel Lauritsen
Modified: 2007-07-03 02:42 UTC (History)
1 user (show)

See Also:
Host: i686-linux-gnu
Target: vax-linux-uclibc
Build:
Last reconfirmed:


Attachments
Patch for gas to fix memory corruption issue (154 bytes, patch)
2007-07-02 18:50 UTC, Mikkel Lauritsen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikkel Lauritsen 2007-07-02 18:47:36 UTC
When cross-compiling kernel/signal.c from the Linux kernel for Vax on an i686
Linux PC the assembler crashes with memory corruption reported by libc. Using
libefence turns the error into a segmentation fault.

The error is caused by lines 550-552 in app.c. If the from-buffer contains more
text than the space left in the to-buffer to ends up pointing after the buffer,
and the next call of PUT writes beyond the end.

To fix the problem something like the attached patch could be used - it just
copies the check from PUT.
Comment 1 Mikkel Lauritsen 2007-07-02 18:50:23 UTC
Created attachment 1910 [details]
Patch for gas to fix memory corruption issue
Comment 2 Alan Modra 2007-07-03 02:42:51 UTC
Thanks! Patch applied.