Re: [PATCH] Re: bad pmd ffff810000207238(9090909090909090).

From: Jan Engelhardt
Date: Wed May 28 2008 - 17:24:58 EST



On Wednesday 2008-05-28 22:43, Willy Tarreau wrote:
>> >
>> >Is there a particular reason we use 0x90 as an alignment filler ?
>>
>> Alignment within functions. You could use a JMP to jump over
>> the alignment, but that would be costly. So in order to
>> "run through the wall", you need an opcode that does not
>> do anything, something like 0x90.
>> 0xAF would map to scasd on x86, and I'd hardly call that a
>> no-op.
>
>OK, I did not understand from Hugh's explanation that it was
>all about alignment within functions. Of course, 0x90 is fine
>there (though there are multi-byte NOPs available).

"All about alignment within functions" -- I am not sure about that,
you just happened to ask about 0x90 :)
And if you have a 1-byte NOP (which fits perfectly everywhere),
which is also a real NOP (and not just a filler byte that could
possibly be an opcode doing something very different), you've
got an ideal candidate for padding, no?
There is probably nothing wrong with padding .data sections
with 0xAF or even 0xDB and ud2 to catch execute-readonly-data
cases. To that end, I think something like that should be
proposed to binutils.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/