mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: y2038@lists.linaro.org
Cc: Baolin Wang <baolin.wang@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Xunlei Pang <pang.xunlei@linaro.org>,
	linux-kernel@vger.kernel.org,
	John Stultz <john.stultz@linaro.org>,
	Heena Sirwani <heenasirwani@gmail.com>
Subject: Re: [Y2038] [PATCH v3 14/22] time:Introduce the do_sys_settimeofday64() function with timespec64 type
Date: Wed, 13 May 2015 09:55:11 +0200	[thread overview]
Message-ID: <12457722.qPr7nkVa6l@wuerfel> (raw)
In-Reply-To: <CAMz4kuKY3fu6B-36OGQKnAr-r8LcCrO-NhTDYzBdYF6JPiKyFg@mail.gmail.com>

On Wednesday 13 May 2015 10:43:25 Baolin Wang wrote:
> > > -int do_sys_settimeofday(const struct timespec *tv, const struct
> > timezone *tz)
> > > +int do_sys_settimeofday64(const struct timespec64 *tv, const struct
> > timezone *tz)
> > >  {
> > >       static int firsttime = 1;
> > >       int error = 0;
> > > +     struct timespec ts;
> > >
> > > -     if (tv && !timespec_valid(tv))
> > > +     if (tv && !timespec64_valid(tv))
> > >               return -EINVAL;
> > >
> > > -     error = security_settime(tv, tz);
> > > +     ts = timespec64_to_timespec(*tv);
> > > +     error = security_settime(&ts, tz);
> >
> > How is that 2038 safe? Not at all.
> >
> > I told you before that we fix the underlying functions before we add
> > such bogosities.
> >
> >
> Thanks for your comments, and i'll continue to repair my patch.
> But could you explain what the defects in do_sys_settimeofday64
> function? Thanks.

What Thomas meant here is that you should first fix security_settime
to take a timespec64 argument. I guess you could introduce a
security_settime64() function first, using another inline wrapper
to provide the existing security_settime() API. security_settime()
does not actually use the time argument, so this is a fairly easy
thing to do.

	Arnd

      parent reply	other threads:[~2015-05-13  7:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-11 11:19 Baolin Wang
2015-05-12 15:17 ` Thomas Gleixner
     [not found]   ` <CAMz4kuKY3fu6B-36OGQKnAr-r8LcCrO-NhTDYzBdYF6JPiKyFg@mail.gmail.com>
2015-05-13  7:55     ` Arnd Bergmann [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=12457722.qPr7nkVa6l@wuerfel \
    --to=arnd@arndb.de \
    --cc=baolin.wang@linaro.org \
    --cc=heenasirwani@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pang.xunlei@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

all inboxes | Powered by JetHome®