]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
linux-user: allow NULL arguments to mount
authorPaul Burton <paul@archlinuxmips.org>
Sun, 22 Jun 2014 10:25:37 +0000 (11:25 +0100)
committerRiku Voipio <riku.voipio@linaro.org>
Sun, 29 Jun 2014 11:19:59 +0000 (14:19 +0300)
commit356d771b30071b44fcb19d2f8d911784b9b276be
tree810bbb258f846ed806f85dca27609c144e2cb139
parent82d0fe6b7a7384ed442b6a481ab33d442a06f5f1
linux-user: allow NULL arguments to mount

Calls to the mount syscall can legitimately provide NULL as the value
for the source of filesystemtype arguments, which QEMU would previously
reject & return -EFAULT to the target program. An example of this is
remounting an already mounted filesystem with different properties.

Instead of rejecting such syscalls with -EFAULT, pass NULL along to the
kernel as the target program expects.

Additionally this patch fixes a potential memory leak when DEBUG_REMAP
is enabled and lock_user_string fails on the target or filesystemtype
arguments but a prior argument was non-NULL and already locked.

Since the patch already touched most lines of the TARGET_NR_mount case,
it fixes the indentation & coding style for good measure.

Signed-off-by: Paul Burton <paul@archlinuxmips.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/syscall.c