Convert 'alloc_obj' family to use the new default GFP_KERNEL argumentThis was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs
Convert 'alloc_obj' family to use the new default GFP_KERNEL argumentThis was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'to convert the new alloc_obj() users that had a simple GFP_KERNELargument to just drop that argument.Note that due to the extreme simplicity of the scripting, any slightlymore complex cases spread over multiple lines would not be triggered:they definitely exist, but this covers the vast bulk of the cases, andthe resulting diff is also then easier to check automatically.For the same reason the 'flex' versions will be done as a separateconversion.Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
treewide: Replace kmalloc with kmalloc_obj for non-scalar typesThis is the result of running the Coccinelle script fromscripts/coccinelle/api/kmalloc_objs.cocci. The script is designed toavoid sc
treewide: Replace kmalloc with kmalloc_obj for non-scalar typesThis is the result of running the Coccinelle script fromscripts/coccinelle/api/kmalloc_objs.cocci. The script is designed toavoid scalar types (which need careful case-by-case checking), andinstead replace kmalloc-family calls that allocate struct or unionobject instances:Single allocations: kmalloc(sizeof(TYPE), ...)are replaced with: kmalloc_obj(TYPE, ...)Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)are replaced with: kmalloc_objs(TYPE, COUNT, ...)Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)(where TYPE may also be *VAR)The resulting allocations no longer return "void *", instead returning"TYPE *".Signed-off-by: Kees Cook <kees@kernel.org>
kernel.h: drop hex.h and update all hex.h usersRemove <linux/hex.h> from <linux/kernel.h> and update all users/callers ofhex.h interfaces to directly #include <linux/hex.h> as part of the process
kernel.h: drop hex.h and update all hex.h usersRemove <linux/hex.h> from <linux/kernel.h> and update all users/callers ofhex.h interfaces to directly #include <linux/hex.h> as part of the processof putting kernel.h on a diet.Removing hex.h from kernel.h means that 36K C source files don't have topay the price of parsing hex.h for the roughly 120 C source files thatneed it.This change has been build-tested with allmodconfig on most ARCHes. Also,all users/callers of <linux/hex.h> in the entire source tree have beenupdated if needed (if not already #included).Link: https://lkml.kernel.org/r/20251215005206.2362276-1-rdunlap@infradead.orgSigned-off-by: Randy Dunlap <rdunlap@infradead.org>Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>Cc: Ingo Molnar <mingo@kernel.org>Cc: Yury Norov (NVIDIA) <yury.norov@gmail.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
media: update Hans Verkuil's email addressReplace hverkuil@xs4all.nl by hverkuil@kernel.org.Signed-off-by: Hans Verkuil <hverkuil@kernel.org>Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@
media: update Hans Verkuil's email addressReplace hverkuil@xs4all.nl by hverkuil@kernel.org.Signed-off-by: Hans Verkuil <hverkuil@kernel.org>Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
media: rainshadow-cec: fix TOCTOU race condition in rain_interrupt()In the interrupt handler rain_interrupt(), the buffer full check onrain->buf_len is performed before acquiring rain->buf_lock. T
media: rainshadow-cec: fix TOCTOU race condition in rain_interrupt()In the interrupt handler rain_interrupt(), the buffer full check onrain->buf_len is performed before acquiring rain->buf_lock. Thiscreates a Time-of-Check to Time-of-Use (TOCTOU) race condition, asrain->buf_len is concurrently accessed and modified in the workhandler rain_irq_work_handler() under the same lock.Multiple interrupt invocations can race, with each reading buf_lenbefore it becomes full and then proceeding. This can lead to bothinterrupts attempting to write to the buffer, incrementing buf_lenbeyond its capacity (DATA_SIZE) and causing a buffer overflow.Fix this bug by moving the spin_lock() to before the buffer fullcheck. This ensures that the check and the subsequent buffer modificationare performed atomically, preventing the race condition. An correspondingspin_unlock() is added to the overflow path to correctly release thelock.This possible bug was found by an experimental static analysis tooldeveloped by our team.Fixes: 0f314f6c2e77 ("[media] rainshadow-cec: new RainShadow Tech HDMI CEC driver")Cc: stable@vger.kernel.orgSigned-off-by: Gui-Dong Han <hanguidong02@gmail.com>Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
media: move CEC USB drivers to a separate directoryAs CEC support doesn't depend on MEDIA_SUPPORT, let'splace the platform drivers outside the media menu.As a side effect, instead of depends on
media: move CEC USB drivers to a separate directoryAs CEC support doesn't depend on MEDIA_SUPPORT, let'splace the platform drivers outside the media menu.As a side effect, instead of depends on USB, driversjust select it.Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>