linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org,
	john.stultz@linaro.org, nicolas.pitre@linaro.org, arnd@arndb.de,
	y2038@lists.linaro.org, linux-fsdevel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH v3 0/7] Isolate time_t data types for clock/timer syscalls
Date: Mon, 26 Jun 2017 05:13:34 +0100	[thread overview]
Message-ID: <20170626041334.GZ10672@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20170626023525.GY10672@ZenIV.linux.org.uk>

On Mon, Jun 26, 2017 at 03:35:25AM +0100, Al Viro wrote:
> On Sat, Jun 24, 2017 at 11:45:01AM -0700, Deepa Dinamani wrote:
> > The series aims at isolating data conversions of time_t based structures:
> > struct timespec and struct itimerspec at user space boundaries.
> > This helps to later change the underlying types to handle y2038 changes
> > to these.
> 
> Nice...  A few questions:
> 
> * what about setitimer(2)?  Right now that's the only remaining user of
> get_compat_itimerval(); similar for getitimer(2) and put_compat_itimerval().
> 
> * you have two callers of get_compat_itimerspec64(); one is followed by
> itimerspec64_valid(), another - by its open-coded analogue.  The same
> goes for get_itimerspec64(); wouldn't it be better to have both check
> the validity immediately and simply fail with -EINVAL?  Matter of taste,
> but...
> 
> * should __sys_recvmmsg() switch to timespec64?

While we are at it - do we need any locking for accesses of ->sk_stamp?
	* ax25, ipx, netrom, qrtr: sock_get_timestamp() done under lock_sock().
	* bluetooth: without (and case next door in the same switch is
grabbing/dropping lock_sock, so it's not held by caller either)
	* ipv4, ipv6, packet, can: without
	* irda: without, checks for NULL sock->sk for some reason (other
cases do not, so if we ever get there with NULL ->sk, we are fucked).
Incidentally, TIOCINQ in there looks fishy - what's to prevent us from
losing CPU just as skb_peek() returns, with skb getting freed by the
time we regain it and go looking at skb->len?  Don't we need at least
to hold ->lock on queue we are peeking into?
	* rose: without, and TIOCINQ there looks similar to irda one
	* x25: without, with the same odd check for NULL sock->sk
	* atm: without, apparently.  Same unprotected skb_peek() on
TIOCINQ...
	* atalk: ditto.

  reply	other threads:[~2017-06-26  4:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-24 18:45 [PATCH v3 0/7] Isolate time_t data types for clock/timer syscalls Deepa Dinamani
2017-06-24 18:45 ` [PATCH v3 1/7] time: add get_timespec64 and put_timespec64 Deepa Dinamani
2017-06-24 18:45 ` [PATCH v3 2/7] time: introduce {get,put}_itimerspec64 Deepa Dinamani
2017-06-24 18:45 ` [PATCH v3 3/7] posix-stubs: Conditionally include COMPAT_SYS_NI defines Deepa Dinamani
2017-06-24 18:45 ` [PATCH v3 4/7] posix-timers: Use get_timepsec64() and put_timespec64() Deepa Dinamani
2017-06-24 18:45 ` [PATCH v3 5/7] nanosleep: " Deepa Dinamani
2017-06-24 18:45 ` [PATCH v3 6/7] timerfd: Use get_itimerspec64() and put_itimerspec64() Deepa Dinamani
2017-06-24 18:45 ` [PATCH v3 7/7] posix_clocks: " Deepa Dinamani
2017-06-26  2:35 ` [PATCH v3 0/7] Isolate time_t data types for clock/timer syscalls Al Viro
2017-06-26  4:13   ` Al Viro [this message]
2017-06-26 18:17   ` Deepa Dinamani
2017-06-26 20:09     ` Arnd Bergmann
2017-06-27  4:58       ` Deepa Dinamani
2017-07-03 10:23       ` Thomas Gleixner
2017-07-03 11:19         ` Arnd Bergmann

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=20170626041334.GZ10672@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=arnd@arndb.de \
    --cc=deepa.kernel@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.pitre@linaro.org \
    --cc=tglx@linutronix.de \
    --cc=y2038@lists.linaro.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).