[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen/build-id: Fix xen_build_id_check() to be robust against malformed notes



>>> On 07.01.19 at 18:34, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 07/01/2019 10:36, Jan Beulich wrote:
>>>>> On 31.12.18 at 18:34, <andrew.cooper3@xxxxxxxxxx> wrote:
>>> A NT_GNU_BUILD_ID with namesz longer than 4 will cause the strncmp() to use
>>> bytes in adjacent stringtable entries.
>>>
>>> Instead, check for namesz exactly equal to 4,
>> Is that a requirement spelled out anywhere? Till now I've been
>> under the impression that e.g. 8 bytes of name are fine as well,
>> as long as the first four of them are "GNU\0".
> 
> No idea, but if this is true then we've got bigger problems with parsing
> the notes.

Okay, I've gone and checked the spec
(http://www.sco.com/developers/gabi/latest/ch5.pheader.html#note_section)
and to me it is not entirely unambiguous but matches up better
with the behavior that you want to establish than the more
relaxed one I was suggesting. IOW
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
albeit I'd like to note that we're still not in line with the doc above
as far as padding is concerned. But there was a lengthy discussion
on the gABI mailing list not so long ago, because the spelled out
behavior also is not in line with what binutils does, nor with what
older gABI versions did mandate.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.