Skip to content

Commit

Permalink
vboxsf: Fix the check for the old binary mount-arguments struct
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
jwrdegoede authored and Al Viro committed Aug 25, 2020
1 parent 9123e3a commit 9d682ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/vboxsf/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ static int vboxsf_setup(void)

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 &&
Expand Down

0 comments on commit 9d682ea

Please sign in to comment.