summaryrefslogtreecommitdiff
path: root/block/early-lookup.c
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2024-09-25 11:03:13 +0200
committerSteve French <stfrench@microsoft.com>2024-10-01 14:50:51 -0500
commit0801c1374ab1552bd7376370987142ff77912527 (patch)
treef462dcd9449f287b307585e01d1962cfdf154028 /block/early-lookup.c
parent04afb0a3c30aeb5fbe890a92debbfc0cc4044b6f (diff)
ksmbd: Annotate struct copychunk_ioctl_req with __counted_by_le()
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. Change the data type of the flexible array member Chunks from __u8[] to struct srv_copychunk[] for ChunkCount to match the number of elements in the Chunks array. (With __u8[], each srv_copychunk would occupy 24 array entries and the __counted_by compiler attribute wouldn't be applicable.) Use struct_size() to calculate the size of the copychunk_ioctl_req. Read Chunks[0] after checking that ChunkCount is not 0. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'block/early-lookup.c')
0 files changed, 0 insertions, 0 deletions