Re: [PATCH 13/14] net: tulip: Annotate struct mediatable with __counted_by

2023-09-24 Thread Gustavo A. R. Silva
On 9/22/23 11:28, 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_FORTIF

Re: [PATCH] watch_queue: Annotate struct watch_filter with __counted_by

2023-09-24 Thread Christian Brauner
On Fri, 22 Sep 2023 10:54:08 -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 indexi

Re: [PATCH] platform/surface: aggregator: Annotate struct ssam_event with __counted_by

2023-09-24 Thread Maximilian Luz
On 9/22/23 19:54, 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_S

Re: [PATCH] memory: atmel-ebi: Annotate struct atmel_ebi_dev with __counted_by

2023-09-24 Thread Krzysztof Kozlowski
On Fri, 22 Sep 2023 10:52:15 -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 inde

Re: [PATCH] firewire: Annotate struct fw_node with __counted_by

2023-09-24 Thread Takashi Sakamoto
Hi, On Fri, Sep 22, 2023 at 10:53:35AM -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 a

Re: [GIT PULL] hardening fixes for v6.6-rc3

2023-09-24 Thread Alexey Dobriyan
On Sat, Sep 23, 2023 at 11:04:57AM -0700, Linus Torvalds wrote: > On Fri, 22 Sept 2023 at 20:49, Kees Cook wrote: > > > > 2) __cplusplus is relatively common in UAPI headers already: > >$ git grep __cplusplus -- include/uapi | wc -l > >58 > > Look a bit closer. > > Most of those - by far

Re: [PATCH] scsi: target: tcmu: Annotate struct tcmu_tmr with __counted_by

2023-09-24 Thread Bodo Stroesser
On 22.09.23 19:53, 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_

Re: [GIT PULL] hardening fixes for v6.6-rc3

2023-09-24 Thread Linus Torvalds
On Sun, 24 Sept 2023 at 09:58, Alexey Dobriyan wrote: > > Most of those in uapi/ are likely unnecessary: extern "C" means > "don't mangle", but kernel doesn't export functions to userspace > except vDSO so there is nothing to mangle in the first place. I suspect a lot of it is "this got copied-an

Re: [PATCH] i2c: mux: demux-pinctrl: Annotate struct i2c_demux_pinctrl_priv with __counted_by

2023-09-24 Thread Wolfram Sang
On Fri, Sep 22, 2023 at 10:49:59AM -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] media: i2c: Annotate struct i2c_atr with __counted_by

2023-09-24 Thread Wolfram Sang
On Fri, Sep 22, 2023 at 10:54:25AM -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] ocfs2: Annotate struct ocfs2_replay_map with __counted_by

2023-09-24 Thread Joseph Qi
On 9/23/23 1:49 AM, 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 CONFI

Re: [PATCH] platform/chrome: wilco_ec: Annotate struct ec_event_queue with __counted_by

2023-09-24 Thread patchwork-bot+chrome-platform
Hello: This patch was applied to chrome-platform/linux.git (for-kernelci) by Tzung-Bi Shih : On Fri, 22 Sep 2023 10:51:47 -0700 you 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

[PATCH v4] hwmon: (acpi_power_meter) replace open-coded kmemdup_nul

2023-09-24 Thread Justin Stitt
`strncpy` is deprecated for use on NUL-terminated destination strings [1]. Let's refactor this kcalloc() + strncpy() into a kmemdup_nul() which has more obvious behavior and is less error prone. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-string

[PATCH v2] Input: axp20x-pek - avoid needless newline removal

2023-09-24 Thread Justin Stitt
This code is doing more work than it needs to. Before handing off `val_str` to `kstrtouint()` we are eagerly removing any trailing newline which requires copying `buf`, validating it's length and checking/replacing any potential newlines. kstrtouint() handles this implicitly: kstrtouint -> kstr

Re: [PATCH] gpiolib: cdev: Annotate struct linereq with __counted_by

2023-09-24 Thread Andy Shevchenko
On Fri, Sep 22, 2023 at 10:52:03AM -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