[linus:master] [fortify] 4ce615e798: kunit.fortify.alloc_size_kmalloc_dynamic_test.fail

2024-03-30 Thread kernel test robot
Hello, kernel test robot noticed "kunit.fortify.alloc_size_kmalloc_dynamic_test.fail" on: commit: 4ce615e798a752d4431fcc52960478906dec2f0e ("fortify: Provide KUnit counters for failure testing") https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master [test failed on linus/mas

Re: [PATCH v2] perf/x86/amd/uncore: Use kcalloc*() instead of kzalloc*()

2024-03-30 Thread Ingo Molnar
* Erick Archer wrote: > As noted in the "Deprecated Interfaces, Language Features, Attributes, > and Conventions" documentation [1], size calculations (especially > multiplication) should not be performed in memory allocator (or similar) > function arguments due to the risk of them overflowing.

[PATCH] mtd: maps: sa1100-flash: Prefer struct_size over open coded arithmetic

2024-03-30 Thread Erick Archer
This is an effort to get rid of all multiplications from allocation functions in order to prevent integer overflows [1][2]. As the "info" variable is a pointer to "struct sa_info" and this structure ends in a flexible array: struct sa_info { [...] struct sa_subdev_info subdev[];

[PATCH v3] scsi: csiostor: Use kcalloc() instead of kzalloc()

2024-03-30 Thread Erick Archer
Use 2-factor multiplication argument form kcalloc() instead of kzalloc(). Also, it is preferred to use sizeof(*pointer) instead of sizeof(type) due to the type of the variable can change and one needs not change the former (unlike the latter). Link: https://github.com/KSPP/linux/issues/162 Review

[PATCH v2] perf/x86/amd/uncore: Use kcalloc*() instead of kzalloc*()

2024-03-30 Thread Erick Archer
As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them overflowing. This could lead to values wrappin

[PATCH v2] dmaengine: pl08x: Use kcalloc() instead of kzalloc()

2024-03-30 Thread Erick Archer
This is an effort to get rid of all multiplications from allocation functions in order to prevent integer overflows [1]. Here the multiplication is obviously safe because the "channels" member can only be 8 or 2. This value is set when the "vendor_data" structs are initialized. static struct vend

[PATCH] perf/x86/intel/uncore: Prefer struct_size over open coded arithmetic

2024-03-30 Thread Erick Archer
This is an effort to get rid of all multiplications from allocation functions in order to prevent integer overflows [1][2]. As the "box" variable is a pointer to "struct intel_uncore_box" and this structure ends in a flexible array: struct intel_uncore_box { [...] struct intel_unc