1. 04 8月, 2011 2 次提交
  2. 02 8月, 2011 4 次提交
  3. 31 7月, 2011 1 次提交
  4. 28 7月, 2011 4 次提交
  5. 27 7月, 2011 6 次提交
  6. 26 7月, 2011 4 次提交
    • S
      kernel/configs.c: include MODULE_*() when CONFIG_IKCONFIG_PROC=n · 626a0312
      Stephen Boyd 提交于
      If CONFIG_IKCONFIG=m but CONFIG_IKCONFIG_PROC=n we get a module that has
      no MODULE_LICENSE definition.  Move the MODULE_*() definitions outside the
      CONFIG_IKCONFIG_PROC #ifdef to prevent this configuration from tainting
      the kernel.
      Signed-off-by: NStephen Boyd <bebarino@gmail.com>
      Acked-by: NRandy Dunlap <rdunlap@xenotime.net>
      Acked-by: NWANG Cong <xiyou.wangcong@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      626a0312
    • A
      notifiers: sys: move reboot notifiers into reboot.h · c5f41752
      Amerigo Wang 提交于
      It is not necessary to share the same notifier.h.
      
      This patch already moves register_reboot_notifier() and
      unregister_reboot_notifier() from kernel/notifier.c to kernel/sys.c.
      
      [amwang@redhat.com: make allyesconfig succeed on ppc64]
      Signed-off-by: NWANG Cong <amwang@redhat.com>
      Cc: David Miller <davem@davemloft.net>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NWANG Cong <amwang@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c5f41752
    • M
      devres: fix possible use after free · ae891a1b
      Maxin B John 提交于
      devres uses the pointer value as key after it's freed, which is safe but
      triggers spurious use-after-free warnings on some static analysis tools.
      Rearrange code to avoid such warnings.
      Signed-off-by: NMaxin B. John <maxin.john@gmail.com>
      Reviewed-by: NRolf Eike Beer <eike-kernel@sf-tec.de>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ae891a1b
    • B
      mm/futex: fix futex writes on archs with SW tracking of dirty & young · 2efaca92
      Benjamin Herrenschmidt 提交于
      I haven't reproduced it myself but the fail scenario is that on such
      machines (notably ARM and some embedded powerpc), if you manage to hit
      that futex path on a writable page whose dirty bit has gone from the PTE,
      you'll livelock inside the kernel from what I can tell.
      
      It will go in a loop of trying the atomic access, failing, trying gup to
      "fix it up", getting succcess from gup, go back to the atomic access,
      failing again because dirty wasn't fixed etc...
      
      So I think you essentially hang in the kernel.
      
      The scenario is probably rare'ish because affected architecture are
      embedded and tend to not swap much (if at all) so we probably rarely hit
      the case where dirty is missing or young is missing, but I think Shan has
      a piece of SW that can reliably reproduce it using a shared writable
      mapping & fork or something like that.
      
      On archs who use SW tracking of dirty & young, a page without dirty is
      effectively mapped read-only and a page without young unaccessible in the
      PTE.
      
      Additionally, some architectures might lazily flush the TLB when relaxing
      write protection (by doing only a local flush), and expect a fault to
      invalidate the stale entry if it's still present on another processor.
      
      The futex code assumes that if the "in_atomic()" access -EFAULT's, it can
      "fix it up" by causing get_user_pages() which would then be equivalent to
      taking the fault.
      
      However that isn't the case.  get_user_pages() will not call
      handle_mm_fault() in the case where the PTE seems to have the right
      permissions, regardless of the dirty and young state.  It will eventually
      update those bits ...  in the struct page, but not in the PTE.
      
      Additionally, it will not handle the lazy TLB flushing that can be
      required by some architectures in the fault case.
      
      Basically, gup is the wrong interface for the job.  The patch provides a
      more appropriate one which boils down to just calling handle_mm_fault()
      since what we are trying to do is simulate a real page fault.
      
      The futex code currently attempts to write to user memory within a
      pagefault disabled section, and if that fails, tries to fix it up using
      get_user_pages().
      
      This doesn't work on archs where the dirty and young bits are maintained
      by software, since they will gate access permission in the TLB, and will
      not be updated by gup().
      
      In addition, there's an expectation on some archs that a spurious write
      fault triggers a local TLB flush, and that is missing from the picture as
      well.
      
      I decided that adding those "features" to gup() would be too much for this
      already too complex function, and instead added a new simpler
      fixup_user_fault() which is essentially a wrapper around handle_mm_fault()
      which the futex code can call.
      
      [akpm@linux-foundation.org: coding-style fixes]
      [akpm@linux-foundation.org: fix some nits Darren saw, fiddle comment layout]
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reported-by: NShan Hai <haishan.bai@gmail.com>
      Tested-by: NShan Hai <haishan.bai@gmail.com>
      Cc: David Laight <David.Laight@ACULAB.COM>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Darren Hart <darren.hart@intel.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2efaca92
  7. 24 7月, 2011 4 次提交
  8. 22 7月, 2011 12 次提交
  9. 21 7月, 2011 3 次提交
    • O
      ptrace: fix ptrace_signal() && STOP_DEQUEUED interaction · 8a352418
      Oleg Nesterov 提交于
      Simple test-case,
      
      	int main(void)
      	{
      		int pid, status;
      
      		pid = fork();
      		if (!pid) {
      			pause();
      			assert(0);
      			return 0x23;
      		}
      
      		assert(ptrace(PTRACE_ATTACH, pid, 0,0) == 0);
      		assert(wait(&status) == pid);
      		assert(WIFSTOPPED(status) && WSTOPSIG(status) == SIGSTOP);
      
      		kill(pid, SIGCONT);	// <--- also clears STOP_DEQUEUD
      
      		assert(ptrace(PTRACE_CONT, pid, 0,0) == 0);
      		assert(wait(&status) == pid);
      		assert(WIFSTOPPED(status) && WSTOPSIG(status) == SIGCONT);
      
      		assert(ptrace(PTRACE_CONT, pid, 0, SIGSTOP) == 0);
      		assert(wait(&status) == pid);
      		assert(WIFSTOPPED(status) && WSTOPSIG(status) == SIGSTOP);
      
      		kill(pid, SIGKILL);
      		return 0;
      	}
      
      Without the patch it hangs. After the patch SIGSTOP "injected" by the
      tracer is not ignored and stops the tracee.
      
      Note also that if this test-case uses, say, SIGWINCH instead of SIGCONT,
      everything works without the patch. This can't be right, and this is
      confusing.
      
      The problem is that SIGSTOP (or any other sig_kernel_stop() signal) has
      no effect without JOBCTL_STOP_DEQUEUED. This means it is simply ignored
      after PTRACE_CONT unless JOBCTL_STOP_DEQUEUED was set "by accident", say
      it wasn't cleared after initial SIGSTOP sent by PTRACE_ATTACH.
      
      At first glance we could change ptrace_signal() to add STOP_DEQUEUED
      after return from ptrace_stop(), but this is not right in case when the
      tracer does not change the reported SIGSTOP and SIGCONT comes in between.
      This is even more wrong with PT_SEIZED, SIGCONT adds JOBCTL_TRAP_NOTIFY
      which will be "lost" during the TRAP_STOP | TRAP_NOTIFY report.
      
      So lets add STOP_DEQUEUED _before_ we report the signal. It has no effect
      unless sig_kernel_stop() == T after the tracer resumes us, and in the
      latter case the pending STOP_DEQUEUED means no SIGCONT in between, we
      should stop.
      
      Note also that if SIGCONT was sent, PT_SEIZED tracee will correctly
      report PTRACE_EVENT_STOP/SIGTRAP and thus the tracer can notice the fact
      SIGSTOP was cancelled.
      
      Also, move the current->ptrace check from ptrace_signal() to its caller,
      get_signal_to_deliver(), this looks more natural.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      8a352418
    • C
      rw_semaphore: remove up/down_read_non_owner · 11b80f45
      Christoph Hellwig 提交于
      Now that the last users is gone these can be removed.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      11b80f45
    • J
      time: Fix stupid KERN_WARN compile issue · cbaa5152
      John Stultz 提交于
      Terribly embarassing. Don't know how I committed this, but its
      KERN_WARNING not KERN_WARN.
      
      This fixes the following compile error:
      kernel/time/timekeeping.c: In function ‘__timekeeping_inject_sleeptime’:
      kernel/time/timekeeping.c:608: error: ‘KERN_WARN’ undeclared (first use in this function)
      kernel/time/timekeeping.c:608: error: (Each undeclared identifier is reported only once
      kernel/time/timekeeping.c:608: error: for each function it appears in.)
      kernel/time/timekeeping.c:608: error: expected ‘)’ before string constant
      make[2]: *** [kernel/time/timekeeping.o] Error 1
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      cbaa5152