Re: [PATCH v2 7/7] gpio: 74x164: Utilise temporary variable for struct device

2025-02-10 Thread Andy Shevchenko
On Fri, Feb 07, 2025 at 08:56:45PM +0100, Bartosz Golaszewski wrote: > On Fri, Feb 7, 2025 at 4:42 PM Andy Shevchenko > wrote: > > > > On Fri, Feb 07, 2025 at 05:17:14PM +0200, Andy Shevchenko wrote: > > > We have a temporary variable to keep a pointer to struct device. > > > Utilise it where it m

Re: [PATCH v1 2/7] gpio: 74x164: Simplify code with cleanup helpers

2025-02-10 Thread Linus Walleij
On Mon, Feb 3, 2025 at 1:18 PM Andy Shevchenko wrote: > Use macros defined in linux/cleanup.h to automate resource lifetime > control in the driver. > > Signed-off-by: Andy Shevchenko Clearly this is more readable and less prone to accidental bugs. Reviewed-by: Linus Walleij Yours, Linus Wall

Re: [PATCH v1 4/7] gpio: 74x164: Make use of the macros from bits.h

2025-02-10 Thread Linus Walleij
On Mon, Feb 3, 2025 at 1:18 PM Andy Shevchenko wrote: > Make use of BIT() and GENMASK() where it makes sense. > > Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Yours, Linus Walleij

Re: [PATCH v1 4/7] gpio: 74x164: Make use of the macros from bits.h

2025-02-10 Thread Andy Shevchenko
On Mon, Feb 10, 2025 at 10:12:52AM +0100, Linus Walleij wrote: > On Mon, Feb 3, 2025 at 1:18 PM Andy Shevchenko > wrote: > > > Make use of BIT() and GENMASK() where it makes sense. > > > > Signed-off-by: Andy Shevchenko > > Reviewed-by: Linus Walleij Thanks, there is a v2 available. -- With

Re: [PATCH v2 1/2] slab: Adjust placement of __kvmalloc_node_noprof

2025-02-10 Thread Vlastimil Babka
On 2/8/25 02:47, GONG Ruiqi wrote: > Move __kvmalloc_node_noprof (and also kvfree* for consistency) into > mm/slub.c so that it can directly invoke __do_kmalloc_node, which is > needed for the next patch. Move kmalloc_gfp_adjust to slab.h since now > its two callers are in different .c files. > >

Re: [PATCH v2 2/2] slab: Achieve better kmalloc caches randomization in kvmalloc

2025-02-10 Thread Vlastimil Babka
On 2/8/25 02:47, GONG Ruiqi wrote: > As revealed by this writeup[1], due to the fact that __kmalloc_node (now > renamed to __kmalloc_node_noprof) is an exported symbol and will never > get inlined, using it in kvmalloc_node (now is __kvmalloc_node_noprof) > would make the RET_IP inside always point

Re: [RFC PATCH v3 00/15] pkeys-based page table hardening

2025-02-10 Thread Kevin Brodsky
On 06/02/2025 23:41, Kees Cook wrote: > On Mon, Feb 03, 2025 at 10:18:24AM +, Kevin Brodsky wrote: >> This is a proposal to leverage protection keys (pkeys) to harden >> critical kernel data, by making it mostly read-only. The series includes >> a simple framework called "kpkeys" to manipulate

Re: [PATCH] ixgbe: remove self assignment

2025-02-10 Thread Andrew Lunn
On Sun, Feb 09, 2025 at 11:47:24PM -0500, Ethan Carter Edwards wrote: > Variable self assignment does not have any effect. Hi Ethan As a general rule, it would be good to explain in the comment message what research you did to find out why there is a self assignment, and why just deleting it is t

Re: [PATCH v4 22/30] context_tracking: Exit CT_STATE_IDLE upon irq/nmi entry

2025-02-10 Thread Valentin Schneider
On 07/02/25 19:37, Frederic Weisbecker wrote: > Le Fri, Feb 07, 2025 at 06:06:45PM +0100, Valentin Schneider a écrit : >> >> S I've been thinking... >> >> Isn't >> >> (context_tracking.state & CT_RCU_WATCHING) >> >> pretty much a proxy for knowing whether a CPU is executing in kernelspace, >>

[PATCH] net/mlx4_core: Avoid impossible mlx4_db_alloc() order value

2025-02-10 Thread Kees Cook
GCC can see that the value range for "order" is capped, but this leads it to consider that it might be negative, leading to a false positive warning (with GCC 15 with -Warray-bounds -fdiagnostics-details): ../drivers/net/ethernet/mellanox/mlx4/alloc.c:691:47: error: array subscript -1 is below ar

Re: [PATCH 06/10] x86/tdx: Mark message.str as nonstring

2025-02-10 Thread Kirill A. Shutemov
On Thu, Feb 06, 2025 at 06:37:27PM -0800, Kees Cook wrote: > On Thu, Feb 06, 2025 at 05:12:11PM -0800, Dave Hansen wrote: > > On 2/6/25 17:00, Kees Cook wrote: > > > +++ b/arch/x86/coco/tdx/tdx.c > > > @@ -170,7 +170,7 @@ static void __noreturn tdx_panic(const char *msg) > > > /* Define r

Re: [PATCH v4 29/30] x86/mm, mm/vmalloc: Defer flush_tlb_kernel_range() targeting NOHZ_FULL CPUs

2025-02-10 Thread Valentin Schneider
On 17/01/25 16:52, Jann Horn wrote: > On Fri, Jan 17, 2025 at 4:25 PM Valentin Schneider > wrote: >> On 14/01/25 19:16, Jann Horn wrote: >> > On Tue, Jan 14, 2025 at 6:51 PM Valentin Schneider >> > wrote: >> >> vunmap()'s issued from housekeeping CPUs are a relatively common source of >> >> int

Re: [RFC PATCH v1 1/1] selftest/mm: refactor mseal_test

2025-02-10 Thread Jeff Xu
Hi Lorenzo, Gentle ping for my clarification questions. I also tried the new ioctl PROCMAP_QUERY, please see below for details. On Wed, Jan 15, 2025 at 12:47 PM Jeff Xu wrote: > > Hi Lorenzo, > > On Thu, Jan 2, 2025 at 9:30 AM Lorenzo Stoakes > wrote: > > > > Sorry for delay, was super busy le

Re: [PATCH] wifi: ath12k: Fix uninitialized variable and remove goto

2025-02-10 Thread Ethan Carter Edwards
On 25/02/10 05:08PM, Jeff Johnson wrote: > On 2/9/2025 8:36 PM, Ethan Carter Edwards wrote: > > commit subject should be as specific as possible. > suggest you at least mention the function Will change. Thanks! > > > There is a possibility for an uninitialized *ret* variable to be > > returned i

[PATCH v2] wifi: ath12k: cleanup ath12k_mac_mlo_ready()

2025-02-10 Thread Ethan Carter Edwards
There is a possibility for an uninitialized *ret* variable to be returned in some code paths. This explicitly returns 0 without an error. Also removes goto that returned *ret* and simply returns in place. Closes: https://scan5.scan.coverity.com/#/project-view/63541/10063?selectedIssue=1642337 Fi

Re: [PATCH] net/mlx4_core: Avoid impossible mlx4_db_alloc() order value

2025-02-10 Thread Justin Stitt
On Mon, Feb 10, 2025 at 09:45:05AM -0800, Kees Cook wrote: > GCC can see that the value range for "order" is capped, but this leads > it to consider that it might be negative, leading to a false positive > warning (with GCC 15 with -Warray-bounds -fdiagnostics-details): > > ../drivers/net/ethernet

Re: [RESEND PATCH][next] fs: nfs: acl: Avoid -Wflex-array-member-not-at-end warning

2025-02-10 Thread Chuck Lever
On 2/3/25 10:03 PM, Gustavo A. R. Silva wrote: > -Wflex-array-member-not-at-end was introduced in GCC-14, and we are > getting ready to enable it, globally. > > So, in order to avoid ending up with a flexible-array member in the > middle of other structs, we use the `struct_group_tagged()` helper

Re: [PATCH v3 0/4] Allow default HARDENED_USERCOPY to be set at compile time

2025-02-10 Thread Kees Cook
On Thu, 23 Jan 2025 22:11:11 +, Mel Gorman wrote: > Changelog since v2 > o Default on > o Logic correction and simplification > > Changelog since v1 > o Menu section rename > o Make static branch usage similar to init_on_alloc > o Change ordering of menu options > > [...] Applied to for-next

[PATCH] octeontx2-af: Fix uninitialized scalar variable

2025-02-10 Thread Ethan Carter Edwards
n"); - max_mtu = 1500; } return max_mtu; } --- base-commit: febbc555cf0fff895546ddb8ba2c9a523692fb55 change-id: 20250210-otx2_common-453132aa0a24 Best regards, -- Ethan Carter Edwards

Re: [PATCH v2 0/6] KUnit test moves / renames

2025-02-10 Thread Kees Cook
On Mon, Feb 10, 2025 at 05:11:24PM -0800, Andrew Morton wrote: > On Mon, 10 Feb 2025 16:31:28 -0800 Kees Cook wrote: > > > This is rebased to v6.14-rc2. I'll carry it and folks can send me new > > tests, etc, as needed to minimize future collisions. > > Actually seems designed to maximize collis

[PATCH v2 1/6] lib: math: Move KUnit tests into tests/ subdir

2025-02-10 Thread Kees Cook
From: Luis Felipe Hernandez This patch is a follow-up task from a discussion stemming from point 3 in a recent patch introducing the int_pow kunit test [1] and documentation regarding kunit test style and nomenclature [2]. Colocate all kunit test suites in lib/math/tests/ and follow recommended

[PATCH v2 3/6] lib: Move KUnit tests into tests/ subdirectory

2025-02-10 Thread Kees Cook
Following from the recent KUnit file naming discussion[1], move all KUnit tests in lib/ into lib/tests/. Link: https://lore.kernel.org/lkml/20240720165441.it.320-k...@kernel.org/ [1] Acked-by: Steven Rostedt (Google) Acked-by: Jakub Kicinski Acked-by: Masami Hiramatsu (Google) Reviewed-by: Davi

[PATCH v2 0/6] KUnit test moves / renames

2025-02-10 Thread Kees Cook
Hi, This is rebased to v6.14-rc2. I'll carry it and folks can send me new tests, etc, as needed to minimize future collisions. v1: https://lore.kernel.org/lkml/20241011072509.3068328-2-david...@google.com/ Thanks! -Kees Bruno Sobreira França (1): lib/math: Add int_log test suite Diego Viei

[PATCH v2 4/6] lib/tests/kfifo_kunit.c: add tests for the kfifo structure

2025-02-10 Thread Kees Cook
From: Diego Vieira Add KUnit tests for the kfifo data structure. They test the vast majority of macros defined in the kfifo header (include/linux/kfifo.h). These are inspired by the existing tests for the doubly linked list in lib/tests/list-test.c (previously at lib/list-test.c) [1]. Note that

[PATCH v2 5/6] unicode: kunit: refactor selftest to kunit tests

2025-02-10 Thread Kees Cook
From: Gabriela Bittencourt Refactoring 'test' functions into kunit tests, to test utf-8 support in unicode subsystem. This allows the utf8 tests to be run alongside the KUnit test suite using kunit-tool, quickly compiling and running all desired tests as part of the KUnit test suite, instead of

[PATCH v2 6/6] unicode: kunit: change tests filename and path

2025-02-10 Thread Kees Cook
From: Gabriela Bittencourt Change utf8 kunit test filename and path to follow the style convention on Documentation/dev-tools/kunit/style.rst Co-developed-by: Pedro Orlando Signed-off-by: Pedro Orlando Co-developed-by: Danilo Pereira Signed-off-by: Danilo Pereira Signed-off-by: Gabriela Bitt

[PATCH v2 2/6] lib/math: Add int_log test suite

2025-02-10 Thread Kees Cook
From: Bruno Sobreira França This commit introduces KUnit tests for the intlog2 and intlog10 functions, which compute logarithms in base 2 and base 10, respectively. The tests cover a range of inputs to ensure the correctness of these functions across common and edge cases. Signed-off-by: Bruno S

Re: [PATCH v4 29/30] x86/mm, mm/vmalloc: Defer flush_tlb_kernel_range() targeting NOHZ_FULL CPUs

2025-02-10 Thread Jann Horn
On Mon, Feb 10, 2025 at 7:36 PM Valentin Schneider wrote: > What if isolated CPUs unconditionally did a TLBi as late as possible in > the stack right before returning to userspace? This would mean that upon > re-entering the kernel, an isolated CPU's TLB wouldn't contain any kernel > range transla

RE: [PATCH] wifi: ath12k: Fix uninitialized variable and remove goto

2025-02-10 Thread Ping-Ke Shih
> > > > > > Addresses-Coverity-ID: 1642337 ("Uninitialized scalar variable") > > > > Is that an official kernel tag? IMO the proper tag would be > So, it isn't "official" as far as I can tell, but it is widely used in > other commits, especially by Gustavo Silva. > > Also: > https://git.kernel.org

Re: [PATCH v3][next] tty: tty_buffer: Avoid hundreds of -Wflex-array-member-not-at-end warnings

2025-02-10 Thread Gustavo A. R. Silva
@@ -576,11 +579,14 @@ int tty_insert_flip_string_and_push_buffer(struct tty_port *port,   void tty_buffer_init(struct tty_port *port)   {   struct tty_bufhead *buf = &port->buf; +    struct tty_buffer *buf_sentinel; + +    buf_sentinel = container_of(&buf->sentinel, struct tty_buffer,

Re: [PATCH v2 0/6] KUnit test moves / renames

2025-02-10 Thread David Gow
On Tue, 11 Feb 2025 at 08:31, Kees Cook wrote: > > Hi, > > This is rebased to v6.14-rc2. I'll carry it and folks can send me new > tests, etc, as needed to minimize future collisions. > > v1: > https://lore.kernel.org/lkml/20241011072509.3068328-2-david...@google.com/ > > Thanks! > > -Kees Than

Re: [PATCH] octeontx2-af: Fix uninitialized scalar variable

2025-02-10 Thread Michal Swiatkowski
t; mutex_lock(&pfvf->mbox.lock); > @@ -1948,7 +1948,6 @@ u16 otx2_get_max_mtu(struct otx2_nic *pfvf) > if (rc) { > dev_warn(pfvf->dev, >"Failed to get MTU from hardware setting default > value(1500)\n"); > -

[PATCH] ASoC: Intel: sof_sdw: initialize ret in asoc_sdw_rt_amp_spk_rtd_init()

2025-02-10 Thread Ethan Carter Edwards
ommit: febbc555cf0fff895546ddb8ba2c9a523692fb55 change-id: 20250210-soc_sdw_rt_amp-e9c703ebe4dc Best regards, -- Ethan Carter Edwards

Re: [PATCH] wifi: ath12k: Fix uninitialized variable and remove goto

2025-02-10 Thread Jeff Johnson
On 2/9/2025 8:36 PM, Ethan Carter Edwards wrote: commit subject should be as specific as possible. suggest you at least mention the function > There is a possibility for an uninitialized *ret* variable to be > returned in some code paths. > > This moves *ret* inside the conditional and explicitl

Re: [PATCH v2 0/6] KUnit test moves / renames

2025-02-10 Thread Andrew Morton
On Mon, 10 Feb 2025 16:31:28 -0800 Kees Cook wrote: > This is rebased to v6.14-rc2. I'll carry it and folks can send me new > tests, etc, as needed to minimize future collisions. Actually seems designed to maximize collisions. I'll drop ("lib/math: add Kunit test suite for gcd()") https://lore.