Re: [PATCH v2] module: Clarify documentation of module_param_call()

2023-09-20 Thread Luis Chamberlain
On Wed, Sep 13, 2023 at 04:54:14PM -0700, Kees Cook wrote: > Commit 9bbb9e5a3310 ("param: use ops in struct kernel_param, rather than > get and set fns directly") added the comment that module_param_call() > was deprecated, during a large scale refactoring to bring sanity to type > casting back

[PATCH] sky2: Make sure there is at least one frag_addr available

2023-09-20 Thread Kees Cook
In the likely pathological case of building sky2 with 16k PAGE_SIZE, make sure there is at least 1 frag_addr in struct rx_ring_info: In file included from include/linux/skbuff.h:28, from include/net/net_namespace.h:43, from include/linux/netdevice.h:38,

Re: include/linux/dma-mapping.h:416:36: warning: array subscript i is outside array bounds of 'dma_addr_t[0]' {aka 'long long unsigned int[]'}

2023-09-20 Thread Kees Cook
On Wed, Sep 20, 2023 at 10:29:34AM -0700, Stephen Hemminger wrote: > On Wed, 20 Sep 2023 09:09:33 -0700 > Kees Cook wrote: > > > On Tue, Sep 19, 2023 at 07:27:26PM +0800, kernel test robot wrote: > > > tree: > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > > >

Re: This list is being migrated to the new infrastructure

2023-09-20 Thread Kees Cook
On September 20, 2023 10:17:50 AM PDT, Konstantin Ryabitsev wrote: >On Wed, Sep 20, 2023 at 12:57:53PM -0400, Konstantin Ryabitsev wrote: >> Hello, all: >> >> This list is being migrated to the new vger infrastructure. This should be a >> fully transparent process and you don't need to change

Re: include/linux/dma-mapping.h:416:36: warning: array subscript i is outside array bounds of 'dma_addr_t[0]' {aka 'long long unsigned int[]'}

2023-09-20 Thread Stephen Hemminger
On Wed, 20 Sep 2023 09:09:33 -0700 Kees Cook wrote: > On Tue, Sep 19, 2023 at 07:27:26PM +0800, kernel test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > > master > > head: 2cf0f715623872823a72e451243bbf555d10d032 > > commit:

Re: This list is being migrated to the new infrastructure

2023-09-20 Thread Konstantin Ryabitsev
On Wed, Sep 20, 2023 at 12:57:53PM -0400, Konstantin Ryabitsev wrote: > Hello, all: > > This list is being migrated to the new vger infrastructure. This should be a > fully transparent process and you don't need to change anything about how you > participate with the list or how you receive mail.

Re: include/linux/dma-mapping.h:416:36: warning: array subscript i is outside array bounds of 'dma_addr_t[0]' {aka 'long long unsigned int[]'}

2023-09-20 Thread Kees Cook
On Tue, Sep 19, 2023 at 07:27:26PM +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > master > head: 2cf0f715623872823a72e451243bbf555d10d032 > commit: df8fc4e934c12b906d08050d7779f292b9c5c6b5 kbuild: Enable > -fstrict-flex-arrays=3 >

Re: [PATCH v2] hwmon: refactor deprecated strncpy

2023-09-20 Thread Kees Cook
On Tue, Sep 19, 2023 at 09:02:49AM +0200, Thomas Weißschuh wrote: > On 2023-09-19 05:07:55+, Justin Stitt wrote: > > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > > > A trailing zero is already handled by the kcalloc > > | *str =

Re: [PATCH] i2c: cp2615: replace deprecated strncpy with strscpy

2023-09-20 Thread Kees Cook
On Wed, Sep 20, 2023 at 08:08:52AM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We should prefer more robust and less ambiguous string interfaces. > > We expect name to be NUL-terminated based on its numerous uses with > functions

Re: linux-next: Tree for Sep 12 (bcachefs)

2023-09-20 Thread Kees Cook
On Tue, Sep 19, 2023 at 05:23:18PM -0400, Kent Overstreet wrote: > On Thu, Sep 14, 2023 at 05:20:41PM -0700, Kees Cook wrote: > > Because they're ambiguous and then the compiler can't do appropriate > > bounds checking, compile-time diagnostics, etc. Maybe it's actually zero > > sized, maybe it's

Re: [PATCH v2] vt: Replace strlcpy with strscpy

2023-09-20 Thread Kees Cook
On Tue, Sep 19, 2023 at 07:21:56PM +, Azeem Shaikh wrote: > strlcpy() reads the entire source buffer first and returns the size of > the source string, not the destination string, which can be accidentally > misused [1]. > > The copy_to_user() call uses @len returned from strlcpy() directly >

Re: [PATCH] i2c: replace deprecated strncpy

2023-09-20 Thread Kees Cook
On Wed, Sep 20, 2023 at 11:07:35AM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We should prefer more robust and less ambiguous string interfaces. > > `info.type` is expected to be NUL-terminated judging by its use in >

Re: (subset) [PATCH] leds: mt6370: Annotate struct mt6370_priv with __counted_by

2023-09-20 Thread Lee Jones
On Fri, 15 Sep 2023 13:10:52 -0700, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array

Re: (subset) [PATCH] leds: mt6360: Annotate struct mt6360_priv with __counted_by

2023-09-20 Thread Lee Jones
On Fri, 15 Sep 2023 13:10:20 -0700, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array

Re: (subset) [PATCH] leds: qcom-lpg: Annotate struct lpg_led with __counted_by

2023-09-20 Thread Lee Jones
On Fri, 15 Sep 2023 13:11:00 -0700, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array

Re: (subset) [PATCH] leds: lm3697: Annotate struct lm3697 with __counted_by

2023-09-20 Thread Lee Jones
On Fri, 15 Sep 2023 13:10:10 -0700, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array

Re: (subset) [PATCH] leds: gpio: Annotate struct gpio_leds_priv with __counted_by

2023-09-20 Thread Lee Jones
On Fri, 15 Sep 2023 13:10:04 -0700, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array

Re: (subset) [PATCH] leds: el15203000: Annotate struct el15203000 with __counted_by

2023-09-20 Thread Lee Jones
On Fri, 15 Sep 2023 13:09:56 -0700, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array

Re: (subset) [PATCH] leds: cr0014114: Annotate struct cr0014114 with __counted_by

2023-09-20 Thread Lee Jones
On Fri, 15 Sep 2023 13:09:48 -0700, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array

Re: (subset) [PATCH] leds: aw200xx: Annotate struct aw200xx with __counted_by

2023-09-20 Thread Lee Jones
On Fri, 15 Sep 2023 13:09:39 -0700, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array

Re: [PATCH] firmware: ti_sci: refactor deprecated strncpy

2023-09-20 Thread Nishanth Menon
Hi Justin Stitt, On Wed, 13 Sep 2023 20:23:02 +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We should prefer more robust and less ambiguous string interfaces. > > A suitable replacement is `strscpy` [2] due to the fact that it

Re: [PATCH] wifi: brcmfmac: firmware: Annotate struct brcmf_fw_request with __counted_by

2023-09-20 Thread Kalle Valo
Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array indexing) and CONFIG_FORTIFY_SOURCE

Re: [PATCH] wifi: brcmfmac: Annotate struct brcmf_gscan_config with __counted_by

2023-09-20 Thread Kalle Valo
Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array indexing) and CONFIG_FORTIFY_SOURCE

[PATCH] i2c: replace deprecated strncpy

2023-09-20 Thread Justin Stitt
of(info.type)); info.addr = addr; newdev = i2c_new_client_device(adap, ); if (IS_ERR(newdev)) --- base-commit: 2cf0f715623872823a72e451243bbf555d10d032 change-id: 20230920-strncpy-drivers-i2c-busses-i2c-powermac-c-a95017b69711 Best regards, -- Justin Stitt

[PATCH] i2c: cp2615: replace deprecated strncpy with strscpy

2023-09-20 Thread Justin Stitt
;name) - 1); + strscpy(adap->name, usbdev->serial, sizeof(adap->name)); adap->owner = THIS_MODULE; adap->dev.parent = >dev; adap->dev.of_node = usbif->dev.of_node; --- base-commit: 2cf0f715623872823a72e451243bbf555d10d032 change-id: 20230920-

Re: [PATCH] wifi: brcmfmac: firmware: Annotate struct brcmf_fw_request with __counted_by

2023-09-20 Thread Matthias Brugger
On 15/09/2023 22:05, Kees Cook wrote: Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and