]> Git Repo - linux.git/commitdiff
fs: don't randomize struct kiocb fields
authorKeith Busch <[email protected]>
Fri, 12 Aug 2022 22:56:33 +0000 (15:56 -0700)
committerJens Axboe <[email protected]>
Fri, 12 Aug 2022 23:00:35 +0000 (17:00 -0600)
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]>
include/linux/fs.h

index 9f131e559d05deea5aa716db94f01b57c21142cd..daf69a6504b6c47f5380e945672ff793d8448e3c 100644 (file)
@@ -339,17 +339,12 @@ enum rw_hint {
 
 struct kiocb {
        struct file             *ki_filp;
-
-       /* The 'ki_filp' pointer is shared in a union for aio */
-       randomized_struct_fields_start
-
        loff_t                  ki_pos;
        void (*ki_complete)(struct kiocb *iocb, long ret);
        void                    *private;
        int                     ki_flags;
        u16                     ki_ioprio; /* See linux/ioprio.h */
        struct wait_page_queue  *ki_waitq; /* for async buffered IO */
-       randomized_struct_fields_end
 };
 
 static inline bool is_sync_kiocb(struct kiocb *kiocb)
This page took 0.070816 seconds and 4 git commands to generate.