Received: from eggs.gnu.org ([2001:4830:134:3::10]:39176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEbE8-0002GO-8X for qemu-devel@nongnu.org; Fri, 23 Jan 2015 05:12:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEbE3-00058A-QJ for qemu-devel@nongnu.org; Fri, 23 Jan 2015 05:12:32 -0500 Message-ID: <54C22049.4000403@sunrus.com.cn> Date: Fri, 23 Jan 2015 18:19:53 +0800 From: Chen Gang S MIME-Version: 1.0 References: <54C20C26.6010204@sunrus.com.cn> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] linux-user/syscall.c: Need call unlock_user() before go to failure return in default case List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Trivial , Riku Voipio , qemu-devel On 1/23/15 18:01, Peter Maydell wrote: > On 23 January 2015 at 08:53, Chen Gang S wrote: >> In abi_long do_ioctl_dm(), after calls lock_user(), it does not call >> unlock_user() before go to failure return in default case. >> >> Signed-off-by: Chen Gang >> --- >> linux-user/syscall.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/linux-user/syscall.c b/linux-user/syscall.c >> index aaac6a2..290fdea 100644 >> --- a/linux-user/syscall.c >> +++ b/linux-user/syscall.c >> @@ -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); >> -- >> 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. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed