linux/fs/vboxsf
Linus Torvalds 9b3b353ef3 vboxfs: fix broken legacy mount signature checking
Commit 9d682ea6bc ("vboxsf: Fix the check for the old binary
mount-arguments struct") was meant to fix a build error due to sign
mismatch in 'char' and the use of character constants, but it just moved
the error elsewhere, in that on some architectures characters and signed
and on others they are unsigned, and that's just how the C standard
works.

The proper fix is a simple "don't do that then".  The code was just
being silly and odd, and it should never have cared about signed vs
unsigned characters in the first place, since what it is testing is not
four "characters", but four bytes.

And the way to compare four bytes is by using "memcmp()".

Which compilers will know to just turn into a single 32-bit compare with
a constant, as long as you don't have crazy debug options enabled.

Link: https://lore.kernel.org/lkml/20210927094123.576521-1-arnd@kernel.org/
Cc: Arnd Bergmann <arnd@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-09-27 11:26:21 -07:00
..
Kconfig
Makefile
dir.c vboxsf: Add support for the atomic_open directory-inode op 2021-06-23 14:36:52 +02:00
file.c vboxsf: Add vboxsf_[create|release]_sf_handle() helpers 2021-06-23 14:36:46 +02:00
shfl_hostintf.h
super.c vboxfs: fix broken legacy mount signature checking 2021-09-27 11:26:21 -07:00
utils.c vboxsf: don't allow to change the inode type 2021-03-12 22:15:00 -05:00
vboxsf_wrappers.c
vfsmod.h vboxsf: Add vboxsf_[create|release]_sf_handle() helpers 2021-06-23 14:36:46 +02:00