]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
vboxsf: Fix the check for the old binary mount-arguments struct
authorHans de Goede <hdegoede@redhat.com>
Tue, 25 Aug 2020 11:12:57 +0000 (13:12 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 25 Aug 2020 12:47:01 +0000 (08:47 -0400)
Fix the check for the mainline vboxsf code being used with the old
mount.vboxsf mount binary from the out-of-tree vboxsf version doing
a comparison between signed and unsigned data types.

This fixes the following smatch warnings:

fs/vboxsf/super.c:390 vboxsf_parse_monolithic() warn: impossible condition '(options[1] == (255)) => ((-128)-127 == 255)'
fs/vboxsf/super.c:391 vboxsf_parse_monolithic() warn: impossible condition '(options[2] == (254)) => ((-128)-127 == 254)'
fs/vboxsf/super.c:392 vboxsf_parse_monolithic() warn: impossible condition '(options[3] == (253)) => ((-128)-127 == 253)'

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/vboxsf/super.c

index 8fe03b4a0d2b038e99b4920e8539e1f5363e55d8..25aade3441922ac092babcadf1c93bd64f019000 100644 (file)
@@ -384,7 +384,7 @@ fail_nomem:
 
 static int vboxsf_parse_monolithic(struct fs_context *fc, void *data)
 {
-       char *options = data;
+       unsigned char *options = data;
 
        if (options && options[0] == VBSF_MOUNT_SIGNATURE_BYTE_0 &&
                       options[1] == VBSF_MOUNT_SIGNATURE_BYTE_1 &&