Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1631223

Re: [PATCH v7 1/4] syscalls: Restore address limit after a syscall

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v7 1/4] syscalls: Restore address limit after a syscall
Date 2017-04-26 10:20 +0200
Message-ID <tAql3-84y-1@gated-at.bofh.it> (permalink)
References <tuL8T-3IQ-35@gated-at.bofh.it> <tA2iL-148-33@gated-at.bofh.it> <tA9tT-5Lr-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Thomas Garnier <thgarnie@google.com> wrote:

> >> +#ifdef CONFIG_ARCH_NO_SYSCALL_VERIFY_PRE_USERMODE_STATE
> >> +/*
> >> + * This function is called when an architecture specific implementation detected
> >> + * an invalid address limit. The generic user-mode state checker will finish on
> >> + * the appropriate BUG_ON.
> >> + */
> >> +asmlinkage void address_limit_check_failed(void)
> >> +{
> >> +     verify_pre_usermode_state();
> >> +     panic("address_limit_check_failed called with a valid user-mode state");
> >
> > It's very unconstructive to unconditionally panic the system, just because some
> > kernel code leaked the address limit! Do a warn-once printout and kill the current
> > task (i.e. don't continue execution), but don't crash everything else!
> 
> The original change did not crash the kernel for this exact reason.
> Through reviews, there was an overall agreement that the kernel should
> not continue in this state.

Ok, I guess we can try that - but the panic message is still pretty misleading:

	panic("address_limit_check_failed called with a valid user-mode state");

... so it was called with a _valid_ user-mode state, and we crash due to something 
valid? Huh?

( Also, the style rule applies to kernel messages as well: function names should 
  be referred to as "function_name()". )

Thanks,

	Ingo

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v7 1/4] syscalls: Restore address limit after a syscall Ingo Molnar <mingo@kernel.org> - 2017-04-25 08:40 +0200
  Re: [PATCH v7 1/4] syscalls: Restore address limit after a syscall Thomas Garnier <thgarnie@google.com> - 2017-04-25 16:20 +0200
    Re: [PATCH v7 1/4] syscalls: Restore address limit after a syscall Ingo Molnar <mingo@kernel.org> - 2017-04-26 10:20 +0200
      Re: [PATCH v7 1/4] syscalls: Restore address limit after a syscall Thomas Garnier <thgarnie@google.com> - 2017-04-26 16:10 +0200

csiph-web