From: Deepa Dinamani <deepa.kernel@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Jeff Moyer <jmoyer@redhat.com>,
"Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Benjamin LaHaise <bcrl@kvack.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-aio <linux-aio@kvack.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Tianhong Ding <dingtianhong@huawei.com>,
Hanjun Guo <guohanjun@huawei.com>,
Libin <huawei.libin@huawei.com>,
Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH 1/1] aio: make sure the input "timeout" value is valid
Date: Mon, 26 Mar 2018 21:43:03 -0700 [thread overview]
Message-ID: <CABeXuvqk1npq6ROEyF6O-uedkM1OV-zyfeAUcj3yeS-WP6GMQg@mail.gmail.com> (raw)
In-Reply-To: <20180326215522.GA409@bombadil.infradead.org>
On Mon, Mar 26, 2018 at 2:55 PM, Matthew Wilcox <willy@infradead.org> wrote:
> On Mon, Mar 26, 2018 at 10:01:30PM +0200, Arnd Bergmann wrote:
>> I had suggested a more complete helper function at some point,
>> to take care of all combinations of checking/non-checking, 32/64
>> bit, microsecond/nanosecond, and zeroing/checking the upper 32 bits
>> of nanoseconds before comparing against 1 billion, but Deepa
>> thought that was overkill, so I didn't continue that.
>
> Yeah, that sounds like a nightmare to use ;-)
>
>> For all I can tell, the get_timespec64() helper should almost always
>> include the check, the one exception I know is utimensat() and related
>> functions that may encode the special UTIME_NOW and UTIME_OMIT
>> constants in the nanoseconds.
>
> So do you endorse the get_valid_timespec64() patch I posted up-thread?
> We can't just make get_timespec64 return an errno directly because it'll
> require changing all the users.
I missed this thread earlier.
I had leaned away from this idea before, because of the special cases
which don't need it. I was also trying to keep the syntax close to
copy_from_user(), which is what was there before.
We could probably just change all the
get_timespec64()/compat_get_timespec64() to do the check using a
simple coccinelle script.
I can own this.
But, this would not be needed if Arnd is posting the other helper function.
Arnd, let me know what you prefer here.
-Deepa
prev parent reply other threads:[~2018-03-27 4:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-13 13:42 [PATCH 1/1] aio: make sure the input "timeout" value is valid Zhen Lei
2017-12-13 14:11 ` Matthew Wilcox
2017-12-13 15:58 ` Benjamin LaHaise
2017-12-13 16:27 ` Jeff Moyer
2017-12-13 19:31 ` Matthew Wilcox
2017-12-14 3:18 ` Leizhen (ThunderTown)
2018-01-02 14:51 ` Matthew Wilcox
2018-01-12 19:49 ` Jeff Moyer
2018-03-26 20:01 ` Arnd Bergmann
2018-03-26 21:55 ` Matthew Wilcox
2018-03-27 4:43 ` Deepa Dinamani [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 \
--in-reply-to=CABeXuvqk1npq6ROEyF6O-uedkM1OV-zyfeAUcj3yeS-WP6GMQg@mail.gmail.com \
--to=deepa.kernel@gmail.com \
--cc=arnd@arndb.de \
--cc=bcrl@kvack.org \
--cc=dingtianhong@huawei.com \
--cc=guohanjun@huawei.com \
--cc=huawei.libin@huawei.com \
--cc=jmoyer@redhat.com \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thunder.leizhen@huawei.com \
--cc=viro@zeniv.linux.org.uk \
--cc=wangkefeng.wang@huawei.com \
--cc=willy@infradead.org \
/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).