[Bug binutils/19005] objcopy buffer-over-read

2015-09-30 Thread ams at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #23 from Andrew Stubbs --- Done: pr19020. -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.g

[Bug binutils/19005] objcopy buffer-over-read

2015-09-29 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #22 from H.J. Lu --- (In reply to Andrew Stubbs from comment #21) > Looks like I'm just too late with my test results you broke the > interleave feature. :-( > > The "interleave size" testcase in my patch demonstrates the prob

[Bug binutils/19005] objcopy buffer-over-read

2015-09-29 Thread ams at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #21 from Andrew Stubbs --- Looks like I'm just too late with my test results you broke the interleave feature. :-( The "interleave size" testcase in my patch demonstrates the problem. Here's the output: $ xxd tmpdir/interleav

[Bug binutils/19005] objcopy buffer-over-read

2015-09-29 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 H.J. Lu changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|---

[Bug binutils/19005] objcopy buffer-over-read

2015-09-29 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #19 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by H.J. Lu : https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c68c16371639f360d1b110eacf4b1a28ddb5cf53 commit c68c16371639f360d1b110eacf4b1a2

[Bug binutils/19005] objcopy buffer-over-read

2015-09-28 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #18 from H.J. Lu --- (In reply to Andrew Stubbs from comment #17) > I can check this tomorrow, but I don't think the output size is actually > broken, as long as everything respects the input size when reading from > input sections

[Bug binutils/19005] objcopy buffer-over-read

2015-09-28 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 H.J. Lu changed: What|Removed |Added Attachment #8634|0 |1 is obsolete|

[Bug binutils/19005] objcopy buffer-over-read

2015-09-28 Thread ams at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #17 from Andrew Stubbs --- I can check this tomorrow, but I don't think the output size is actually broken, as long as everything respects the input size when reading from input sections. The "change something, change it back, chan

[Bug binutils/19005] objcopy buffer-over-read

2015-09-28 Thread ams at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #15 from Andrew Stubbs --- It's just because the padding is added to the output section size when --gap-fill is set in the following snippet: objcopy.c, copy_object() size = bfd_section_size (obfd, osections[i]); gap

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #14 from H.J. Lu --- For your original problem, why is your input section smaller than your output section? -- You are receiving this mail because: You are on the CC list for the bug.

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread ams at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 Andrew Stubbs changed: What|Removed |Added Attachment #8632|0 |1 is obsolete|

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #12 from H.J. Lu --- (In reply to Andrew Stubbs from comment #11) > My testcase was not really for reverse. I was trying to test for the buffer > overrun, but as that's UB there's no direct way to do it reliably. Testing > reverse

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread ams at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #11 from Andrew Stubbs --- My testcase was not really for reverse. I was trying to test for the buffer overrun, but as that's UB there's no direct way to do it reliably. Testing reverse was only meant to serve as an indicator that

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #10 from H.J. Lu --- (In reply to Andrew Stubbs from comment #9) > No, it's the call to bfd_set_section_contents in which the UB occurs. You > can see this with valgrind: > I got [hjl@gnu-6 pr19005]$ cat x.S .text

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 H.J. Lu changed: What|Removed |Added CC||hjl.tools at gmail dot com -- You are rece

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread ams at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #9 from Andrew Stubbs --- No, it's the call to bfd_set_section_contents in which the UB occurs. You can see this with valgrind: ==14966== Invalid read of size 1 ==14966==at 0x50AA0A0: _IO_default_xsputn (genops.c:480) ==14966=

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 H.J. Lu changed: What|Removed |Added Attachment #8633|0 |1 is obsolete|

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #7 from H.J. Lu --- Created attachment 8633 --> https://sourceware.org/bugzilla/attachment.cgi?id=8633&action=edit A simple patch How about this simple patch? Does it work for you? -- You are receiving this mail because: You a

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread ams at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #6 from Andrew Stubbs --- It's a negative test. No error *is* a failure. -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-b

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 H.J. Lu changed: What|Removed |Added Status|ASSIGNED|WAITING --- Comment #5 from H.J. Lu --- On

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread ams at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 Andrew Stubbs changed: What|Removed |Added Attachment #8631|0 |1 is obsolete|

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread ams at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 Andrew Stubbs changed: What|Removed |Added Attachment #8629|0 |1 is obsolete|

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread ams at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 Andrew Stubbs changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigne

[Bug binutils/19005] objcopy buffer-over-read

2015-09-25 Thread ams at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19005 --- Comment #1 from Andrew Stubbs --- Created attachment 8629 --> https://sourceware.org/bugzilla/attachment.cgi?id=8629&action=edit test case I've attached a test suite patch that detects the issue. -- You are receiving this mail because