lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 6 Oct 2015 07:08:20 +0530
From:	Vaishali Thakkar <>
To:	Felipe Balbi <>
Cc:	David Laight <>,
	Greg Kroah-Hartman <>,
	"" <>,
	"" <>
Subject: Re: [PATCH] usb: gadget: f_uac1: Convert use of __constant_cpu_to_le16
 to cpu_to_le16

On Tue, Oct 6, 2015 at 4:59 AM, Felipe Balbi <> wrote:
> Vaishali Thakkar <> writes:
>> On Mon, Aug 24, 2015 at 2:29 PM, David Laight <> wrote:
>>> From: Vaishali Thakkar []
>>>> Sent: 22 August 2015 02:57
>>> ...
>>>> >> -     .bcdADC =               __constant_cpu_to_le16(0x0100),
>>>> >> -     .wTotalLength =         __constant_cpu_to_le16(UAC_DT_TOTAL_LENGTH),
>>>> >> +     .bcdADC =               cpu_to_le16(0x0100),
>>>> >> +     .wTotalLength =         cpu_to_le16(UAC_DT_TOTAL_LENGTH),
>>>> >
>>>> > Have you test compiled this on a big-endian system?
>>>> > My gut feeling is that is fails.
>>>> No. I have tested it on little-endian system only. But I'll
>>>> be really surprised if this will fail. Can you please tell me
>>>> if I am missing something in this particular case or same
>>>> applies for other cases because most of the cases like
>>>> __constant_<foo> are already converted to <foo>?
>>>> As far as I know, if the argument is a constant the
>>>> conversion happens at compile time. And unfolding both
>>>> definitions returns to same expression. Still I am trying if
>>>> someone can test it for me on big endian system.
>>> Flip one to cpu_to_be16() and see if it still compiles.
>> Yes. It still compiles.
> it's unclear to me if this is really safe to apply. Until then I'm
> dropping this from queue. Seems like, at a minimum, we need a better
> commit log

I compared both .s files [before the change and after the change] and
I don't see any difference between instructions in them. I am not sure
but it looks like if expression contains 'a ? t : f' then either 't'
OR 'f' should
be constant not both.

Also, the code still complies on little endian machines after changing
cpu_to_be16(). And on top of that fact is there are many patches
applied in the kernel from years for the same and very less are remaining.
In case, this fails then I think we need to change those cases as well. But
I have never seen people reporting a bug for the same and changing
<foo> to __constant_<foo> again.

Still I think probably it would be good if someone can test this patch on big
endian machine [just to be sure about the change].

> --
> balbi

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists