From: Laurent Vivier <laurent@vivier.eu>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Riku Voipio <riku.voipio@iki.fi>,
Alistair Francis <alistair.francis@wdc.com>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PULL 1/1] linux-user: Support futex_time64
Date: Tue, 3 Nov 2020 08:28:51 +0100 [thread overview]
Message-ID: <a1fd7792-b7fa-6e86-4a24-b53fb7ecac0f@vivier.eu> (raw)
In-Reply-To: <CAFEAcA97s+jiZxH+ObdFeFgs7-Wub6XjZvJFmL2s4voRrny38Q@mail.gmail.com>
Le 02/11/2020 à 19:15, Peter Maydell a écrit :
> On Mon, 30 Mar 2020 at 11:31, Laurent Vivier <laurent@vivier.eu> wrote:
>>
>> From: Alistair Francis <alistair.francis@wdc.com>
>>
>> Add support for host and target futex_time64. If futex_time64 exists on
>> the host we try that first before falling back to the standard futex
>> syscall.
>
> Hi; I dunno why Coverity's only just noticed this, but in
> CID 1432339 it points out:
>
>> +#if defined(TARGET_NR_futex_time64)
>> +static int do_futex_time64(target_ulong uaddr, int op, int val, target_ulong timeout,
>> + target_ulong uaddr2, int val3)
>> +{
>> + struct timespec ts, *pts;
>> + int base_op;
>> +
>> + /* ??? We assume FUTEX_* constants are the same on both host
>> + and target. */
>> +#ifdef FUTEX_CMD_MASK
>> + base_op = op & FUTEX_CMD_MASK;
>> +#else
>> + base_op = op;
>> +#endif
>> + switch (base_op) {
>> + case FUTEX_WAIT:
>> + case FUTEX_WAIT_BITSET:
>> + if (timeout) {
>> + pts = &ts;
>> + target_to_host_timespec64(pts, timeout);
>
> ...that here we call target_to_host_timespec64(), which can
> fail with -TARGET_EFAULT, but (unlike all the other times we call
> the function) we aren't checking its return value.
> Is there missing error handling code here ?
>
I think the code is like that because this is a cut&paste of function
do_futex() witl "s/timespec/timespec64/".
And yes I think we should check for the return value.
I'm going to fix that.
Thanks,
Laurent
next prev parent reply other threads:[~2020-11-03 7:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-30 10:29 [PULL 0/1] Linux user for 5.0 patches Laurent Vivier
2020-03-30 10:29 ` [PULL 1/1] linux-user: Support futex_time64 Laurent Vivier
2020-11-02 18:15 ` Peter Maydell
2020-11-03 7:28 ` Laurent Vivier [this message]
2020-11-03 15:40 ` Alistair Francis
2020-11-03 16:00 ` Laurent Vivier
2020-11-03 19:46 ` Alistair Francis
2020-03-30 11:32 ` [PULL 0/1] Linux user for 5.0 patches no-reply
2020-03-30 12:14 ` Peter Maydell
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=a1fd7792-b7fa-6e86-4a24-b53fb7ecac0f@vivier.eu \
--to=laurent@vivier.eu \
--cc=alistair.francis@wdc.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).