Re: [PATCH] Improve endian conversion in umac.c

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

 



On Tue, 8 Mar 2022, rapier wrote:

> +    UINT32 temp = *(UINT32 *)ptr;

Can you guarantee it’s aligned? Otherwise, SIGBUS. Maybe not on x86,
other platforms exist and enforce that though (x86’ll just slowdown).

> +    *(UINT32 *)ptr = (i >> 24) | ((i & 0x00FF0000) >> 8 )
> +                   | ((i & 0x0000FF00) << 8 ) | (i << 24);

Can you guarantee it’s aligned *and* not UB? Otherwise, a version of
GCC, possibly a future one, is guaranteed to miscompile that and
pinskia will tell you it’s a feature…

bye,
//mirabilos
-- 
Infrastrukturexperte • tarent solutions GmbH
Am Dickobskreuz 10, D-53121 Bonn • http://www.tarent.de/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 5168 • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

                        ****************************************************
/⁀\ The UTF-8 Ribbon
╲ ╱ Campaign against      Mit dem tarent-Newsletter nichts mehr verpassen:
 ╳  HTML eMail! Also,     https://www.tarent.de/newsletter
╱ ╲ header encryption!
                        ****************************************************
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev




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

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux