Re: [PATCH v4] checkpatch: add check for snprintf to scnprintf

2024-04-11 Thread Justin Stitt
On Thu, Apr 11, 2024 at 1:56 PM Joe Perches wrote: > It could. > > # {v}snprintf uses that should likely be {v}scnprintf > if ($line =~ /\b((v?)snprintf)\s*\(/) { > WARN("SNPRINTF", > "Prefer ${2}scnprintf over $1 - see: >

Re: [PATCH v4] checkpatch: add check for snprintf to scnprintf

2024-04-11 Thread Christophe JAILLET
Le 08/04/2024 à 22:53, Justin Stitt a écrit : I am going to quote Lee Jones who has been doing some snprintf -> scnprintf refactorings: "There is a general misunderstanding amongst engineers that {v}snprintf() returns the length of the data *actually* encoded into the destination array.

Re: [PATCH v4] checkpatch: add check for snprintf to scnprintf

2024-04-11 Thread Joe Perches
On Thu, 2024-04-11 at 22:01 +0200, Christophe JAILLET wrote: > Le 08/04/2024 à 22:53, Justin Stitt a écrit : > > I am going to quote Lee Jones who has been doing some snprintf -> > > scnprintf refactorings: > > > > "There is a general misunderstanding amongst engineers that > > {v}snprintf()

Re: [POC][RFC][PATCH 0/2] pstore/mm/x86: Add wildcard memmap to map pstore consistently

2024-04-11 Thread Steven Rostedt
On Thu, 11 Apr 2024 16:11:55 -0300 "Guilherme G. Piccoli" wrote: > Thanks Steve! Like Kees, I've been wanting a consistent way of mapping > some RAM for pstore for a while, without resorting to platform drivers > like Chromebooks do... Great! > > The idea seems very interesting and helpful,

Re: [POC][RFC][PATCH 0/2] pstore/mm/x86: Add wildcard memmap to map pstore consistently

2024-04-11 Thread Guilherme G. Piccoli
On 09/04/2024 19:25, Luck, Tony wrote: >>> I forgot to mention that this makes it trivial for any machine that doesn't >>> clear memory on soft-reboot, to enable console ramoops (to have access to >>> the last boot dmesg without needing serial). >>> >>> I tested this on a couple of my test boxes

[PATCH 2/2] configs/hardening: Disable CONFIG_UBSAN_SIGNED_WRAP

2024-04-11 Thread Nathan Chancellor
kernel/configs/hardening.config turns on UBSAN for the bounds sanitizer, as that in combination with trapping can stop the exploitation of buffer overflows within the kernel. At the same time, hardening.config turns off every other UBSAN sanitizer because trapping means all UBSAN reports will be

[PATCH 1/2] configs/hardening: Fix disabling UBSAN configurations

2024-04-11 Thread Nathan Chancellor
The initial change that added kernel/configs/hardening.config attempted to disable all UBSAN sanitizers except for the array bounds one while turning on UBSAN_TRAP. Unfortunately, it only got the syntax for CONFIG_UBSAN_SHIFT correct, so configurations that are on by default with CONFIG_UBSAN=y

[PATCH 0/2] configs/hardening: Some fixes for UBSAN

2024-04-11 Thread Nathan Chancellor
Hi all, This series was spurred by a couple of recent UBSAN reports in our continuous integration that appear to be related to CONFIG_UBSAN_SIGNED_WRAP (which gets enabled with hardening.config due to 'default UBSAN'), as they only appear with clang-19 and newer:

[PATCH][next] smb: smb2pdu.h: Avoid -Wflex-array-member-not-at-end warnings

2024-04-11 Thread Gustavo A. R. Silva
-Wflex-array-member-not-at-end is coming 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 multiple other structs, we use the `__struct_group()` helper to separate the flexible array from the rest of the

Re: [PATCH] xfs: replace deprecated strncpy with strscpy_pad

2024-04-11 Thread Kees Cook
On Wed, Apr 10, 2024 at 01:45:21PM -0700, Justin Stitt wrote: > On Tue, Apr 9, 2024 at 9:22 AM Kees Cook wrote: > > > > > > - /* 1 larger than sb_fname, so this ensures a trailing NUL char */ > > > - memset(label, 0, sizeof(label)); > > > spin_lock(>m_sb_lock); > > > -

Re: [PATCH v3 0/3] RDMA/mana_ib: Add flex array to struct mana_cfg_rx_steer_req_v2

2024-04-11 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Leon Romanovsky : On Sat, 6 Apr 2024 16:23:34 +0200 you wrote: > The "struct mana_cfg_rx_steer_req_v2" uses a dynamically sized set of > trailing elements. Specifically, it uses a "mana_handle_t" array. So, > use the preferred way

Re: [PATCH v3 0/3] RDMA/mana_ib: Add flex array to struct mana_cfg_rx_steer_req_v2

2024-04-11 Thread Jakub Kicinski
On Thu, 11 Apr 2024 13:58:39 +0300 Leon Romanovsky wrote: > I prepared mana-ib-flex branch > https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/log/?h=mana-ib-flex > and merge ti to our wip branch >

Re: [PATCH v2 2/3] leds: sy7802: Add support for Silergy SY7802 flash LED controller

2024-04-11 Thread Lee Jones
On Mon, 01 Apr 2024, André Apitzsch via B4 Relay wrote: > From: André Apitzsch > > Add support for SY7802 flash LED controller. It can support up to 1.8A > flash current. This is a very small commit message for a 500+ line change! Please, tell us more. > Signed-off-by: André Apitzsch > ---

Re: [PATCH v3 0/3] RDMA/mana_ib: Add flex array to struct mana_cfg_rx_steer_req_v2

2024-04-11 Thread Leon Romanovsky
On Tue, Apr 09, 2024 at 02:44:19PM -0700, Jakub Kicinski wrote: > On Tue, 9 Apr 2024 18:01:40 +0100 Edward Cree wrote: > > > Shared branch would be good. Ed has some outstanding patches > > > to refactor the ethtool RSS API. > > > > For the record I am extremely unlikely to have time to get

Re: [PATCH v4] checkpatch: add check for snprintf to scnprintf

2024-04-11 Thread Lee Jones
On Mon, 08 Apr 2024, Justin Stitt wrote: > I am going to quote Lee Jones who has been doing some snprintf -> > scnprintf refactorings: > > "There is a general misunderstanding amongst engineers that > {v}snprintf() returns the length of the data *actually* encoded into the > destination array.