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]
Message-ID: <alpine.DEB.2.21.1908240218460.1939@nanos.tec.linutronix.de>
Date:   Sat, 24 Aug 2019 02:20:40 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Andy Lutomirski <luto@...capital.net>
cc:     Sebastian Mayr <me@....st>, Ingo Molnar <mingo@...hat.com>,
        Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        LKML <linux-kernel@...r.kernel.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Andy Lutomirski <luto@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Dmitry Safonov <dsafonov@...tuozzo.com>,
        Oleg Nesterov <oleg@...hat.com>,
        Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Subject: Re: [PATCH] uprobes/x86: fix detection of 32-bit user mode

On Fri, 23 Aug 2019, Andy Lutomirski wrote:
> > On Aug 23, 2019, at 5:03 PM, Thomas Gleixner <tglx@...utronix.de> wrote:
> > 
> >> On Sat, 24 Aug 2019, Thomas Gleixner wrote:
> >> On Fri, 23 Aug 2019, Andy Lutomirski wrote:
> >>>> On Aug 23, 2019, at 4:44 PM, Thomas Gleixner <tglx@...utronix.de> wrote:
> >>>> 
> >>>>>> On Sat, 24 Aug 2019, Thomas Gleixner wrote:
> >>>>>> On Sun, 28 Jul 2019, Sebastian Mayr wrote:
> >>>>>> 
> >>>>>> -static inline int sizeof_long(void)
> >>>>>> +static inline int sizeof_long(struct pt_regs *regs)
> >>>>>> {
> >>>>>> -    return in_ia32_syscall() ? 4 : 8;
> >>>>> 
> >>>>> This wants a comment.
> >>>>> 
> >>>>>> +    return user_64bit_mode(regs) ? 8 : 4;
> >>>> 
> >>>> The more simpler one liner is to check
> >>>> 
> >>>>   test_thread_flag(TIF_IA32)
> >>> 
> >>> I still want to finish killing TIF_IA32 some day.  Let’s please not add new users.
> >> 
> >> Well, yes and no. This needs to be backported ....
> > 
> > And TBH the magic in user_64bit_mode() is not pretty either.
> > 
> It’s only magic on Xen. I should probably stick a
> cpu_feature_enabled(X86_FEATURE_XENPV) in there instead.

For backporting sake I really prefer the TIF version. One usage site more
is not the end of the world. We can add the user_64bit_mode() variant from
Sebastian on top as a cleanup right away so mainline is clean.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ