From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Colin King <colin.king@canonical.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] io_uring: ensure variable ret is initialized to zero
Date: Thu, 26 Sep 2019 11:33:29 +0000 [thread overview]
Message-ID: <20190926113329.GE27389@kadam> (raw)
In-Reply-To: <3aa821ea-3041-fb56-2458-ec643963c511@kernel.dk>
On Thu, Sep 26, 2019 at 11:56:30AM +0200, Jens Axboe wrote:
> On 9/26/19 11:50 AM, Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > In the case where sig is NULL the error variable ret is not initialized
> > and may contain a garbage value on the final checks to see if ret is
> > -ERESTARTSYS. Best to initialize ret to zero before the do loop to
> > ensure the ret does not accidentially contain -ERESTARTSYS before the
> > loop.
>
> Oops, weird it didn't complain. I've folded in this fix, as that commit
> isn't upstream yet. Thanks!
There is a bug in GCC where at certain optimization levels, instead of
complaining, it initializes it to zero.
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Colin King <colin.king@canonical.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] io_uring: ensure variable ret is initialized to zero
Date: Thu, 26 Sep 2019 14:33:29 +0300 [thread overview]
Message-ID: <20190926113329.GE27389@kadam> (raw)
In-Reply-To: <3aa821ea-3041-fb56-2458-ec643963c511@kernel.dk>
On Thu, Sep 26, 2019 at 11:56:30AM +0200, Jens Axboe wrote:
> On 9/26/19 11:50 AM, Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > In the case where sig is NULL the error variable ret is not initialized
> > and may contain a garbage value on the final checks to see if ret is
> > -ERESTARTSYS. Best to initialize ret to zero before the do loop to
> > ensure the ret does not accidentially contain -ERESTARTSYS before the
> > loop.
>
> Oops, weird it didn't complain. I've folded in this fix, as that commit
> isn't upstream yet. Thanks!
There is a bug in GCC where at certain optimization levels, instead of
complaining, it initializes it to zero.
regards,
dan carpenter
next prev parent reply other threads:[~2019-09-26 11:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-26 9:50 [PATCH][next] io_uring: ensure variable ret is initialized to zero Colin King
2019-09-26 9:50 ` Colin King
2019-09-26 9:56 ` Jens Axboe
2019-09-26 9:56 ` Jens Axboe
2019-09-26 11:33 ` Dan Carpenter [this message]
2019-09-26 11:33 ` Dan Carpenter
2019-09-26 11:42 ` Jens Axboe
2019-09-26 11:42 ` Jens Axboe
2019-09-26 12:14 ` Rasmus Villemoes
2019-09-26 12:14 ` Rasmus Villemoes
2019-09-26 12:26 ` Jens Axboe
2019-09-26 12:26 ` Jens Axboe
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=20190926113329.GE27389@kadam \
--to=dan.carpenter@oracle.com \
--cc=axboe@kernel.dk \
--cc=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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.