Skip to content

Commit f941c51

Browse files
Carlos Llamasaxboe
authored andcommitted
loop: fix ioctl calls using compat_loop_info
Support for cryptoloop was deleted in commit 47e9624 ("block: remove support for cryptoloop and the xor transfer"), making the usage of loop_info->lo_encrypt_type obsolete. However, this member was also removed from the compat_loop_info definition and this breaks userspace ioctl calls for 32-bit binaries and CONFIG_COMPAT=y. This patch restores the compat_loop_info->lo_encrypt_type member and marks it obsolete as well as in the uapi header definitions. Fixes: 47e9624 ("block: remove support for cryptoloop and the xor transfer") Signed-off-by: Carlos Llamas <cmllamas@google.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20220329201815.1347500-1-cmllamas@google.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 1e06b3e commit f941c51

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/block/loop.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,7 @@ struct compat_loop_info {
15921592
compat_ulong_t lo_inode; /* ioctl r/o */
15931593
compat_dev_t lo_rdevice; /* ioctl r/o */
15941594
compat_int_t lo_offset;
1595+
compat_int_t lo_encrypt_type; /* obsolete, ignored */
15951596
compat_int_t lo_encrypt_key_size; /* ioctl w/o */
15961597
compat_int_t lo_flags; /* ioctl r/o */
15971598
char lo_name[LO_NAME_SIZE];

include/uapi/linux/loop.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct loop_info {
4545
unsigned long lo_inode; /* ioctl r/o */
4646
__kernel_old_dev_t lo_rdevice; /* ioctl r/o */
4747
int lo_offset;
48-
int lo_encrypt_type;
48+
int lo_encrypt_type; /* obsolete, ignored */
4949
int lo_encrypt_key_size; /* ioctl w/o */
5050
int lo_flags;
5151
char lo_name[LO_NAME_SIZE];
@@ -61,7 +61,7 @@ struct loop_info64 {
6161
__u64 lo_offset;
6262
__u64 lo_sizelimit;/* bytes, 0 == max available */
6363
__u32 lo_number; /* ioctl r/o */
64-
__u32 lo_encrypt_type;
64+
__u32 lo_encrypt_type; /* obsolete, ignored */
6565
__u32 lo_encrypt_key_size; /* ioctl w/o */
6666
__u32 lo_flags;
6767
__u8 lo_file_name[LO_NAME_SIZE];

0 commit comments

Comments
 (0)