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-next>] [day] [month] [year] [list]
Message-ID: <20241029140036.577804-1-kernel@jfarr.cc>
Date: Tue, 29 Oct 2024 15:00:35 +0100
From: Jan Hendrik Farr <kernel@...rr.cc>
To: kees@...nel.org
Cc: nathan@...nel.org,
	ojeda@...nel.org,
	ndesaulniers@...gle.com,
	morbo@...gle.com,
	justinstitt@...gle.com,
	thorsten.blum@...lux.com,
	ardb@...nel.org,
	oliver.sang@...el.com,
	gustavoars@...nel.org,
	kent.overstreet@...ux.dev,
	arnd@...db.de,
	gregkh@...uxfoundation.org,
	akpm@...ux-foundation.org,
	tavianator@...ianator.com,
	linux-hardening@...r.kernel.org,
	llvm@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	stable@...r.kernel.org,
	kernel@...rr.cc
Subject: [PATCH 0/1] disable __counted_by for clang < 19.1.3

Hi Kees,

Bill's PR to disable __counted_by for "whole struct" __bdos cases has now
been merged into 19.1.3 [1], so here's the patch to disable __counted_by
for clang versions < 19.1.3 in the kernel.

Hopefully in the near future __counted_by for whole struct __bdos can be
enabled once again in coordination between the kernel, gcc, and clang.
There has been recent progress on this in [2] thanks to Tavian.

Also see previous discussion on the mailing list [3]

Thanks to everyone for moving this issue along. In particular, Bill for
his PR to clang/llvm, Kees and Thorsten for reproducers of the two issues,
Nathan for Kconfig-ifying this patch, and Miguel for reviewing.


Info for the stable team:

This patch should be backported to kernels >= 6.6 to make sure that those
build correctly with the effected clang versions. This patch cherry-picks
cleanly onto linux-6.11.y. For linux-6.6.y three prerequiste commits are
neded:

16c31dd7fdf6: Compiler Attributes: counted_by: bump min gcc version
2993eb7a8d34: Compiler Attributes: counted_by: fixup clang URL
231dc3f0c936: lkdtm/bugs: Improve warning message for compilers without counted_by support

There are still two merge conflicts even with those prerequistes.
Here's the correct resolution:

1. include/linux/compiler_types.h:
	use the incoming change until before (but not including) the
        "Apply __counted_by() when the Endianness matches to increase test coverage."
        comment

2. lib/overflow_kunit.c: 
	HEAD is correct

[1] https://github.com/llvm/llvm-project/pull/112786
[2] https://github.com/llvm/llvm-project/pull/112636
[3] https://lore.kernel.org/lkml/3E304FB2-799D-478F-889A-CDFC1A52DCD8@toblux.com/T/#m204c09f63c076586a02d194b87dffc7e81b8de7b

Best Regards
Jan

Jan Hendrik Farr (1):
  Compiler Attributes: disable __counted_by for clang < 19.1.3

 drivers/misc/lkdtm/bugs.c           |  2 +-
 include/linux/compiler_attributes.h | 13 -------------
 include/linux/compiler_types.h      | 19 +++++++++++++++++++
 init/Kconfig                        |  9 +++++++++
 lib/overflow_kunit.c                |  2 +-
 5 files changed, 30 insertions(+), 15 deletions(-)

-- 
2.47.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ