* [PATCH] loop: fix ioctl calls using compat_loop_info
@ 2022-03-29 20:18 Carlos Llamas
2022-03-30 5:02 ` Christoph Hellwig
2022-03-30 14:55 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Carlos Llamas @ 2022-03-29 20:18 UTC (permalink / raw)
To: linux-block
Cc: Jens Axboe, Christoph Hellwig, kernel-team, linux-kernel,
Carlos Llamas
Support for cryptoloop was deleted in commit 47e9624616c8 ("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: 47e9624616c8 ("block: remove support for cryptoloop and the xor transfer")
Signed-off-by: Carlos Llamas <cmllamas@google.com>
---
drivers/block/loop.c | 1 +
include/uapi/linux/loop.h | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 3e636a75c83a..a58595f5ee2c 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1591,6 +1591,7 @@ struct compat_loop_info {
compat_ulong_t lo_inode; /* ioctl r/o */
compat_dev_t lo_rdevice; /* ioctl r/o */
compat_int_t lo_offset;
+ compat_int_t lo_encrypt_type; /* obsolete, ignored */
compat_int_t lo_encrypt_key_size; /* ioctl w/o */
compat_int_t lo_flags; /* ioctl r/o */
char lo_name[LO_NAME_SIZE];
diff --git a/include/uapi/linux/loop.h b/include/uapi/linux/loop.h
index 24a1c45bd1ae..98e60801195e 100644
--- a/include/uapi/linux/loop.h
+++ b/include/uapi/linux/loop.h
@@ -45,7 +45,7 @@ struct loop_info {
unsigned long lo_inode; /* ioctl r/o */
__kernel_old_dev_t lo_rdevice; /* ioctl r/o */
int lo_offset;
- int lo_encrypt_type;
+ int lo_encrypt_type; /* obsolete, ignored */
int lo_encrypt_key_size; /* ioctl w/o */
int lo_flags;
char lo_name[LO_NAME_SIZE];
@@ -61,7 +61,7 @@ struct loop_info64 {
__u64 lo_offset;
__u64 lo_sizelimit;/* bytes, 0 == max available */
__u32 lo_number; /* ioctl r/o */
- __u32 lo_encrypt_type;
+ __u32 lo_encrypt_type; /* obsolete, ignored */
__u32 lo_encrypt_key_size; /* ioctl w/o */
__u32 lo_flags;
__u8 lo_file_name[LO_NAME_SIZE];
--
2.35.1.1021.g381101b075-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] loop: fix ioctl calls using compat_loop_info
2022-03-29 20:18 [PATCH] loop: fix ioctl calls using compat_loop_info Carlos Llamas
@ 2022-03-30 5:02 ` Christoph Hellwig
2022-03-30 14:55 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2022-03-30 5:02 UTC (permalink / raw)
To: Carlos Llamas
Cc: linux-block, Jens Axboe, Christoph Hellwig, kernel-team,
linux-kernel
On Tue, Mar 29, 2022 at 08:18:15PM +0000, Carlos Llamas wrote:
> Support for cryptoloop was deleted in commit 47e9624616c8 ("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: 47e9624616c8 ("block: remove support for cryptoloop and the xor transfer")
> Signed-off-by: Carlos Llamas <cmllamas@google.com>
Ooops. The fix looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] loop: fix ioctl calls using compat_loop_info
2022-03-29 20:18 [PATCH] loop: fix ioctl calls using compat_loop_info Carlos Llamas
2022-03-30 5:02 ` Christoph Hellwig
@ 2022-03-30 14:55 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2022-03-30 14:55 UTC (permalink / raw)
To: Carlos Llamas, linux-block; +Cc: Christoph Hellwig, kernel-team, linux-kernel
On Tue, 29 Mar 2022 20:18:15 +0000, Carlos Llamas wrote:
> Support for cryptoloop was deleted in commit 47e9624616c8 ("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.
>
> [...]
Applied, thanks!
[1/1] loop: fix ioctl calls using compat_loop_info
commit: f941c51eeac7ebe0f8ec30943bf78e7f60aad039
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-30 14:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-29 20:18 [PATCH] loop: fix ioctl calls using compat_loop_info Carlos Llamas
2022-03-30 5:02 ` Christoph Hellwig
2022-03-30 14:55 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox