On 10. Jun 2025, at 12:40, Thorsten Blum wrote:
> Convert mux_control_ops to a flexible array member at the end of the
> mux_chip struct and add the __counted_by() compiler attribute to
> improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
> CONFIG_FORTIFY_SOURCE.
>
> Us
and to remove the following Coccinelle/coccicheck warning:
WARNING: Use struct_size
Use size_add() to safely add any extra bytes.
No functional changes intended.
Link: https://github.com/KSPP/linux/issues/83
Signed-off-by: Thorsten Blum
---
drivers/mux/core.c | 7 +++
include
strcpy() is deprecated; use strscpy() instead.
No functional changes intended.
Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum
---
arch/sparc/kernel/pcic.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/sparc/kernel/pcic.c b/arch
/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/83
Signed-off-by: Thorsten Blum
---
arch/powerpc/include/asm/rtas-types.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/rtas-types.h
b/arch/powerpc/include/asm/rtas-types.h
index
strscpy() and the same buffer
into a single statement to simplify the code.
No functional changes intended.
Link: https://github.com/KSPP/linux/issues/88
Cc: linux-hardening@vger.kernel.org
Reviewed-by: Kees Cook
Signed-off-by: Thorsten Blum
---
arch/nios2/kernel/cpuinfo.c | 5 +
1 file
Add the __counted_by() compiler attribute to the flexible array member
'__lowerstack' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS
and CONFIG_FORTIFY_SOURCE.
Signed-off-by: Thorsten Blum
---
fs/overlayfs/ovl_entry.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Peter?
On 13. Apr 2025, at 14:42, Thorsten Blum wrote:
> On 7. Apr 2025, at 20:20, Kees Cook wrote:
>> On Fri, Mar 07, 2025 at 12:32:07PM +0100, Thorsten Blum wrote:
>>> On 3. Mar 2025, at 19:44, Kees Cook wrote:
>>>> On Mon, Mar 03, 2025 at 12:02:22AM +0100, Thor
strcpy() is deprecated; use strscpy() instead.
In cyrix.c, use 'c->x86_model_id' directly and remove the local variable
'buf' to retain the array size of the destination buffer.
No functional changes intended.
Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: T
strcpy() is deprecated; use strscpy() instead.
Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum
---
arch/mips/kernel/vpe.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 737d0d4fdcd3
On 22. Apr 2025, at 12:17, Andy Shevchenko wrote:
> On Tue, Apr 22, 2025 at 10:27:33AM +0200, Thorsten Blum wrote:
>> On 22. Apr 2025, at 10:03, Andy Shevchenko wrote:
>>> Can you use --cc OR put this line...
>>
>> Yes, will do next time.
>>
>>> Have
Hi Andy,
On 22. Apr 2025, at 10:03, Andy Shevchenko wrote:
> Can you use --cc OR put this line...
Yes, will do next time.
> Have you compiled this with `make W=1` with recent GCCs?
Yes, I compile-tested it with W=1 and mips64-linux-gnu-gcc 14.2.1.
Thanks,
Thorsten
strcpy() is deprecated; use strscpy() instead.
Link: https://github.com/KSPP/linux/issues/88
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
arch/mips/bcm63xx/boards/board_bcm963xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/bcm63xx
.kernel.org
Signed-off-by: Thorsten Blum
---
arch/powerpc/kernel/proc_powerpc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/proc_powerpc.c
b/arch/powerpc/kernel/proc_powerpc.c
index 3816a2bf2b84..d083b4517065 100644
--- a/arch/powerpc/kernel/proc_pow
strcpy() is deprecated; use strscpy() instead.
Link: https://github.com/KSPP/linux/issues/88
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
arch/m68k/kernel/setup_mm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/m68k/kernel/setup_mm.c b/arch
strcpy() is deprecated; use strscpy() instead.
No functional changes intended.
Link: https://github.com/KSPP/linux/issues/88
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
arch/sparc/kernel/pcic.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a
strscpy() and the same buffer
into a single statement to simplify the code.
No functional changes intended.
Link: https://github.com/KSPP/linux/issues/88
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
arch/nios2/kernel/cpuinfo.c | 5 +
1 file changed, 1 insertion(+), 4
On 15. Apr 2025, at 12:56, Mark Brown wrote:
> On Tue, Apr 15, 2025 at 11:03:55AM +0200, Thorsten Blum wrote:
>> Add the __counted_by() compiler attribute to the flexible array member
>> 'data' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
>>
Add the __counted_by() compiler attribute to the flexible array member
'data' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
No functional changes intended.
Signed-off-by: Thorsten Blum
---
include/sound/cs-amp-lib.h | 2 +-
1 file changed, 1
Hi Peter,
On 7. Apr 2025, at 20:20, Kees Cook wrote:
> On Fri, Mar 07, 2025 at 12:32:07PM +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 fl
On 7. Apr 2025, at 20:28, Kees Cook wrote:
> On Wed, Feb 26, 2025 at 07:55:26PM +0100, Thorsten Blum wrote:
>> strncpy() is deprecated for NUL-terminated destination buffers; use
>> strscpy() instead.
>>
>> Compile-tested only.
>>
>> Link: https://githu
().
No functional changes intended.
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Update patch description as suggested by Kees
- Link to v1:
https://lore.kernel.org/lkml/20250226185531.1092-2-thorsten.b
On 7. Apr 2025, at 22:30, Kees Cook wrote:
> On Mon, Apr 07, 2025 at 09:01:53PM +0200, Thorsten Blum wrote:
>> On 7. Apr 2025, at 20:28, Kees Cook wrote:
>>> On Wed, Feb 26, 2025 at 07:55:26PM +0100, Thorsten Blum wrote:
>>>> strncpy() is deprecated for NUL-termi
strcpy() is deprecated, use strscpy() instead.
Link: https://github.com/KSPP/linux/issues/88
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
sound/isa/azt2320.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/isa/azt2320.c b/sound/isa/azt2320.c
.
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
drivers/usb/gadget/legacy/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/legacy/inode.c
b/drivers/usb/gadget/legacy/inode.c
index
and to remove the following Coccinelle/coccicheck warning:
WARNING: Use struct_size
Use size_add() to safely add any extra bytes.
Compile-tested only.
Link: https://github.com/KSPP/linux/issues/83
Signed-off-by: Thorsten Blum
---
drivers/mux/core.c | 7 +++
include/linux/mux
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 the
>> mux_chip struct and add the __counted_by() compiler attribute to
>> improve acces
/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
kernel/module/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/module/main.c b/kernel/module/main.c
index 1fb9ad289a6f..2b88c91c89e3 100644
--- a/kernel/module/main.c
+++ b/kernel/mod
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,
>>>> no
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
compile-time checks (e.g., __must_be_array()).
No functional changes intended.
Signed-off-by: Thorsten Blum
---
arch/x86/events/intel/bts.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/events/intel/bts.c b/arch/x86/events/intel/bts.c
index 8f78b0c900ef
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
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
On 5. Mar 2025, at 03:21, Darrick J. Wong wrote:
> On Wed, Mar 05, 2025 at 02:10:21AM +0100, Thorsten Blum wrote:
>> strncpy() is deprecated for NUL-terminated destination buffers. Use
>> strscpy() instead and remove the manual NUL-termination.
>>
>> No functional ch
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 the
>> mux_chip struct and add the __counted_by() compiler attribute to
>> improve acces
and to remove the following Coccinelle/coccicheck warning:
WARNING: Use struct_size
Use size_add() to safely add any extra bytes.
Compile-tested only.
Link: https://github.com/KSPP/linux/issues/83
Signed-off-by: Thorsten Blum
---
drivers/mux/core.c | 7 +++
include/linux/mux
c: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Improve the commit message and replace another strncpy() as suggested
by Kees Cook
- Replace snprintf() with scnprintf()
- Link to v1:
https://lore.kernel.org/r/20250226121003.359876-1-thorsten.b...@linux.dev/
-
On 28. Feb 2025, at 21:10, Kees Cook wrote:
> On Wed, Feb 26, 2025 at 01:10:03PM +0100, Thorsten Blum wrote:
>> Since strncpy() is deprecated for NUL-terminated destination buffers,
>> use strscpy() instead.
>>
>> Compile-tested only.
>>
>> Link: https:
On 27. Feb 2025, at 23:37, Guenter Roeck wrote:
> On 2/27/25 09:39, Thorsten Blum wrote:
>> strncpy() is deprecated for NUL-terminated destination buffers; use
>> strscpy() instead.
>> Compile-tested only.
>> Link: https://github.com/KSPP/linux/issues/90
>> Cc
strncpy() is deprecated for NUL-terminated destination buffers; use
strscpy() instead.
Compile-tested only.
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
drivers/hwmon/pmbus/pmbus_core.c | 3 +--
1 file changed, 1 insertion
strncpy() is deprecated for NUL-terminated destination buffers; use
strscpy() instead.
Compile-tested only.
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
drivers/scsi/elx/libefc_sli/sli4.c | 6 +++---
1 file changed, 3
Since strncpy() is deprecated for NUL-terminated destination buffers,
use strscpy() instead.
Compile-tested only.
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
drivers/target/target_core_configfs.c | 2 +-
1 file changed, 1
Since kstrtol() requires a NUL-terminated string as input and strncpy()
is deprecated for NUL-terminated destination buffers, use strscpy()
instead.
Compile-tested only.
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
drivers
strncpy() is deprecated for NUL-terminated destination buffers. Use
strscpy() instead and remove the manual NUL-termination.
Compile-tested only.
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
arch/mips/loongson2ef/common
and to remove the following Coccinelle/coccicheck warning:
WARNING: Use struct_size
Use size_add() to safely add any extra bytes.
Compile-tested only.
Link: https://github.com/KSPP/linux/issues/83
Signed-off-by: Thorsten Blum
---
drivers/mux/core.c | 7 +++
include/linux/mux
On 20. Feb 2025, at 03:57, Kees Cook wrote:
> On Wed, Feb 19, 2025 at 11:47:31PM +0100, Thorsten Blum wrote:
>> strncpy() is deprecated for NUL-terminated destination buffers. Use
>> strscpy_pad() instead and remove the manual NUL-termination.
>
> When doing these conversions
strncpy() is deprecated for NUL-terminated destination buffers. Use
strscpy_pad() instead and remove the manual NUL-termination.
Compile-tested only.
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
net/rds/stats.c | 3 +--
1
Suggested-by: Bart Van Assche
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Adjust len to copy the same number of bytes as with strncpy()
- Link to v1:
https://lore.kernel.org/r/2025021214.86110-2-thorsten.b...@linux.dev/
Changes in v3:
- Remove strncpy() and tmpbuf et al and use buf
: Luis Chamberlain
Cc: Nathan Chancellor
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Use krealloc_array() as suggested by Andy Shevchenko
- Link to v1:
https://lore.kernel.org/r/20240823123300.37574-1-thorsten.b...@toblux.com/
Resending again after Luis mentioned that co-maintainers are r
Assche
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Adjust len to copy the same number of bytes as with strncpy()
- Link to v1:
https://lore.kernel.org/r/34bb4fde-062d-4c1b-b246-86cb55f63...@linux.dev/
---
drivers/scsi/hpsa.c | 10 --
1 file changed, 4 insertions(+), 6 deletions
On 13. Feb 2025, at 20:14, David Laight wrote:
> On Wed, 12 Feb 2025 23:43:53 +0100
> Thorsten Blum wrote:
>
>> strncpy() is deprecated for NUL-terminated destination buffers [1].
>>
>> Replace memset() and strncpy() with strscpy_pad() to copy the version
>> st
strncpy() is deprecated for NUL-terminated destination buffers. Use
strscpy() instead and remove the manual NUL-termination.
Compile-tested only.
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
arch/m68k/kernel/setup_mm.c | 3
: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Use len instead of len - 1
- Link to v1:
https://lore.kernel.org/r/20250212224352.86583-3-thorsten.b...@linux.dev/
---
drivers/scsi/hpsa.c | 3 +--
1 file changed, 1
On 12. Feb 2025, at 23:22, Thorsten Blum wrote:
> strncpy() is deprecated for NUL-terminated destination buffers [1]. Use
> strscpy() instead and remove the manual NUL-termination.
>
> Use min() to simplify the size calculation.
>
> Compile-tested only.
>
> Link:
>
.
Link:
https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
[1]
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
---
drivers/scsi/hpsa.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers
-strings
[1]
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum
Suggested-by: Bart Van Assche
---
drivers/scsi/hpsa.c | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 84d8de07b7ae..9399e101f150 100644
--- a
On 4. Feb 2025, at 17:44, Thorsten Blum wrote:
> On 14. Jan 2025, at 22:49, Thorsten Blum wrote:
>> Add the __counted_by compiler attribute to the flexible array member
>> attrs to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
>> CONFIG_FORTIFY_SOURCE.
>&g
On 14. Jan 2025, at 22:49, Thorsten Blum wrote:
> Add the __counted_by compiler attribute to the flexible array member
> attrs to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
> CONFIG_FORTIFY_SOURCE.
>
> Increment num before adding a new param_attribute to the
: Thorsten Blum
---
Changes in v2:
- Replace sizeof() with struct_size_t(,,1) to maintain the same size
after feedback from Roman Kisel (thanks!)
- Link to v1:
https://lore.kernel.org/r/20250116201635.47870-2-thorsten.b...@linux.dev/
---
drivers/net/hyperv/hyperv_net.h | 2 +-
drivers/net/hyperv
On 16. Jan 2025, at 21:45, Roman Kisel wrote:
> On 1/16/2025 12:16 PM, Thorsten Blum wrote:
>> Replace the deprecated one-element array with a modern flexible array
>> member in the struct nvsp_1_message_send_receive_buffer_complete.
>> Link: https://github.com/KSPP/linux/is
Replace the deprecated one-element array with a modern flexible array
member in the struct nvsp_1_message_send_receive_buffer_complete.
Link: https://github.com/KSPP/linux/issues/79
Signed-off-by: Thorsten Blum
---
drivers/net/hyperv/hyperv_net.h | 2 +-
1 file changed, 1 insertion(+), 1
Replace the deprecated one-element array with a modern flexible array
member in the struct ap_matrix_dev.
Use struct_size() to calculate the number of bytes to allocate for
matrix_dev with a single mdev_type.
Link: https://github.com/KSPP/linux/issues/79
Signed-off-by: Thorsten Blum
: Luis Chamberlain
Cc: Nathan Chancellor
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Use krealloc_array() as suggested by Andy Shevchenko
- Link to v1:
https://lore.kernel.org/r/20240823123300.37574-1-thorsten.b...@toblux.com/
---
kernel/params.c | 29 +
: Luis Chamberlain
Cc: Nathan Chancellor
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Use krealloc_array() as suggested by Andy Shevchenko
- Link to v1:
https://lore.kernel.org/r/20240823123300.37574-1-thorsten.b...@toblux.com/
---
kernel/params.c | 29 +
Remove hard-coded strings by using the str_enabled_disabled() helper
function.
Signed-off-by: Thorsten Blum
---
kernel/stackleak.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/stackleak.c b/kernel/stackleak.c
index 39fd620a7db6..0f4804f28c61 100644
--- a/kernel
after the
first reallocation such that the reallocation for the NULL terminator
only needs to add 1 (instead of 2) to mk->mp->num.
Use struct_size() instead of manually calculating the size for the
reallocation.
Use krealloc_array() for the additional NULL terminator.
Signed-off-by: Thorste
Replace the deprecated zero-length array with a modern flexible array
member in the struct sctp_idatahdr.
Link: https://github.com/KSPP/linux/issues/78
Reviewed-by: Kees Cook
Signed-off-by: Thorsten Blum
---
include/linux/sctp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
On 7. Dec 2024, at 08:48, Wei Liu wrote:
> On Tue, Oct 15, 2024 at 12:18:29PM +0200, Thorsten Blum wrote:
>> Add the __counted_by compiler attribute to the flexible array member
>> range to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
>> CONFIG_FORTIFY_SOURCE.
Replace the deprecated zero-length array with a modern flexible array
member in the struct sctp_idatahdr.
Link: https://github.com/KSPP/linux/issues/78
Signed-off-by: Thorsten Blum
---
include/linux/sctp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/sctp.h
On 14. Nov 2024, at 14:53, Theodore Ts'o wrote:
> By the way, in general, you don't need to resend patches unless you
> need to rebase them to fix patch conflicts; I track requested patches
> using patchwork, and I tend to process and review patches in batches.
>
> If you are concerned that I migh
Add the __counted_by compiler attribute to the flexible array member
name to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Reviewed-by: Jan Kara
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Split the patch into two separate patches as suggested by Greg
On 11. Nov 2024, at 21:47, Thorsten Blum wrote:
> Replace the deprecated one-element array with a modern flexible array
> member in the struct hvtramp_descr.
>
> Additionally, 15 unnecessary bytes were allocated for hdesc, but instead
> of fixing the parentheses in the open-cod
: https://github.com/KSPP/linux/issues/79
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Fix the number of mappings after feedback from Gustavo A. R. Silva
- Link to v1:
https://lore.kernel.org/r/2024200155.164621-3-thorsten.b...@linux.dev/
---
arch/sparc/include/asm/hvtramp.h | 2 +-
arch
On 11. Nov 2024, at 21:20, Gustavo A. R. Silva wrote:
> On 11/11/24 14:01, Thorsten Blum wrote:
>> Replace the deprecated one-element array with a modern flexible array
>> member in the struct hvtramp_descr.
>> Additionally, 15 unnecessary bytes are allocated for hdesc
: https://github.com/KSPP/linux/issues/79
Signed-off-by: Thorsten Blum
---
arch/sparc/include/asm/hvtramp.h | 2 +-
arch/sparc/kernel/smp_64.c | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/sparc/include/asm/hvtramp.h b/arch/sparc/include/asm/hvtramp.h
index
Replace the deprecated zero-length array with a modern flexible array
member in the struct iscsi_bsg_host_vendor_reply.
Link: https://github.com/KSPP/linux/issues/78
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Use DECLARE_FLEX_ARRAY() as suggested by Gustavo A. R. Silva
- Link to v1
Replace the deprecated zero-length array with a modern flexible array
member in the struct iscsi_bsg_host_vendor_reply.
Link: https://github.com/KSPP/linux/issues/78
Signed-off-by: Thorsten Blum
---
include/scsi/scsi_bsg_iscsi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
Add the __counted_by compiler attribute to the flexible array member
buckets to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Compile-tested only.
Signed-off-by: Thorsten Blum
---
include/linux/nfs_xdr.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion
On 5. Nov 2024, at 10:52, Greg KH wrote:
> On Tue, Nov 05, 2024 at 12:42:14AM +0100, Thorsten Blum wrote:
>> Add the __counted_by compiler attribute to the flexible array member
>> name to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
>> CONFIG_FORTIFY_SOURCE.
Add the __counted_by compiler attribute to the flexible array member
name to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Reviewed-by: Jan Kara
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Split the patch into two separate patches as suggested by Greg
Kara
Signed-off-by: Thorsten Blum
---
fs/ext4/dir.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index ef6a3c8f3a9a..02d47a64e8d1 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -418,7 +418,7 @@ struct fname {
__u32
Replace the deprecated one-element array with a modern flexible array
member in the struct vxfs_dirblk.
Link: https://github.com/KSPP/linux/issues/79
Signed-off-by: Thorsten Blum
---
fs/freevxfs/vxfs_dir.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/freevxfs
On 1. Nov 2024, at 13:26, Andy Shevchenko wrote:
> On Fri, Aug 23, 2024 at 04:59:33PM +0200, Thorsten Blum wrote:
>> Add the __counted_by compiler attribute to the flexible array member
>> attrs to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
>>
or
> Tested-by: Nathan Chancellor
> Reviewed-by: Miguel Ojeda
Thanks for fixing this and your work on the Clang issues. Feel free to add:
Reviewed-by: Thorsten Blum
Add the __counted_by compiler attribute to the flexible array member
buckets to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Compile-tested only.
Signed-off-by: Thorsten Blum
---
include/linux/nfs_xdr.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion
In addition to str_on_off() and str_yes_no(), add rules to search for
str_off_on() and str_no_yes() replacements.
Signed-off-by: Thorsten Blum
---
scripts/coccinelle/api/string_choices.cocci | 38 +
1 file changed, 38 insertions(+)
diff --git a/scripts/coccinelle/api
: Thorsten Blum
Reviewed-by: Jan Kara
---
fs/ext4/dir.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index ef6a3c8f3a9a..02d47a64e8d1 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -418,7 +418,7 @@ struct fname {
__u32
the posix_acl_alloc() function parameter count from int to
unsigned int to match posix_acl's a_count data type. Add identifier
names to the function definition to silence two checkpatch warnings.
Reviewed-by: Jan Kara
Signed-off-by: Thorsten Blum
Cc: Nathan Chancellor
---
Changes in v2:
- U
Add the __counted_by compiler attribute to the flexible array member
buckets to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Compile-tested only.
Signed-off-by: Thorsten Blum
---
include/linux/nfs_xdr.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion
Add the __counted_by compiler attribute to the flexible array member
range to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Compile-tested only.
Signed-off-by: Thorsten Blum
---
include/linux/hyperv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion
: Thorsten Blum
Reviewed-by: Jan Kara
---
fs/ext4/dir.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index ef6a3c8f3a9a..02d47a64e8d1 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -418,7 +418,7 @@ struct fname {
__u32
In addition to __counted_by, also match the keywords __counted_by_le and
__counted_by_be.
Signed-off-by: Thorsten Blum
---
MAINTAINERS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 84086d47db69..475387503391 100644
--- a/MAINTAINERS
+++ b
On 2. Oct 2024, at 05:42, Nathan Chancellor wrote:
> On Thu, Sep 26, 2024 at 02:21:42PM +0200, Thorsten Blum wrote:
>> On 26. Sep 2024, at 03:46, kernel test robot wrote:
>>>
>>> Hello,
>>>
>>> kernel test robot noticed
>>>
Replace the deprecated one-element array with a modern flexible array
member in the struct compat_msgbuf.
There are no binary differences after this conversion.
Link: https://github.com/KSPP/linux/issues/79
Signed-off-by: Thorsten Blum
---
ipc/msg.c | 2 +-
1 file changed, 1 insertion(+), 1
Add the __counted_by compiler attribute to the flexible array member
buckets to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Compile-tested only.
Signed-off-by: Thorsten Blum
---
include/linux/nfs_xdr.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion
l with __counted_by()")
> url:
> https://github.com/intel-lab-lkp/linux/commits/Thorsten-Blum/acl-Annotate-struct-posix_acl-with-__counted_by/20240924-054002
> base: https://git.kernel.org/cgit/linux/kernel/git/vfs/vfs.git vfs.all
> patch link:
> https://lore.kernel.org/all/20240
ested only.
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Change the data type of Chunks from __u8[] to struct srv_copychunk[]
as suggested by Tom Talpey
- Use struct_size()
- Link to v1:
https://lore.kernel.org/linux-kernel/20240924102243.239811-2-thorsten.b...@linux.dev/
---
fs/smb/s
On 24. Sep 2024, at 21:33, Thorsten Blum wrote:
>> On 24. Sep 2024, at 20:05, Tom Talpey wrote:
>> On 9/24/2024 6:22 AM, Thorsten Blum wrote:
>>> Add the __counted_by_le compiler attribute to the flexible array member
>>> Chunks to improve access bounds-checki
Hi Tom,
> On 24. Sep 2024, at 20:05, Tom Talpey wrote:
> On 9/24/2024 6:22 AM, Thorsten Blum wrote:
>> Add the __counted_by_le compiler attribute to the flexible array member
>> Chunks to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
>> CONFIG_FORTIFY_SOURCE.
Add the __counted_by_le compiler attribute to the flexible array member
Chunks to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Read Chunks[0] after checking that ChunkCount is not 0.
Compile-tested only.
Signed-off-by: Thorsten Blum
---
fs/smb/server
In addition to __counted_by, also match the keywords __counted_by_le and
__counted_by_be.
Signed-off-by: Thorsten Blum
---
MAINTAINERS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 911d573f7779..aff8b04b5eac 100644
--- a/MAINTAINERS
+++ b
1 - 100 of 135 matches
Mail list logo