linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miroslav Lichvar <mlichvar@redhat.com>
To: John Stultz <john.stultz@linaro.org>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	lkml <linux-kernel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Michael Kerrisk <mtk@man7.org>,
	Arnd Bergmann <arnd.bergmann@linaro.org>
Subject: Re: [RESEND PATCH] timerfd: Allow TFD_TIMER_CANCEL_ON_SET with relative timeouts
Date: Tue, 20 Oct 2015 09:36:13 +0200	[thread overview]
Message-ID: <20151020073613.GB18882@localhost> (raw)
In-Reply-To: <CALAqxLVS+NBpz63d3bkQO5yv9gebuotjBdimb2o8X1KitSEqHA@mail.gmail.com>

On Mon, Oct 19, 2015 at 11:53:25AM -0700, John Stultz wrote:
> On Fri, Oct 9, 2015 at 1:25 AM, Jesper Nilsson <jesper.nilsson@axis.com> wrote:
> > Of course, the proposed patch only allows the setting of relative
> > timeouts with TFD_TIMER_CANCEL_ON_SET, any application using
> > it would also need to be patched to use the relative timer
> > for this solve the described problem.
> 
> So is this not more of a workaround? Basically just allows
> applications on systems that can't handle y2038 to be able to use
> different interfaces to maybe allow the system to crawl onward to the
> next problem?

Right, any absolute timer set on the system time is a problem when it
overflows.

> Miroslav had a patch recently to try to keep 32bit systems from
> getting into a week near y2038 to try to stave off some of these ugly
> problems. While I'm not totally against such patches (Miroslav's
> concern of a DoS vector is reasonable), I also want to avoid giving
> folks a false sense of confidence that the problems are resolved.

Not all of the problems can be resolved, but current time overflowing
32-bit time_t can be prevented in the kernel, reliably.

Applications using 32-bit time_t shouldn't be expected to handle a
case when it's not really Oct 20 2015, but rather Nov 26 2151, should
they?

That would be like implicitly opening files with O_LARGEFILE, even for
applications not compiled with 64-bit off_t. The difference to the
large file support is that there is only one file (the system time)
and it's shared between all applications.

I think as long as there is anything with 32-bit time_t running on the
machine, the system time must not be allowed to overflow. If you don't
like the idea of stepping the clock back one week sooner to prevent
also time_t overflowing in majority of the user-space code, it could
be moved closer to the actual overflow. I don't see the benefit
though.

Similar applies to KTIME_MAX and the kernel code.

-- 
Miroslav Lichvar

  reply	other threads:[~2015-10-20  7:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09  8:25 [RESEND PATCH] timerfd: Allow TFD_TIMER_CANCEL_ON_SET with relative timeouts Jesper Nilsson
2015-10-19 18:53 ` John Stultz
2015-10-20  7:36   ` Miroslav Lichvar [this message]
2015-10-20  8:18   ` Arnd Bergmann
2015-10-20  8:59     ` Jesper Nilsson
2015-10-20 11:07       ` 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=20151020073613.GB18882@localhost \
    --to=mlichvar@redhat.com \
    --cc=arnd.bergmann@linaro.org \
    --cc=jesper.nilsson@axis.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk@man7.org \
    --cc=tglx@linutronix.de \
    --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 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).