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: <CALCETrWgyLUae9w9HmXVfM0XmhUcP7fWo4H1Jx8jG7FdF7hURw@mail.gmail.com>
Date:   Tue, 28 Mar 2017 08:03:48 -0700
From:   Andy Lutomirski <luto@...nel.org>
To:     Oleg Nesterov <oleg@...hat.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Andy Lutomirski <luto@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Denys Vlasenko <dvlasenk@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
        Jan Kratochvil <jan.kratochvil@...hat.com>,
        Pedro Alves <palves@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>, X86 ML <x86@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] get_nr_restart_syscall() should return
 __NR_ia32_restart_syscall if __USER32_CS

On Tue, Mar 28, 2017 at 7:54 AM, Oleg Nesterov <oleg@...hat.com> wrote:
> get_nr_restart_syscall() checks TS_I386_REGS_POKED but this bit is only
> set if debugger is 32-bit. If a 64-bit debugger restores the registers
> of a 32-bit debugee outside of syscall exit path get_nr_restart_syscall()
> wrongly returns __NR_restart_syscall.

I had sent a patch that introduced a new syscall nr, but it's not
quite safe because it could break seccomp-using programs.  But your
patch here is also screwy.

How about we store the syscall arch to be restored in task_struct
along with restart_block?  It's not perfect, but it should be 99% of
the way there without heuristics as nasty as yours.

--Andy

P.S. __USER32_CS is the wrong check even if we used your approach.
user_64bit_regs() is much better.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ