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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 05 May 2024 17:22:10 +0200
From: Sven Eckelmann <sven@...fation.org>
To: Erick Archer <erick.archer@...look.com>
Cc: Marek Lindner <mareklindner@...mailbox.ch>,
 Simon Wunderlich <sw@...onwunderlich.de>, Antonio Quartulli <a@...table.cc>,
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Nathan Chancellor <nathan@...nel.org>,
 Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling <morbo@...gle.com>,
 Justin Stitt <justinstitt@...gle.com>, Kees Cook <keescook@...omium.org>,
 "Gustavo A. R. Silva" <gustavoars@...nel.org>,
 Erick Archer <erick.archer@...look.com>, b.a.t.m.a.n@...ts.open-mesh.org,
 linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
 linux-hardening@...r.kernel.org, llvm@...ts.linux.dev,
 Alexander Lobakin <aleksander.lobakin@...el.com>
Subject:
 Re: [PATCH v3] batman-adv: Add flex array to struct batadv_tvlv_tt_data

On Saturday, 4 May 2024 19:08:39 CEST Erick Archer wrote:
[...]
> > Thanks for the updates. But I can't accept this at the moment because 
> > __counted_by_be is used in an uapi header without it being defined
> > include/uapi/linux/stddef.h (and this file is also not included in this 
> > header).
> > 
> > See commit c8248faf3ca2 ("Compiler Attributes: counted_by: Adjust name and 
> > identifier expansion") as an example for the similar __counted_by macro.
> 
> If I understand correctly, the following changes are also needed because
> the annotated struct is defined in a "uapi" header. Sorry if it's a stupid
> question, but I'm new to these topics.

No, it is absolutely no stupid question.

> diff --git a/include/uapi/linux/batadv_packet.h b/include/uapi/linux/batadv_packet.h
> index 6e25753015df..41f39d7661c9 100644
> --- a/include/uapi/linux/batadv_packet.h
> +++ b/include/uapi/linux/batadv_packet.h
> @@ -9,6 +9,7 @@
> 
>  #include <asm/byteorder.h>
>  #include <linux/if_ether.h>
> +#include <linux/stddef.h>
>  #include <linux/types.h>
> 
>  /**

This must definitely go into your "original" patch

> diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
> index 2ec6f35cda32..58154117d9b0 100644
> --- a/include/uapi/linux/stddef.h
> +++ b/include/uapi/linux/stddef.h
> @@ -55,4 +55,12 @@
>  #define __counted_by(m)
>  #endif
> 
> +#ifndef __counted_by_le
> +#define __counted_by_le(m)
> +#endif

If you want to add this (for completeness) then please put it in an extra 
patch. It is simply not used by batman-adv and I would not be able to find any 
justification why it should be part of the batman-adv patch.

> +
> +#ifndef __counted_by_be
> +#define __counted_by_be(m)
> +#endif
> +

This part can be either:

* in the batman-adv patch
* or together with the __counted_by_le change in an additional patch which is 
  "in front" of the batman-adv patch (in the patch series).

>From my perspective, it is for you to decide - but of course, other 
maintainers might have a different opinion about it.

>  #endif /* _UAPI_LINUX_STDDEF_H */
> 
> If this is the right path, can these changes be merged into a
> single patch or is it better to add a previous patch to define
> __counted_by{le,be}?

I don't have a perfect answer here. See the comments above. The file 
include/uapi/linux/stddef.h doesn't have a specific maintainer (according to 
./scripts/get_maintainer.pl) - so it should be fine to get modified through 
the net-next tree.

But maybe Kees Cook has a different opinion about it. At least there are a lot 
of Signed-off-bys for this file by Kees.

Kind regards,
	Sven
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ