Skip to content

Commit addebd9

Browse files
keithbuschaxboe
authored andcommitted
fs: don't randomize struct kiocb fields
This is a size sensitive structure and randomizing can introduce extra padding that breaks io_uring's fixed size expectations. There are few fields here as it is, half of which need a fixed order to optimally pack, so the randomization isn't providing much. Suggested-by: Linus Torvalds <[email protected]> Signed-off-by: Keith Busch <[email protected]> Link: https://lore.kernel.org/io-uring/[email protected]/ Signed-off-by: Jens Axboe <[email protected]>
1 parent da2634e commit addebd9

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

include/linux/fs.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,17 +339,12 @@ enum rw_hint {
339339

340340
struct kiocb {
341341
struct file *ki_filp;
342-
343-
/* The 'ki_filp' pointer is shared in a union for aio */
344-
randomized_struct_fields_start
345-
346342
loff_t ki_pos;
347343
void (*ki_complete)(struct kiocb *iocb, long ret);
348344
void *private;
349345
int ki_flags;
350346
u16 ki_ioprio; /* See linux/ioprio.h */
351347
struct wait_page_queue *ki_waitq; /* for async buffered IO */
352-
randomized_struct_fields_end
353348
};
354349

355350
static inline bool is_sync_kiocb(struct kiocb *kiocb)

0 commit comments

Comments
 (0)