From: Chen Gang S <gang.chen@sunrus.com.cn>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
Riku Voipio <riku.voipio@iki.fi>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] linux-user/syscall.c: Need call unlock_user() before go to failure return in default case
Date: Fri, 23 Jan 2015 18:19:53 +0800 [thread overview]
Message-ID: <54C22049.4000403@sunrus.com.cn> (raw)
In-Reply-To: <CAFEAcA8ouuFXLJcTdM5B1hbj5_cZ1TKQgrJtFiCpaUJaYjGEAw@mail.gmail.com>
On 1/23/15 18:01, Peter Maydell wrote:
> On 23 January 2015 at 08:53, Chen Gang S <gang.chen@sunrus.com.cn> 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 <gang.chen.5i5j@gmail.com>
>> ---
>> 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
WARNING: multiple messages have this Message-ID (diff)
From: Chen Gang S <gang.chen@sunrus.com.cn>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
Riku Voipio <riku.voipio@iki.fi>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] linux-user/syscall.c: Need call unlock_user() before go to failure return in default case
Date: Fri, 23 Jan 2015 18:19:53 +0800 [thread overview]
Message-ID: <54C22049.4000403@sunrus.com.cn> (raw)
In-Reply-To: <CAFEAcA8ouuFXLJcTdM5B1hbj5_cZ1TKQgrJtFiCpaUJaYjGEAw@mail.gmail.com>
On 1/23/15 18:01, Peter Maydell wrote:
> On 23 January 2015 at 08:53, Chen Gang S <gang.chen@sunrus.com.cn> 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 <gang.chen.5i5j@gmail.com>
>> ---
>> 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
next prev parent reply other threads:[~2015-01-23 10:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 8:53 [Qemu-trivial] [PATCH] linux-user/syscall.c: Need call unlock_user() before go to failure return in default case Chen Gang S
2015-01-23 8:53 ` [Qemu-devel] " Chen Gang S
2015-01-23 10:01 ` [Qemu-trivial] " Peter Maydell
2015-01-23 10:01 ` Peter Maydell
2015-01-23 10:19 ` Chen Gang S [this message]
2015-01-23 10:19 ` Chen Gang S
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54C22049.4000403@sunrus.com.cn \
--to=gang.chen@sunrus.com.cn \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.