GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Alviro Iskandar Setiawan <[email protected]>,
	Greg Kroah-Hartman <[email protected]>
Cc: Ammar Faizi <[email protected]>,
	Pavel Begunkov <[email protected]>,
	Dan Carpenter <[email protected]>,
	kernel test robot <[email protected]>,
	"Chen Rong A." <[email protected]>,
	[email protected],
	io-uring Mailing list <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>
Subject: Re: FAILED: patch "[PATCH] io_uring: Clean up a false-positive warning from GCC 9.3.0" failed to apply to 5.10-stable tree
Date: Sun, 22 Jan 2023 10:47:58 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAOG64qO=iZZO-PJjmeYO5wKHAxn3ATDyj6g=FA_tx3WNAMBvug@mail.gmail.com>

On 1/22/23 8:43 AM, Alviro Iskandar Setiawan wrote:
> On Sun, Jan 22, 2023 at 9:44 PM <[email protected]> wrote:
>> The patch below does not apply to the 5.10-stable tree.
>> If someone wants it applied there, or to any other stable or longterm
>> tree, then please email the backport, including the original git commit
>> id to <[email protected]>.
> 
> That uninitialized reading is living in 5.10.y branch now
> https://github.com/gregkh/linux/blob/v5.10.162/io_uring/io_uring.c#L4989-L5017
> 
> If this:
> 
>    ret = import_single_range(RE AD, buf, sr->len, &iov, &msg.msg_iter);
> 
> fails, this one (flags & MSG_WAITALL) may read an uninitialized
> variable because @flags is uninitialized.
> 
> Fortunately, if import_single_range() fails, (ret < min_ret) is always
> true, so this:
> 
>     ret < min_ret || ((flags & MSG_WAITALL)
> 
> will always short circuit. But no one tells the compiler if @ret is
> always less than @min_ret in that case. So it can't prove that @flags
> is never actually read. That still falls to undefined behavior anyway,
> the compiler may emit "ud2" or similar trap for that or behave
> randomly. IDK...

Now handled for both trees.

-- 
Jens Axboe



      reply	other threads:[~2023-01-22 17:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <[email protected]>
2023-01-22 15:43 ` FAILED: patch "[PATCH] io_uring: Clean up a false-positive warning from GCC 9.3.0" failed to apply to 5.10-stable tree Alviro Iskandar Setiawan
2023-01-22 17:47   ` Jens Axboe [this message]

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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