lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 14 Nov 2019 11:51:15 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     y2038 Mailman List <y2038@...ts.linaro.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ingo Molnar <mingo@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Anna-Maria Gleixner <anna-maria@...utronix.de>,
        Frederic Weisbecker <frederic@...nel.org>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH 21/23] y2038: itimer: change implementation to timespec64

On Wed, Nov 13, 2019 at 11:28 PM Thomas Gleixner <tglx@...utronix.de> wrote:
> On Fri, 8 Nov 2019, Arnd Bergmann wrote:
> > @@ -321,12 +321,12 @@ TRACE_EVENT(itimer_state,
> >               __entry->which          = which;
> >               __entry->expires        = expires;
> >               __entry->value_sec      = value->it_value.tv_sec;
> > -             __entry->value_usec     = value->it_value.tv_usec;
> > +             __entry->value_usec     = value->it_value.tv_nsec / NSEC_PER_USEC;
> >               __entry->interval_sec   = value->it_interval.tv_sec;
> > -             __entry->interval_usec  = value->it_interval.tv_usec;
> > +             __entry->interval_usec  = value->it_interval.tv_nsec / NSEC_PER_USEC;
>
> Hmm, having a division in a tracepoint is clearly suboptimal.

Ok, moving it to the TP_printk() as Steven suggested.

> > -     TP_printk("which=%d expires=%llu it_value=%ld.%ld it_interval=%ld.%ld",
> > +     TP_printk("which=%d expires=%llu it_value=%ld.%06ld it_interval=%ld.%06ld",
>
> We print only 6 digits after the . so that would be even correct w/o a
> division. But it probably does not matter much.

This is just a cosmetic fix, it can be a separate patch if you care. The idea
is to print the numbers as normal decimal representation, e.g. 0.001000
for a millisecond instead of the nonstandard 0.1000.

> > @@ -197,19 +207,13 @@ static void set_cpu_itimer(struct task_struct *tsk, unsigned int clock_id,
> >  #define timeval_valid(t) \
> >       (((t)->tv_sec >= 0) && (((unsigned long) (t)->tv_usec) < USEC_PER_SEC))
>
> Hrm, why do we have yet another incarnation of timeval_valid()?

No idea, you have to ask the author of commit 7d99b7d634d8 ("[PATCH]
Validate and
sanitze itimer timeval from userspace") ;-)

> Can we please have only one (the inline version)?

I'm removing the inline version in a later patch along with most of the rest of
include/linux/time32.h.

Having the macro version is convenient for this patch, since I'm using it
on two different structures (itimerval/__kernel_old_timeval and
old_itimerval32/old_timeval32), neither of which is the type used in the
inline function.

I could use two local inline functions instead of the macro, or just open
code both call sites if you prefer that.

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ