btrfs: fix 64bit compat send ioctl arguments not initializing version member
Subsystems (2)
David Sterba
maintainerPATCH 1/1 btrfs: fix 64bit compat send ioctl arguments not initializing version member
When the send protocol versioning was added in 5.16 e77fbf990316 ("btrfs: send: prepare for v2 protocol"), the 32/64bit compat code was not updated (added by 2351f431f727 ("btrfs: fix send ioctl on 32bit with 64bit kernel")), missing the version struct member. The compat code is probably rarely used, nobody reported any bugs.
Found by tool https://github.com/jirislaby/clang-struct .
--- fs/btrfs/ioctl.c | 1 + 1 file changed, 1 insertion(+)
fs/btrfs/ioctl.c +1 -0
@@ -4356,6 +4356,7 @@ static int _btrfs_ioctl_send(struct inode *inode, void __user *argp, bool compat arg->clone_sources =compat_ptr (args32.clone_sources); arg->parent_root = args32.parent_root; arg->flags = args32.flags; + arg->version = args32.version;memcpy (arg->reserved, args32.reserved,sizeof (args32.reserved));#else
Signature · 1 line
2.42.1
Quoted 10 lines · David Sterba
When the send protocol versioning was added in 5.16
e77fbf990316("btrfs: send: prepare for v2 protocol"), the 32/64bit compat code was not updated (added by2351f431f727("btrfs: fix send ioctl on 32bit with 64bit kernel")), missing the version struct member. The compat code is probably rarely used, nobody reported any bugs.Found by tool https://github.com/jirislaby/clang-struct .
Fixes 2351f431f727 ("btrfs: fix send ioctl on 32bit with 64bit kernel")
So this is not the correct commit, you copy-pasted the wrong one from the change log above, it should be:
e77fbf990316 ("btrfs: send: prepare for v2 protocol")
With that fixed:
Thanks.
Quoted 22 lines
CC [email protected] # 6.1+Signed-off-by David Sterba <[email protected]>--- fs/btrfs/ioctl.c | 1 + 1 file changed, 1 insertion(+)fs/btrfs/ioctl.c +1
-1@@ -4356,6 +4356,7 @@ static int _btrfs_ioctl_send(struct inode *inode, void __user *argp, bool compat arg->clone_sources =compat_ptr (args32.clone_sources); arg->parent_root = args32.parent_root; arg->flags = args32.flags; + arg->version = args32.version;memcpy (arg->reserved, args32.reserved,sizeof (args32.reserved));#else --2.42.1
Quoted 8 lines · Filipe Manana
Quoted 7 lines · David Sterba
When the send protocol versioning was added in 5.16
e77fbf990316("btrfs: send: prepare for v2 protocol"), the 32/64bit compat code was not updated (added by2351f431f727("btrfs: fix send ioctl on 32bit with 64bit kernel")), missing the version struct member. The compat code is probably rarely used, nobody reported any bugs.
Quoted 8 lines
Quoted 3 lines
Found by tool https://github.com/jirislaby/clang-struct .
Fixes 2351f431f727 ("btrfs: fix send ioctl on 32bit with 64bit kernel")So this is not the correct commit, you copy-pasted the wrong one from the change log above, it should be:
e77fbf990316("btrfs: send: prepare for v2 protocol")
Of course, fixed, thanks.