Re: [PATCH] kunit/stackinit: Use fill byte different from Clang i386 pattern

2025-03-05 Thread Kees Cook
On Tue, 04 Mar 2025 14:56:11 -0800, Kees Cook wrote: > The byte initialization values used with -ftrivial-auto-var-init=pattern > (CONFIG_INIT_STACK_ALL_PATTERN=y) depends on the compiler, architecture, > and byte position relative to struct member types. On i386 with Clang, > this includes the 0xF

Re: [PATCH] kbuild: clang: Support building UM with SUBARCH=i386

2025-03-05 Thread Kees Cook
On Wed, Mar 05, 2025 at 03:45:54PM +0100, Nathan Chancellor wrote: > On Tue, Mar 04, 2025 at 09:07:57AM -0800, Kees Cook wrote: > > On Tue, Mar 04, 2025 at 03:51:19PM +0100, Thomas Weißschuh wrote: > > > No, it doesn't. > > > > > > Running tests with: > > > $ .kunit/linux kunit.filter_glob=overflo

[PATCH stable 5.4 3/3] overflow: Allow mixed type arguments

2025-03-05 Thread Florian Fainelli
From: Kees Cook When the check_[op]_overflow() helpers were introduced, all arguments were required to be the same type to make the fallback macros simpler. However, now that the fallback macros have been removed[1], it is fine to allow mixed types, which makes using the helpers much more useful,

Re: [PATCH v9 0/7] mseal system mappings

2025-03-05 Thread Andrew Morton
On Wed, 5 Mar 2025 02:17:04 + jef...@chromium.org wrote: > This is V9 version, addressing comments from V8, without code logic > change. I added this series to mm.git, thanks all.

Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-03-05 Thread Kees Cook
On Wed, Mar 05, 2025 at 05:31:57PM +, Qing Zhao wrote: > This does look like a bug in the compiler, could you please file a bug > against GCC on this? Okay, thanks for taking a looking! GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119132 Clang: https://github.com/llvm/llvm-project/issue

Re: [PATCH v4 0/7] Add support for the Exynos7870 SoC, along with three devices

2025-03-05 Thread Krzysztof Kozlowski
On 28/02/2025 20:46, Kaustabh Chakraborty wrote: > Additional features implemented in this series include: > * I2C- touchscreen, IIO sensors, etc. > * UART - bluetooth and serial debugging > * MMC- eMMC, Wi-Fi SDIO, SDCard > * USB- micro-USB 2.0 interface > > Buil

Re: (subset) [PATCH v4 3/7] soc: samsung: exynos-chipid: add support for exynos7870

2025-03-05 Thread Krzysztof Kozlowski
On Sat, 01 Mar 2025 01:16:51 +0530, Kaustabh Chakraborty wrote: > Add the product ID of Exynos7870 (S5E7870) to the existing list. > > Applied, thanks! [3/7] soc: samsung: exynos-chipid: add support for exynos7870 https://git.kernel.org/krzk/linux/c/13a24175005fad410464bee482ed58af144b

Re: (subset) [PATCH v4 1/7] dt-bindings: soc: samsung: exynos-pmu: add exynos7870-pmu compatible

2025-03-05 Thread Krzysztof Kozlowski
On Sat, 01 Mar 2025 01:16:49 +0530, Kaustabh Chakraborty wrote: > Document the compatible string for the Exynos7870 PMU. It's compatible > with the Exynos7 PMU design. It handles syscon reboot, syscon reboot mode, > as well as other system control registers (i.e registers for the USB PHY). > >

Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-03-05 Thread Qing Zhao
> On Mar 4, 2025, at 23:57, Kees Cook wrote: > > On Tue, Mar 04, 2025 at 09:58:21AM +0100, Thorsten Blum wrote: >> On 3. Mar 2025, at 19:44, Kees Cook wrote: >>> On Mon, Mar 03, 2025 at 12:02:22AM +0100, Thorsten Blum wrote: Convert mux_control_ops to a flexible array member at the end of

Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-03-05 Thread Qing Zhao
> On Mar 4, 2025, at 23:57, Kees Cook wrote: > > #include > #include > > struct foo { >int count; >int array[] __attribute__((__counted_by__(count))); > }; > > int main(int argc, char *argv[]) { >int num_elems = 2 + argc; > >struct foo *p = malloc(sizeof(*p) + num_elems *

Re: [PATCH v9 1/7] mseal sysmap: kernel config and header change

2025-03-05 Thread Jeff Xu
On Tue, Mar 4, 2025 at 9:57 PM Lorenzo Stoakes wrote: > > On Wed, Mar 05, 2025 at 05:54:24AM +, Lorenzo Stoakes wrote: > > On Wed, Mar 05, 2025 at 02:17:05AM +, jef...@chromium.org wrote: > > > From: Jeff Xu > > > > > > Provide infrastructure to mseal system mappings. Establish > > > two

Re: [PATCH v9 0/7] mseal system mappings

2025-03-05 Thread Jeff Xu
On Tue, Mar 4, 2025 at 9:51 PM Lorenzo Stoakes wrote: > > On Wed, Mar 05, 2025 at 02:17:04AM +, jef...@chromium.org wrote: > > From: Jeff Xu > > > > This is V9 version, addressing comments from V8, without code logic > > change. > > > >

Re: [PATCH] kunit/stackinit: Use fill byte different from Clang i386 pattern

2025-03-05 Thread Nathan Chancellor
On Tue, Mar 04, 2025 at 02:56:11PM -0800, Kees Cook wrote: > The byte initialization values used with -ftrivial-auto-var-init=pattern > (CONFIG_INIT_STACK_ALL_PATTERN=y) depends on the compiler, architecture, > and byte position relative to struct member types. On i386 with Clang, > this includes t

Re: [PATCH] kbuild: clang: Support building UM with SUBARCH=i386

2025-03-05 Thread Nathan Chancellor
On Tue, Mar 04, 2025 at 09:07:57AM -0800, Kees Cook wrote: > On Tue, Mar 04, 2025 at 03:51:19PM +0100, Thomas Weißschuh wrote: > > No, it doesn't. > > > > Running tests with: > > $ .kunit/linux kunit.filter_glob=overflow.DEFINE_FLEX_test kunit.enable=1 > > mem=1G console=tty kunit_shutdown=halt >

Re: [tip: perf/core] perf/x86: Annotate struct bts_buffer with __counted_by()

2025-03-05 Thread Thorsten Blum
On 5. Mar 2025, at 12:02, Ingo Molnar wrote: > * Thorsten Blum wrote: >> On 5. Mar 2025, at 10:18, Ingo Molnar wrote: >>> Actually, on a second thought: >>> - buf = kzalloc_node(offsetof(struct bts_buffer, buf[nbuf]), GFP_KERNEL, node); + buf = kzalloc_node(struct_size(buf, buf, n

[PATCH v2] perf/x86: Annotate struct bts_buffer with __counted_by()

2025-03-05 Thread Thorsten Blum
Add the __counted_by() compiler attribute to the flexible array member buf to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. No functional changes intended. Signed-off-by: Thorsten Blum --- Changes in v2: - struct_size() changes should be a separate patch as su

[PATCH] perf/x86: Annotate struct bts_buffer with __counted_by()

2025-03-05 Thread Thorsten Blum
Add the __counted_by() compiler attribute to the flexible array member buf to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Use struct_size() to calculate the number of bytes to allocate for a new bts_buffer. Compared to offsetof(), struct_size() has additional

Re: [tip: perf/core] perf/x86: Annotate struct bts_buffer with __counted_by()

2025-03-05 Thread Ingo Molnar
* Thorsten Blum wrote: > On 5. Mar 2025, at 10:18, Ingo Molnar wrote: > > Actually, on a second thought: > > > >> - buf = kzalloc_node(offsetof(struct bts_buffer, buf[nbuf]), GFP_KERNEL, > >> node); > >> + buf = kzalloc_node(struct_size(buf, buf, nbuf), GFP_KERNEL, node); > > > > Firstly, in

Re: [tip: perf/core] perf/x86: Annotate struct bts_buffer with __counted_by()

2025-03-05 Thread Thorsten Blum
On 5. Mar 2025, at 10:18, Ingo Molnar wrote: > Actually, on a second thought: > >> - buf = kzalloc_node(offsetof(struct bts_buffer, buf[nbuf]), GFP_KERNEL, >> node); >> + buf = kzalloc_node(struct_size(buf, buf, nbuf), GFP_KERNEL, node); > > Firstly, in what world is 'buf, buf' more readable? On

[PATCH] xfs: Replace deprecated strncpy() with strscpy()

2025-03-05 Thread Thorsten Blum
strncpy() is deprecated for NUL-terminated destination buffers. Use strscpy() instead and remove the manual NUL-termination. No functional changes intended. Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Thorsten Blum --- fs/xfs/xfs_xattr.c | 4