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: <7bef8129-55b4-40e4-80c2-d319b8d6c251@embeddedor.com>
Date: Fri, 18 Oct 2024 12:55:10 -0600
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Kees Cook <kees@...nel.org>, Andrew Lunn <andrew@...n.ch>,
 Johannes Berg <johannes@...solutions.net>
Cc: "Gustavo A. R. Silva" <gustavoars@...nel.org>,
 Andrew Lunn <andrew+netdev@...n.ch>, David Ahern <dsahern@...nel.org>,
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-hardening@...r.kernel.org
Subject: Re: [PATCH 4/5][next] uapi: net: arp: Avoid
 -Wflex-array-member-not-at-end warnings


>> These are clearly UAPI files. It would be good to state in the commit
>> message why this is a safe change, at the source level.

Yes, I'll update it!

> 
> I think we can avoid complicating UAPI by doing something like this in
> include/uapi/linux/socket.h:
> 
> #ifdef __KERNEL__
> #define __kernel_sockaddr_legacy        sockaddr_legacy
> #else
> #define __kernel_sockaddr_legacy        sockaddr
> #endif
> 
> And then the UAPI changes can use __kernel_sockaddr_legacy and userspace
> will resolve to sockaddr (unchanged), and the kernel internals will
> resolve to sockaddr_legacy (fixing the warnings).

Here are a couple of test patches (Don't mind the changelog text):

https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?h=testing/wfamnae-next20241015-2&id=c3b631a5036cbf45b3308d563bf74a518490f3e6
https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?h=testing/wfamnae-next20241015-2&id=66db096a530b95ce0ac33f9fdec66401ec5f2204

__kernel_sockaddr_legacy seems a bit too long, but at the same time
it makes it quite clear what's going on.

Thanks
--
Gustavo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ