[PATCH 0/2] Arm32: memset() & friends

Jan Beulich posted 2 patches 1 year, 8 months ago
Failed in applying to current master (apply log)
[PATCH 0/2] Arm32: memset() & friends
Posted by Jan Beulich 1 year, 8 months ago
Note that while the original Linux code has the same issue, I don't
really fancy sending there a patch similar to patch 1. That's because
my XSA-307 related "make find_next_{,zero_}bit() have well defined
behavior" was entirely ignored, so I would expect nothing better here.

1: correct string.h functions for "int" -> "unsigned char" conversion
2: tidy the memset() macro

Really I happened to be looking at the memset() macro, being a little
surprised of the special casing of 0 there. As a result I was curious to
see how much more efficient __memzero() really was compared to memset().
The first thing which actually caught my attention is that part of
__memzero()'s code lives outside of the function (i.e. ahead of
ENTRY()). This saves a branch (and interestingly memset() does _not_ do
the same), but (a) renders the ELF symbol table somewhat wrong and (b)
leaves debug info generated with gas 2.39 not covering the entire
function in the new subprogram DIE that it generates (line number info
and .debug_ranges are correct nevertheless).

Jan
Re: [PATCH 0/2] Arm32: memset() & friends
Posted by Julien Grall 1 year, 8 months ago

On 19/08/2022 08:48, Jan Beulich wrote:
> Note that while the original Linux code has the same issue, I don't
> really fancy sending there a patch similar to patch 1. That's because
> my XSA-307 related "make find_next_{,zero_}bit() have well defined
> behavior" was entirely ignored, so I would expect nothing better here.

Would you be able to point me to the discussion?

Cheers,

-- 
Julien Grall
Re: [PATCH 0/2] Arm32: memset() & friends
Posted by Jan Beulich 1 year, 8 months ago
On 19.08.2022 10:32, Julien Grall wrote:
> On 19/08/2022 08:48, Jan Beulich wrote:
>> Note that while the original Linux code has the same issue, I don't
>> really fancy sending there a patch similar to patch 1. That's because
>> my XSA-307 related "make find_next_{,zero_}bit() have well defined
>> behavior" was entirely ignored, so I would expect nothing better here.
> 
> Would you be able to point me to the discussion?

Hmm, I can't spot it on
https://patchwork.kernel.org/project/linux-arm-kernel/list/ , but
then again there are only very few entries there anyway which pre-
date July 2022. I've been able to easily spot it at
https://lore.kernel.org/linux-arm-kernel/5809eac9-aae3-e111-7301-a1aa76c0f626@suse.com/

Jan