linux-user/syscall.c: Need call unlock_user() before go to failure return in default case
PATCH 1/1 linux-user/syscall.c: Need call unlock_user() before go to failure return in default case
In abi_long do_ioctl_dm(), after calls lock_user(), it does not call unlock_user() before go to failure return in default case.
--- linux-user/syscall.c | 1 + 1 file changed, 1 insertion(+)
linux-user/syscall.c +1 -0
@@ -3681,6 +3681,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, }default : ret = -TARGET_EINVAL ; +unlock_user (argptr, guest_data,0 ); goto out; }unlock_user (argptr, guest_data, guest_data_size);
Signature · 1 line
1.9.3 (Apple Git-50)
Quoted 21 lines · Chen Gang S
In
abi_longdo_ioctl_dm(), after callslock_user(), it does not callunlock_user()before go to failure return in default case.Signed-off-by Chen Gang <[email protected]>--- linux-user/syscall.c | 1 + 1 file changed, 1 insertion(+)linux-user/syscall.c +1
-1@@ -3681,6 +3681,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, }default : ret = -TARGET_EINVAL ; +unlock_user (argptr, guest_data,0 ); goto out; }unlock_user (argptr, guest_data, guest_data_size); --
Quoted 1 line
1.9.3 (Apple Git-50)
Correct as far as it goes, but notice that we have the identical bug in the other switch (ie->host_cmd) as well...
thanks
-- PMM
Quoted 18 lines · Peter Maydell
Quoted 17 lines · Chen Gang S
In
abi_longdo_ioctl_dm(), after callslock_user(), it does not callunlock_user()before go to failure return in default case.Signed-off-by Chen Gang <[email protected]>--- linux-user/syscall.c | 1 + 1 file changed, 1 insertion(+)linux-user/syscall.c +1
-0@@ -3681,6 +3681,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, }default : ret = -TARGET_EINVAL ; +unlock_user (argptr, guest_data,0 );
Quoted 9 lines
Quoted 5 lines
linux-user/syscall.c +0
-1goto out; }unlock_user (argptr, guest_data, guest_data_size); --1.9.3 (Apple Git-50)
Correct as far as it goes, but notice that we have the identical bug in the other switch (
ie->host_cmd) as well...
Oh, really, thanks. I shall send patch v2 for it, if no additional reply within 2 days.
Thanks.
Signature · 3 lines
Chen Gang Open, share, and attitude like air, water, and life which God blessed