Re: [PATCH] x86/syscall: Avoid memcpy() for ia32 syscall_get_arguments()

2024-07-12 Thread Kees Cook
On Fri, Jul 12, 2024 at 11:00:08AM +0200, Peter Zijlstra wrote: > On Thu, Jul 11, 2024 at 04:10:43PM -0700, Kees Cook wrote: > > > The long answer is long, and comes in two halves: the language half and > > the fortify half. > > > > First, the C standard requires that all function argument arrays

Re: [PATCH 2/2] media: venus: hfi_cmds: struct hfi_session_release_buffer_pkt: Add __counted_by annotation

2024-07-12 Thread Vikash Garodia
On 7/11/2024 4:39 AM, Kees Cook wrote: > The only direct user of struct hfi_session_release_buffer_pkt is > pkt_session_unset_buffers() which sets "num_buffers" before using it > as a loop counter for accessing "buffer_info". Add the __counted_by > annotation to reflect the relationship. > > Si

Re: [PATCH 1/2] media: venus: hfi_cmds: struct hfi_session_release_buffer_pkt: Replace 1-element array with flexible array

2024-07-12 Thread Vikash Garodia
On 7/11/2024 4:39 AM, Kees Cook wrote: > Replace the deprecated[1] use of a 1-element array in > struct hfi_session_release_buffer_pkt with a modern flexible array. > > No binary differences are present after this conversion. > > Link: https://github.com/KSPP/linux/issues/79 [1] > Signed-off-by

Re: [PATCH] x86/syscall: Avoid memcpy() for ia32 syscall_get_arguments()

2024-07-12 Thread Peter Zijlstra
On Thu, Jul 11, 2024 at 04:10:43PM -0700, Kees Cook wrote: > The long answer is long, and comes in two halves: the language half and > the fortify half. > > First, the C standard requires that all function argument arrays be > decayed to pointers, so your prototype is semantically handled as if >