From: Borislav Petkov <bp@alien8.de>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "linux-tip-commits@vger.kernel.org"
<linux-tip-commits@vger.kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Lutomirski <luto@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Brian Gerst <brgerst@gmail.com>, Ingo Molnar <mingo@kernel.org>,
Denys Vlasenko <dvlasenk@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [tip:x86/asm] x86/entry/32: Switch INT80 to the new C syscall path
Date: Fri, 16 Oct 2015 12:52:29 +0200 [thread overview]
Message-ID: <20151016105229.GF31612@pd.tnic> (raw)
In-Reply-To: <CALCETrUojEsfNPfNcFFqPJFgJHPbHPXASUy+0vwBfoA1ie_GQA@mail.gmail.com>
On Thu, Oct 15, 2015 at 12:09:16PM -0700, Andy Lutomirski wrote:
> On Thu, Oct 15, 2015 at 11:09 AM, Borislav Petkov <bp@alien8.de> wrote:
> > On Fri, Oct 09, 2015 at 06:12:44AM -0700, tip-bot for Andy Lutomirski wrote:
> >> Commit-ID: 150ac78d63afb96360dab448b7b4d33c98c8266c
> >> Gitweb: http://git.kernel.org/tip/150ac78d63afb96360dab448b7b4d33c98c8266c
> >> Author: Andy Lutomirski <luto@kernel.org>
> >> AuthorDate: Mon, 5 Oct 2015 17:48:14 -0700
> >> Committer: Ingo Molnar <mingo@kernel.org>
> >> CommitDate: Fri, 9 Oct 2015 09:41:10 +0200
> >>
> >> x86/entry/32: Switch INT80 to the new C syscall path
> >>
> >> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> >> Cc: Andy Lutomirski <luto@amacapital.net>
> >> Cc: Borislav Petkov <bp@alien8.de>
> >> Cc: Brian Gerst <brgerst@gmail.com>
> >> Cc: Denys Vlasenko <dvlasenk@redhat.com>
> >> Cc: H. Peter Anvin <hpa@zytor.com>
> >> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> >> Cc: Peter Zijlstra <peterz@infradead.org>
> >> Cc: Thomas Gleixner <tglx@linutronix.de>
> >> Cc: linux-kernel@vger.kernel.org
> >> Link: http://lkml.kernel.org/r/a7e8d8df96838eae3208dd0441023f3ce7a81831.1444091585.git.luto@kernel.org
> >> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> >> ---
> >> arch/x86/entry/entry_32.S | 34 +++++++++++++---------------------
> >> 1 file changed, 13 insertions(+), 21 deletions(-)
> >
> > Just triggered this here on rc5+tip/master, 32-bit. Any ideas?
> >
> > ------------[ cut here ]------------
> > WARNING: CPU: 1 PID: 1 at /mnt/kernel/kernel/linux-2.6/kernel/locking/lockdep.c:2639 trace_hardirqs_off_caller+0xef/0x150()
> > DEBUG_LOCKS_WARN_ON(!irqs_disabled())
> > Modules linked in:
> >
> > CPU: 1 PID: 1 Comm: init Tainted: G W 4.3.0-rc5+ #1
> > Hardware name: LENOVO 30515QG/30515QG, BIOS 8RET30WW (1.12 ) 09/15/2011
> > 00000000 00000000 f44fbf34 c1301072 f44fbf74 f44fbf64 c105658d c1819094
> > f44fbf90 00000001 c181f838 00000a4f c10a284f c10a284f f4520000 c1662048
> > 00000009 f44fbf7c c10565f3 00000009 f44fbf74 c1819094 f44fbf90 f44fbf9c
> > Call Trace:
> > [<c1301072>] dump_stack+0x4b/0x79
> > [<c105658d>] warn_slowpath_common+0x8d/0xc0
> > [<c10a284f>] ? trace_hardirqs_off_caller+0xef/0x150
> > [<c10a284f>] ? trace_hardirqs_off_caller+0xef/0x150
> > [<c1662048>] ? entry_INT80_32+0x28/0x2f
>
> Can you turn that entry_INT80_32 address into either a line number of
> some assembly code? I'm not seeing the code path that could do this,
> and there are two unlikely choices.
Why, that's the TRACE_IRQS_OFF at the end of entry_INT80_32. It calls
trace_hardirqs_off_caller through the thunk. That's pretty obvious. Or
am I misunderstanding you?
c1662020 <entry_INT80_32>:
c1662020: 90 nop
c1662021: 90 nop
c1662022: 90 nop
c1662023: 50 push %eax
c1662024: fc cld
c1662025: 6a 00 push $0x0
c1662027: 0f a0 push %fs
c1662029: 06 push %es
c166202a: 1e push %ds
c166202b: 6a da push $0xffffffda
c166202d: 55 push %ebp
c166202e: 57 push %edi
c166202f: 56 push %esi
c1662030: 52 push %edx
c1662031: 51 push %ecx
c1662032: 53 push %ebx
c1662033: ba 7b 00 00 00 mov $0x7b,%edx
c1662038: 8e da mov %edx,%ds
c166203a: 8e c2 mov %edx,%es
c166203c: ba d8 00 00 00 mov $0xd8,%edx
c1662041: 8e e2 mov %edx,%fs
c1662043: e8 c8 ee 99 ff call c1000f10 <trace_hardirqs_off_thunk>
c1662048: 89 e0 mov %esp,%eax
c166204a: e8 61 f9 99 ff call c10019b0 <do_int80_syscall_32>
/*
* User mode is traced as though IRQs are on, and the interrupt gate
* turned them off.
*/
TRACE_IRQS_OFF
Sounds like the gate didn't disable IRQs, right? Or did the
irqs_disabled() check get tricked into looking at the wrong flags...?
But I don't see it. Hmmm..
> Based on the warning that triggered, I assume you have
> CONFIG_PROVE_LOCKING=y,
yes.
> which means that the obvious failures that would have blown up like
> this should also have warned earlier.
If you mean, earlier in the boot, the only splat before that one is (see
the "not tainted").
[ 2.703038] NX-protecting the kernel data: 5740k
[ 2.703822] ------------[ cut here ]------------
[ 2.703973] WARNING: CPU: 0 PID: 1 at /mnt/kernel/kernel/linux-2.6/arch/x86/mm/dump_pagetables.c:225 note_page+0x63e/0x800()
[ 2.704177] x86/mm: Found insecure W+X mapping at address c00a0000/0xc00a0000
[ 2.704324] Modules linked in:
[ 2.704461] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.3.0-rc5+ #1
...
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
next prev parent reply other threads:[~2015-10-16 10:52 UTC|newest]
Thread overview: 124+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 0:47 [PATCH v2 00/36] x86: Rewrite all syscall entries except native 64-bit Andy Lutomirski
2015-10-06 0:47 ` [PATCH v2 01/36] x86/uaccess: Tell the compiler that uaccess is unlikely to fault Andy Lutomirski
2015-10-07 16:15 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:47 ` [PATCH v2 02/36] x86/uaccess: __chk_range_not_ok is unlikely to return true Andy Lutomirski
2015-10-07 10:59 ` Borislav Petkov
2015-10-07 16:23 ` Ingo Molnar
2015-10-07 16:16 ` [tip:x86/asm] x86/uaccess: Add unlikely() to __chk_range_not_ok() failure paths tip-bot for Andy Lutomirski
2015-10-06 0:47 ` [PATCH v2 03/36] selftests/x86: Add a test for vDSO unwinding Andy Lutomirski
2015-10-07 16:16 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:47 ` [PATCH v2 04/36] selftests/x86: Add a test for syscall restart and arg modification Andy Lutomirski
2015-10-07 16:17 ` [tip:x86/asm] selftests/x86: Add a test for ptrace " tip-bot for Andy Lutomirski
2015-10-06 0:47 ` [PATCH v2 05/36] x86/entry/64/compat: Fix SYSENTER's NT flag before user memory access Andy Lutomirski
2015-10-07 11:10 ` Borislav Petkov
2015-10-07 14:33 ` Brian Gerst
2015-10-07 15:05 ` Borislav Petkov
2015-10-09 17:08 ` [PATCH] x86/entry/64/compat: Document sysenter_fix_flags's reason for existence Borislav Petkov
2015-10-09 19:06 ` Andy Lutomirski
2015-10-11 9:09 ` [tip:x86/asm] x86/entry/64/compat: Document sysenter_fix_flags' s " tip-bot for Borislav Petkov
2015-10-07 16:17 ` [tip:x86/asm] x86/entry/64/compat: Fix SYSENTER' s NT flag before user memory access tip-bot for Andy Lutomirski
2015-10-06 0:47 ` [PATCH v2 06/36] x86/entry: Move lockdep_sys_exit to prepare_exit_to_usermode Andy Lutomirski
2015-10-07 16:17 ` [tip:x86/asm] x86/entry, locking/lockdep: Move lockdep_sys_exit() to prepare_exit_to_usermode() tip-bot for Andy Lutomirski
2015-10-08 8:59 ` Peter Zijlstra
2015-10-09 19:34 ` Andy Lutomirski
2015-10-06 0:47 ` [PATCH v2 07/36] x86/entry/64/compat: After SYSENTER, move STI after the NT fixup Andy Lutomirski
2015-10-07 16:18 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-07 17:39 ` [PATCH v2 07/36] " Denys Vlasenko
2015-10-07 19:02 ` Andy Lutomirski
2015-10-09 19:48 ` Andy Lutomirski
2015-10-12 17:48 ` Denys Vlasenko
2015-10-12 18:11 ` Brian Gerst
2015-10-06 0:47 ` [PATCH v2 08/36] x86/vdso: Remove runtime 32-bit vDSO selection Andy Lutomirski
2015-10-07 16:18 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-07 17:00 ` Brian Gerst
2015-10-06 0:47 ` [PATCH v2 09/36] x86/asm: Re-add manual CFI infrastructure Andy Lutomirski
2015-10-06 8:23 ` Ingo Molnar
2015-10-06 18:21 ` Andy Lutomirski
2015-10-08 13:11 ` Borislav Petkov
2015-10-08 14:14 ` Ingo Molnar
2015-10-09 13:06 ` [tip:x86/asm] x86/asm: Re-add parts of the " tip-bot for Andy Lutomirski
2015-10-06 0:47 ` [PATCH v2 10/36] x86/vdso: Define BUILD_VDSO while building and emit .eh_frame in asm Andy Lutomirski
2015-10-09 7:21 ` Ingo Molnar
2015-10-09 13:07 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:47 ` [PATCH v2 11/36] x86/vdso: Replace hex int80 CFI annotations with gas directives Andy Lutomirski
2015-10-09 13:07 ` [tip:x86/asm] x86/vdso: Replace hex int80 CFI annotations with GAS directives tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 12/36] x86/elf/64: Clear more registers in elf_common_init Andy Lutomirski
2015-10-09 13:08 ` [tip:x86/asm] x86/elf/64: Clear more registers in elf_common_init () tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 13/36] x86/vdso/32: Save extra registers in the INT80 vsyscall path Andy Lutomirski
2015-10-09 13:08 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 14/36] x86/entry/64/compat: Disable SYSENTER and SYSCALL32 entries Andy Lutomirski
2015-10-08 15:41 ` Borislav Petkov
2015-10-09 19:11 ` Andy Lutomirski
2015-10-09 13:08 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 15/36] x86/entry/64/compat: Remove audit optimizations Andy Lutomirski
2015-10-09 13:09 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 16/36] x86/entry/64/compat: Remove most of the fast system call machinery Andy Lutomirski
2015-10-09 13:09 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 17/36] x86/entry/64/compat: Set up full pt_regs for all compat syscalls Andy Lutomirski
2015-10-09 13:09 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 18/36] x86/entry/syscalls: Move syscall table declarations into asm/syscalls.h Andy Lutomirski
2015-10-09 13:10 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 19/36] x86/syscalls: Give sys_call_ptr_t a useful type Andy Lutomirski
2015-10-09 13:10 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 20/36] x86/entry: Add do_syscall_32, a C function to do 32-bit syscalls Andy Lutomirski
2015-10-09 13:10 ` [tip:x86/asm] x86/entry: Add do_syscall_32(), " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 21/36] x86/entry/64/compat: Migrate the body of the syscall entry to C Andy Lutomirski
2015-10-09 13:11 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 22/36] x86/entry: Add C code for fast system call entries Andy Lutomirski
2015-10-06 8:25 ` Linus Torvalds
2015-10-06 8:29 ` Linus Torvalds
2015-10-06 18:25 ` Andy Lutomirski
2015-10-09 13:11 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 23/36] x86/vdso/compat: Wire up SYSENTER and SYSCSALL for compat userspace Andy Lutomirski
2015-10-09 13:11 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 24/36] x86/entry/compat: Implement opportunistic SYSRETL for compat syscalls Andy Lutomirski
2015-10-09 13:12 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-12 16:15 ` [PATCH v2 24/36] " Borislav Petkov
2015-10-14 16:25 ` Andy Lutomirski
2015-10-14 16:31 ` Borislav Petkov
2015-10-06 0:48 ` [PATCH v2 25/36] x86/entry/32: Open-code return tracking from fork and kthreads Andy Lutomirski
2015-10-09 13:12 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 26/36] x86/entry/32: Switch INT80 to the new C syscall path Andy Lutomirski
2015-10-09 13:12 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-15 18:09 ` Borislav Petkov
2015-10-15 19:09 ` Andy Lutomirski
2015-10-16 10:52 ` Borislav Petkov [this message]
[not found] ` <20151016140502.GG31612@pd.tnic>
2015-10-16 15:57 ` Andy Lutomirski
2015-10-16 17:14 ` Borislav Petkov
2015-10-16 15:59 ` Andy Lutomirski
2015-10-16 17:34 ` Borislav Petkov
2015-10-16 18:22 ` Brian Gerst
2015-10-16 18:32 ` Andy Lutomirski
2015-10-16 19:36 ` Brian Gerst
2015-10-06 0:48 ` [PATCH v2 27/36] x86/entry/32: Re-implement SYSENTER using the new C path Andy Lutomirski
2015-10-07 18:08 ` Denys Vlasenko
2015-10-07 19:06 ` Andy Lutomirski
2015-10-09 13:13 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 28/36] x86/asm: Remove thread_info.sysenter_return Andy Lutomirski
2015-10-09 13:13 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 29/36] x86/entry: Remove unnecessary IRQ twiddling in fast 32-bit syscalls Andy Lutomirski
2015-10-09 13:13 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 30/36] x86/entry: Make irqs_disabled checks in exit code depend on lockdep Andy Lutomirski
2015-10-09 13:14 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 31/36] x86/entry: Force inlining of 32-bit syscall code Andy Lutomirski
2015-10-09 13:14 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 32/36] x86/entry: Micro-optimize compat fast syscall arg fetch Andy Lutomirski
2015-10-09 7:32 ` Ingo Molnar
2015-10-09 19:28 ` Andy Lutomirski
2015-10-10 9:05 ` Ingo Molnar
2015-10-09 13:14 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 33/36] x86/entry: Hide two syscall entry assertions behind CONFIG_DEBUG_ENTRY Andy Lutomirski
2015-10-09 13:15 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 34/36] x86/entry: Use pt_regs_to_thread_info() in syscall entry tracing Andy Lutomirski
2015-10-09 13:15 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 35/36] x86/entry: Split and inline prepare_exit_to_usermode Andy Lutomirski
2015-10-09 13:15 ` [tip:x86/asm] x86/entry: Split and inline prepare_exit_to_usermode() tip-bot for Andy Lutomirski
2015-10-06 0:48 ` [PATCH v2 36/36] x86/entry: Split and inline syscall_return_slowpath Andy Lutomirski
2015-10-09 13:16 ` [tip:x86/asm] x86/entry: Split and inline syscall_return_slowpath () tip-bot for Andy Lutomirski
2015-10-06 8:39 ` [PATCH v2 00/36] x86: Rewrite all syscall entries except native 64-bit Linus Torvalds
2015-10-06 8:49 ` Ingo Molnar
2015-10-06 18:26 ` Andy Lutomirski
2015-10-09 13:06 ` Ingo Molnar
2015-10-12 18:30 ` Richard Weinberger
2015-10-12 18:41 ` Andy Lutomirski
2015-10-12 21:02 ` Richard Weinberger
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=20151016105229.GF31612@pd.tnic \
--to=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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
Powered by JetHome