lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMEtUux-ekQdx2M0e=py81zvAGWo4r6Upxmwfvcrv739kSH_oQ@mail.gmail.com>
Date:	Mon, 14 Apr 2014 23:31:51 -0700
From:	Alexei Starovoitov <ast@...mgrid.com>
To:	Andy Lutomirski <luto@...capital.net>
Cc:	David Miller <davem@...emloft.net>,
	Daniel Borkmann <dborkman@...hat.com>,
	Network Development <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Eric Paris <eparis@...hat.com>,
	James Morris <james.l.morris@...cle.com>,
	Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH] seccomp: fix populating a0-a5 syscall args in 32-bit x86 BPF

On Mon, Apr 14, 2014 at 1:28 PM, Andy Lutomirski <luto@...capital.net> wrote:
> On Mon, Apr 14, 2014 at 1:24 PM, David Miller <davem@...emloft.net> wrote:
>> From: Andy Lutomirski <luto@...capital.net>
>> Date: Mon, 14 Apr 2014 13:13:45 -0700
>>
>>> I think this description is wrong.  (unsigned long *) &sd->args[1] is
>>> the right location, at least on 32-bit little-endian architectures.
>>
>> It absolutely is not.
>
> Huh?  It's a pointer to the right address, but the type is wrong.
>
> The changelog says "on 32-bit x86 (or any other 32bit arch), it would
> result in storing a0-a5 at wrong offsets in args[] member".  Unless
> I'm mistaken, this is incorrect: a0-a5 are are the correct offsets,
> but they are stored with the wrong type, so the other bits in there
> are garbage.

agree. your above description is more correct than the log.
We were focusing on the bug itself and the log came a bit misleading
as a result of multiple iterations back and forth between me and Daniel.

also the log says:
"gcc is clever and optimizes the copy away in other cases, e.g. x86_64"
since we actually checked assembler, so the fix doesn't pessimize
64-bit architectures :)
This function is in critical path for seccomp, so performance definitely
matters.

>>
>> The thing is a u64, and we must respect that type in a completely
>> portable way.
>>
>> Daniel's change is %100 correct, portable, and doesn't have any
>> ugly ifdef crap.
>>
>
> I have no problem with the patch itself.  I'm suggesting that a better
> changelog message would confuse other people reading the same patch
> less.
>
> --Andy
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ