]> Git Repo - linux.git/commitdiff
Merge branch 'parisc-3.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
authorLinus Torvalds <[email protected]>
Tue, 20 May 2014 05:35:28 +0000 (14:35 +0900)
committerLinus Torvalds <[email protected]>
Tue, 20 May 2014 05:35:28 +0000 (14:35 +0900)
Pull parisc fixes from Helge Deller:
 "There are two patches in here:

  The first patch greatly improves latency and corrects the memory
  ordering in our light-weight atomic locking syscall.

  The second patch ratelimits printing of userspace segfaults in the
  same way as it's done on other platforms.  This fixes a possible DOS
  on parisc since it prevents the syslog to grow too fast.  For example,
  when the debian acl2 package was built on our debian buildd servers,
  this package produced lots of gigabytes in syslog in very short time
  and thus filled our harddisks, which then turned the server nearly
  completely unaccessible and unresponsive"

* 'parisc-3.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: Improve LWS-CAS performance
  parisc: ratelimit userspace segfault printing

1  2 
arch/parisc/Kconfig
arch/parisc/mm/fault.c

diff --combined arch/parisc/Kconfig
index 1faefed32749c93ff31a7d6237732d3dd6c55f26,a8f4a70c07427f70e0bb8a0ffdfe3212382ecc46..108d48e652af4c802da1676b18252a5394d30295
@@@ -22,13 -22,13 +22,14 @@@ config PARIS
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_STRNCPY_FROM_USER
        select SYSCTL_ARCH_UNALIGN_ALLOW
+       select SYSCTL_EXCEPTION_TRACE
        select HAVE_MOD_ARCH_SPECIFIC
        select VIRT_TO_BUS
        select MODULES_USE_ELF_RELA
        select CLONE_BACKWARDS
        select TTY # Needed for pdc_cons.c
        select HAVE_DEBUG_STACKOVERFLOW
 +      select HAVE_ARCH_AUDITSYSCALL
  
        help
          The PA-RISC microprocessor is designed by Hewlett-Packard and used
diff --combined arch/parisc/mm/fault.c
index 747550762f3ca25acf6dabdfcc7d8aef9de31779,d72197f0ddb863999f1bfb62a2a81c6d60038445..3ca9c1131cfe0d80b9b12fb5c0e599a3363942c0
  #include <asm/uaccess.h>
  #include <asm/traps.h>
  
- #define PRINT_USER_FAULTS /* (turn this on if you want user faults to be */
-                        /*  dumped to the console via printk)          */
  /* Various important other fields */
  #define bit22set(x)           (x & 0x00000200)
  #define bits23_25set(x)               (x & 0x000001c0)
@@@ -34,6 -30,8 +30,8 @@@
  
  DEFINE_PER_CPU(struct exception_data, exception_data);
  
+ int show_unhandled_signals = 1;
  /*
   * parisc_acctyp(unsigned int inst) --
   *    Given a PA-RISC memory access instruction, determine if the
@@@ -151,7 -149,7 +149,7 @@@ int fixup_exception(struct pt_regs *reg
        fix = search_exception_tables(regs->iaoq[0]);
        if (fix) {
                struct exception_data *d;
 -              d = &__get_cpu_var(exception_data);
 +              d = this_cpu_ptr(&exception_data);
                d->fault_ip = regs->iaoq[0];
                d->fault_space = regs->isr;
                d->fault_addr = regs->ior;
        return 0;
  }
  
+ /*
+  * Print out info about fatal segfaults, if the show_unhandled_signals
+  * sysctl is set:
+  */
+ static inline void
+ show_signal_msg(struct pt_regs *regs, unsigned long code,
+               unsigned long address, struct task_struct *tsk,
+               struct vm_area_struct *vma)
+ {
+       if (!unhandled_signal(tsk, SIGSEGV))
+               return;
+       if (!printk_ratelimit())
+               return;
+       pr_warn("\n");
+       pr_warn("do_page_fault() command='%s' type=%lu address=0x%08lx",
+           tsk->comm, code, address);
+       print_vma_addr(KERN_CONT " in ", regs->iaoq[0]);
+       if (vma)
+               pr_warn(" vm_start = 0x%08lx, vm_end = 0x%08lx\n",
+                               vma->vm_start, vma->vm_end);
+       show_regs(regs);
+ }
  void do_page_fault(struct pt_regs *regs, unsigned long code,
                              unsigned long address)
  {
@@@ -270,16 -294,8 +294,8 @@@ bad_area
        if (user_mode(regs)) {
                struct siginfo si;
  
- #ifdef PRINT_USER_FAULTS
-               printk(KERN_DEBUG "\n");
-               printk(KERN_DEBUG "do_page_fault() pid=%d command='%s' type=%lu address=0x%08lx\n",
-                   task_pid_nr(tsk), tsk->comm, code, address);
-               if (vma) {
-                       printk(KERN_DEBUG "vm_start = 0x%08lx, vm_end = 0x%08lx\n",
-                                       vma->vm_start, vma->vm_end);
-               }
-               show_regs(regs);
- #endif
+               show_signal_msg(regs, code, address, tsk, vma);
                switch (code) {
                case 15:        /* Data TLB miss fault/Data page fault */
                        /* send SIGSEGV when outside of vma */
This page took 0.056666 seconds and 4 git commands to generate.