[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAMEtUuzbFowGqSZYKH2Sej-4fq2kcQ7ALFR92=V1NcQ3c4y-YA@mail.gmail.com>
Date: Thu, 8 Jan 2015 09:51:32 -0800
From: Alexei Starovoitov <ast@...mgrid.com>
To: Fam Zheng <famz@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, X86 ML <x86@...nel.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
Miklos Szeredi <mszeredi@...e.cz>,
Juri Lelli <juri.lelli@...il.com>, Zach Brown <zab@...bo.net>,
David Drysdale <drysdale@...gle.com>,
Kees Cook <keescook@...omium.org>,
David Herrmann <dh.herrmann@...il.com>,
Dario Faggioli <raistlin@...ux.it>,
"Theodore Ts'o" <tytso@....edu>,
Peter Zijlstra <peterz@...radead.org>,
Vivek Goyal <vgoyal@...hat.com>,
Mike Frysinger <vapier@...too.org>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Oleg Nesterov <oleg@...hat.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Fabian Frederick <fabf@...net.be>,
Josh Triplett <josh@...htriplett.org>,
"David S. Miller" <davem@...emloft.net>,
linux-fsdevel@...r.kernel.org,
Linux API <linux-api@...r.kernel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Stefan Hajnoczi <stefanha@...hat.com>
Subject: Re: [RESEND PATCH 1/3] epoll: Extract epoll_wait_do and epoll_pwait_do
On Thu, Jan 8, 2015 at 1:16 AM, Fam Zheng <famz@...hat.com> wrote:
> + if (!timeout || (timeout->tv_nsec == 0 && timeout->tv_sec == 0)) {
..
> + } else if (timeout->tv_nsec >= 0 && timeout->tv_sec >= 0) {
the check for tv_nsec is not enough, which points
to the fragility of passing user timespec around.
I think it would be safer and cleaner to do it futex style:
if (copy_from_user(&ts, utime, sizeof(ts)) != 0)
return -EFAULT;
if (!timespec_valid(&ts))
return -EINVAL;
t = timespec_to_ktime(ts);
and then only pass ktime_t around.
> + struct timespec end_time = ep_set_mstimeout(timeout);
the name is now wrong, since it's no longer MStimeout.
I think handling of compat is missing as well.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists