1. 31 8月, 2016 1 次提交
    • J
      mm/usercopy: get rid of CONFIG_DEBUG_STRICT_USER_COPY_CHECKS · 0d025d27
      Josh Poimboeuf 提交于
      There are three usercopy warnings which are currently being silenced for
      gcc 4.6 and newer:
      
      1) "copy_from_user() buffer size is too small" compile warning/error
      
         This is a static warning which happens when object size and copy size
         are both const, and copy size > object size.  I didn't see any false
         positives for this one.  So the function warning attribute seems to
         be working fine here.
      
         Note this scenario is always a bug and so I think it should be
         changed to *always* be an error, regardless of
         CONFIG_DEBUG_STRICT_USER_COPY_CHECKS.
      
      2) "copy_from_user() buffer size is not provably correct" compile warning
      
         This is another static warning which happens when I enable
         __compiletime_object_size() for new compilers (and
         CONFIG_DEBUG_STRICT_USER_COPY_CHECKS).  It happens when object size
         is const, but copy size is *not*.  In this case there's no way to
         compare the two at build time, so it gives the warning.  (Note the
         warning is a byproduct of the fact that gcc has no way of knowing
         whether the overflow function will be called, so the call isn't dead
         code and the warning attribute is activated.)
      
         So this warning seems to only indicate "this is an unusual pattern,
         maybe you should check it out" rather than "this is a bug".
      
         I get 102(!) of these warnings with allyesconfig and the
         __compiletime_object_size() gcc check removed.  I don't know if there
         are any real bugs hiding in there, but from looking at a small
         sample, I didn't see any.  According to Kees, it does sometimes find
         real bugs.  But the false positive rate seems high.
      
      3) "Buffer overflow detected" runtime warning
      
         This is a runtime warning where object size is const, and copy size >
         object size.
      
      All three warnings (both static and runtime) were completely disabled
      for gcc 4.6 with the following commit:
      
        2fb0815c ("gcc4: disable __compiletime_object_size for GCC 4.6+")
      
      That commit mistakenly assumed that the false positives were caused by a
      gcc bug in __compiletime_object_size().  But in fact,
      __compiletime_object_size() seems to be working fine.  The false
      positives were instead triggered by #2 above.  (Though I don't have an
      explanation for why the warnings supposedly only started showing up in
      gcc 4.6.)
      
      So remove warning #2 to get rid of all the false positives, and re-enable
      warnings #1 and #3 by reverting the above commit.
      
      Furthermore, since #1 is a real bug which is detected at compile time,
      upgrade it to always be an error.
      
      Having done all that, CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is no longer
      needed.
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Byungchul Park <byungchul.park@lge.com>
      Cc: Nilay Vaish <nilayvaish@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0d025d27
  2. 03 8月, 2016 1 次提交
  3. 27 7月, 2016 2 次提交
    • J
      mm/page_owner: use stackdepot to store stacktrace · f2ca0b55
      Joonsoo Kim 提交于
      Currently, we store each page's allocation stacktrace on corresponding
      page_ext structure and it requires a lot of memory.  This causes the
      problem that memory tight system doesn't work well if page_owner is
      enabled.  Moreover, even with this large memory consumption, we cannot
      get full stacktrace because we allocate memory at boot time and just
      maintain 8 stacktrace slots to balance memory consumption.  We could
      increase it to more but it would make system unusable or change system
      behaviour.
      
      To solve the problem, this patch uses stackdepot to store stacktrace.
      It obviously provides memory saving but there is a drawback that
      stackdepot could fail.
      
      stackdepot allocates memory at runtime so it could fail if system has
      not enough memory.  But, most of allocation stack are generated at very
      early time and there are much memory at this time.  So, failure would
      not happen easily.  And, one failure means that we miss just one page's
      allocation stacktrace so it would not be a big problem.  In this patch,
      when memory allocation failure happens, we store special stracktrace
      handle to the page that is failed to save stacktrace.  With it, user can
      guess memory usage properly even if failure happens.
      
      Memory saving looks as following.  (4GB memory system with page_owner)
      (before the patch -> after the patch)
      
      static allocation:
      92274688 bytes -> 25165824 bytes
      
      dynamic allocation after boot + kernel build:
      0 bytes -> 327680 bytes
      
      total:
      92274688 bytes -> 25493504 bytes
      
      72% reduction in total.
      
      Note that implementation looks complex than someone would imagine
      because there is recursion issue.  stackdepot uses page allocator and
      page_owner is called at page allocation.  Using stackdepot in page_owner
      could re-call page allcator and then page_owner.  That is a recursion.
      To detect and avoid it, whenever we obtain stacktrace, recursion is
      checked and page_owner is set to dummy information if found.  Dummy
      information means that this page is allocated for page_owner feature
      itself (such as stackdepot) and it's understandable behavior for user.
      
      [iamjoonsoo.kim@lge.com: mm-page_owner-use-stackdepot-to-store-stacktrace-v3]
        Link: http://lkml.kernel.org/r/1464230275-25791-6-git-send-email-iamjoonsoo.kim@lge.com
        Link: http://lkml.kernel.org/r/1466150259-27727-7-git-send-email-iamjoonsoo.kim@lge.com
      Link: http://lkml.kernel.org/r/1464230275-25791-6-git-send-email-iamjoonsoo.kim@lge.comSigned-off-by: NJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Hugh Dickins <hughd@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f2ca0b55
    • K
      gcc-plugins: disable under COMPILE_TEST · a519167e
      Kees Cook 提交于
      Since adding the gcc plugin development headers is required for the
      gcc plugin support, we should ease into this new kernel build dependency
      more slowly. For now, disable the gcc plugins under COMPILE_TEST so that
      all*config builds will skip it.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      a519167e
  4. 15 6月, 2016 2 次提交
  5. 08 6月, 2016 1 次提交
  6. 31 5月, 2016 1 次提交
  7. 29 5月, 2016 1 次提交
    • G
      <linux/hash.h>: Add support for architecture-specific functions · 468a9428
      George Spelvin 提交于
      This is just the infrastructure; there are no users yet.
      
      This is modelled on CONFIG_ARCH_RANDOM; a CONFIG_ symbol declares
      the existence of <asm/hash.h>.
      
      That file may define its own versions of various functions, and define
      HAVE_* symbols (no CONFIG_ prefix!) to suppress the generic ones.
      
      Included is a self-test (in lib/test_hash.c) that verifies the basics.
      It is NOT in general required that the arch-specific functions compute
      the same thing as the generic, but if a HAVE_* symbol is defined with
      the value 1, then equality is tested.
      Signed-off-by: NGeorge Spelvin <linux@sciencehorizons.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Andreas Schwab <schwab@linux-m68k.org>
      Cc: Philippe De Muyter <phdm@macq.eu>
      Cc: linux-m68k@lists.linux-m68k.org
      Cc: Alistair Francis <alistai@xilinx.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: uclinux-h8-devel@lists.sourceforge.jp
      468a9428
  8. 13 4月, 2016 1 次提交
    • N
      debugfs: prevent access to possibly dead file_operations at file open · 9fd4dcec
      Nicolai Stange 提交于
      Nothing prevents a dentry found by path lookup before a return of
      __debugfs_remove() to actually get opened after that return. Now, after
      the return of __debugfs_remove(), there are no guarantees whatsoever
      regarding the memory the corresponding inode's file_operations object
      had been kept in.
      
      Since __debugfs_remove() is seldomly invoked, usually from module exit
      handlers only, the race is hard to trigger and the impact is very low.
      
      A discussion of the problem outlined above as well as a suggested
      solution can be found in the (sub-)thread rooted at
      
        http://lkml.kernel.org/g/20130401203445.GA20862@ZenIV.linux.org.uk
        ("Yet another pipe related oops.")
      
      Basically, Greg KH suggests to introduce an intermediate fops and
      Al Viro points out that a pointer to the original ones may be stored in
      ->d_fsdata.
      
      Follow this line of reasoning:
      - Add SRCU as a reverse dependency of DEBUG_FS.
      - Introduce a srcu_struct object for the debugfs subsystem.
      - In debugfs_create_file(), store a pointer to the original
        file_operations object in ->d_fsdata.
      - Make debugfs_remove() and debugfs_remove_recursive() wait for a
        SRCU grace period after the dentry has been delete()'d and before they
        return to their callers.
      - Introduce an intermediate file_operations object named
        "debugfs_open_proxy_file_operations". It's ->open() functions checks,
        under the protection of a SRCU read lock, whether the dentry is still
        alive, i.e. has not been d_delete()'d and if so, tries to acquire a
        reference on the owning module.
        On success, it sets the file object's ->f_op to the original
        file_operations and forwards the ongoing open() call to the original
        ->open().
      - For clarity, rename the former debugfs_file_operations to
        debugfs_noop_file_operations -- they are in no way canonical.
      
      The choice of SRCU over "normal" RCU is justified by the fact, that the
      former may also be used to protect ->i_private data from going away
      during the execution of a file's readers and writers which may (and do)
      sleep.
      
      Finally, introduce the fs/debugfs/internal.h header containing some
      declarations internal to the debugfs implementation.
      Signed-off-by: NNicolai Stange <nicstange@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9fd4dcec
  9. 01 4月, 2016 1 次提交
  10. 23 3月, 2016 2 次提交
    • H
      parisc,metag: Implement CONFIG_DEBUG_STACK_USAGE option · 6c31da34
      Helge Deller 提交于
      On parisc and metag the stack grows upwards, so for those we need to
      scan the stack downwards in order to calculate how much stack a process
      has used.
      
      Tested on a 64bit parisc kernel.
      Signed-off-by: NHelge Deller <deller@gmx.de>
      6c31da34
    • D
      kernel: add kcov code coverage · 5c9a8750
      Dmitry Vyukov 提交于
      kcov provides code coverage collection for coverage-guided fuzzing
      (randomized testing).  Coverage-guided fuzzing is a testing technique
      that uses coverage feedback to determine new interesting inputs to a
      system.  A notable user-space example is AFL
      (http://lcamtuf.coredump.cx/afl/).  However, this technique is not
      widely used for kernel testing due to missing compiler and kernel
      support.
      
      kcov does not aim to collect as much coverage as possible.  It aims to
      collect more or less stable coverage that is function of syscall inputs.
      To achieve this goal it does not collect coverage in soft/hard
      interrupts and instrumentation of some inherently non-deterministic or
      non-interesting parts of kernel is disbled (e.g.  scheduler, locking).
      
      Currently there is a single coverage collection mode (tracing), but the
      API anticipates additional collection modes.  Initially I also
      implemented a second mode which exposes coverage in a fixed-size hash
      table of counters (what Quentin used in his original patch).  I've
      dropped the second mode for simplicity.
      
      This patch adds the necessary support on kernel side.  The complimentary
      compiler support was added in gcc revision 231296.
      
      We've used this support to build syzkaller system call fuzzer, which has
      found 90 kernel bugs in just 2 months:
      
        https://github.com/google/syzkaller/wiki/Found-Bugs
      
      We've also found 30+ bugs in our internal systems with syzkaller.
      Another (yet unexplored) direction where kcov coverage would greatly
      help is more traditional "blob mutation".  For example, mounting a
      random blob as a filesystem, or receiving a random blob over wire.
      
      Why not gcov.  Typical fuzzing loop looks as follows: (1) reset
      coverage, (2) execute a bit of code, (3) collect coverage, repeat.  A
      typical coverage can be just a dozen of basic blocks (e.g.  an invalid
      input).  In such context gcov becomes prohibitively expensive as
      reset/collect coverage steps depend on total number of basic
      blocks/edges in program (in case of kernel it is about 2M).  Cost of
      kcov depends only on number of executed basic blocks/edges.  On top of
      that, kernel requires per-thread coverage because there are always
      background threads and unrelated processes that also produce coverage.
      With inlined gcov instrumentation per-thread coverage is not possible.
      
      kcov exposes kernel PCs and control flow to user-space which is
      insecure.  But debugfs should not be mapped as user accessible.
      
      Based on a patch by Quentin Casasnovas.
      
      [akpm@linux-foundation.org: make task_struct.kcov_mode have type `enum kcov_mode']
      [akpm@linux-foundation.org: unbreak allmodconfig]
      [akpm@linux-foundation.org: follow x86 Makefile layout standards]
      Signed-off-by: NDmitry Vyukov <dvyukov@google.com>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Cc: syzkaller <syzkaller@googlegroups.com>
      Cc: Vegard Nossum <vegard.nossum@oracle.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Tavis Ormandy <taviso@google.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
      Cc: Kostya Serebryany <kcc@google.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Kees Cook <keescook@google.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: David Drysdale <drysdale@google.com>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Kirill A. Shutemov <kirill@shutemov.name>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5c9a8750
  11. 02 3月, 2016 1 次提交
    • T
      cpu/hotplug: Make target state writeable · 757c989b
      Thomas Gleixner 提交于
      Make it possible to write a target state to the per cpu state file, so we can
      switch between states.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: linux-arch@vger.kernel.org
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Rafael Wysocki <rafael.j.wysocki@intel.com>
      Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Sebastian Siewior <bigeasy@linutronix.de>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul Turner <pjt@google.com>
      Link: http://lkml.kernel.org/r/20160226182341.022814799@linutronix.deSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      757c989b
  12. 29 2月, 2016 1 次提交
  13. 20 2月, 2016 1 次提交
  14. 10 2月, 2016 1 次提交
    • T
      workqueue: implement "workqueue.debug_force_rr_cpu" debug feature · f303fccb
      Tejun Heo 提交于
      Workqueue used to guarantee local execution for work items queued
      without explicit target CPU.  The guarantee is gone now which can
      break some usages in subtle ways.  To flush out those cases, this
      patch implements a debug feature which forces round-robin CPU
      selection for all such work items.
      
      The debug feature defaults to off and can be enabled with a kernel
      parameter.  The default can be flipped with a debug config option.
      
      If you hit this commit during bisection, please refer to 041bd12e
      ("Revert "workqueue: make sure delayed work run in local cpu"") for
      more information and ping me.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      f303fccb
  15. 21 1月, 2016 2 次提交
  16. 17 1月, 2016 1 次提交
  17. 16 1月, 2016 1 次提交
    • K
      page-flags: introduce page flags policies wrt compound pages · 95ad9755
      Kirill A. Shutemov 提交于
      This patch adds a third argument to macros which create function
      definitions for page flags.  This argument defines how page-flags
      helpers behave on compound functions.
      
      For now we define four policies:
      
       - PF_ANY: the helper function operates on the page it gets, regardless
         if it's non-compound, head or tail.
      
       - PF_HEAD: the helper function operates on the head page of the
         compound page if it gets tail page.
      
       - PF_NO_TAIL: only head and non-compond pages are acceptable for this
         helper function.
      
       - PF_NO_COMPOUND: only non-compound pages are acceptable for this
         helper function.
      
      For now we use policy PF_ANY for all helpers, which matches current
      behaviour.
      
      We do not enforce the policy for TESTPAGEFLAG, because we have flags
      checked for random pages all over the kernel.  Noticeable exception to
      this is PageTransHuge() which triggers VM_BUG_ON() for tail page.
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: Steve Capper <steve.capper@linaro.org>
      Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: Jérôme Glisse <jglisse@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      95ad9755
  18. 09 1月, 2016 2 次提交
    • D
      restrict /dev/mem to idle io memory ranges · 90a545e9
      Dan Williams 提交于
      This effectively promotes IORESOURCE_BUSY to IORESOURCE_EXCLUSIVE
      semantics by default.  If userspace really believes it is safe to access
      the memory region it can also perform the extra step of disabling an
      active driver.  This protects device address ranges with read side
      effects and otherwise directs userspace to use the driver.
      
      Persistent memory presents a large "mistake surface" to /dev/mem as now
      accidental writes can corrupt a filesystem.
      
      In general if a device driver is busily using a memory region it already
      informs other parts of the kernel to not touch it via
      request_mem_region().  /dev/mem should honor the same safety restriction
      by default.  Debugging a device driver from userspace becomes more
      difficult with this enabled.  Any application using /dev/mem or mmap of
      sysfs pci resources will now need to perform the extra step of either:
      
      1/ Disabling the driver, for example:
      
         echo <device id> > /dev/bus/<parent bus>/drivers/<driver name>/unbind
      
      2/ Rebooting with "iomem=relaxed" on the command line
      
      3/ Recompiling with CONFIG_IO_STRICT_DEVMEM=n
      
      Traditional users of /dev/mem like dosemu are unaffected because the
      first 1MB of memory is not subject to the IO_STRICT_DEVMEM restriction.
      Legacy X configurations use /dev/mem to talk to graphics hardware, but
      that functionality has since moved to kernel graphics drivers.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NKees Cook <keescook@chromium.org>
      Acked-by: NIngo Molnar <mingo@redhat.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      90a545e9
    • D
      arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug · 21266be9
      Dan Williams 提交于
      Let all the archs that implement devmem_is_allowed() opt-in to a common
      definition of CONFIG_STRICT_DEVM in lib/Kconfig.debug.
      
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      [heiko: drop 'default y' for s390]
      Acked-by: NIngo Molnar <mingo@redhat.com>
      Suggested-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      21266be9
  19. 22 12月, 2015 1 次提交
  20. 09 12月, 2015 1 次提交
    • T
      workqueue: implement lockup detector · 82607adc
      Tejun Heo 提交于
      Workqueue stalls can happen from a variety of usage bugs such as
      missing WQ_MEM_RECLAIM flag or concurrency managed work item
      indefinitely staying RUNNING.  These stalls can be extremely difficult
      to hunt down because the usual warning mechanisms can't detect
      workqueue stalls and the internal state is pretty opaque.
      
      To alleviate the situation, this patch implements workqueue lockup
      detector.  It periodically monitors all worker_pools periodically and,
      if any pool failed to make forward progress longer than the threshold
      duration, triggers warning and dumps workqueue state as follows.
      
       BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 31s!
       Showing busy workqueues and worker pools:
       workqueue events: flags=0x0
         pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=17/256
           pending: monkey_wrench_fn, e1000_watchdog, cache_reap, vmstat_shepherd, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, cgroup_release_agent
       workqueue events_power_efficient: flags=0x80
         pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=2/256
           pending: check_lifetime, neigh_periodic_work
       workqueue cgroup_pidlist_destroy: flags=0x0
         pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/1
           pending: cgroup_pidlist_destroy_work_fn
       ...
      
      The detection mechanism is controller through kernel parameter
      workqueue.watchdog_thresh and can be updated at runtime through the
      sysfs module parameter file.
      
      v2: Decoupled from softlockup control knobs.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NDon Zickus <dzickus@redhat.com>
      Cc: Ulrich Obergfell <uobergfe@redhat.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Chris Mason <clm@fb.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      82607adc
  21. 02 12月, 2015 1 次提交
    • N
      net: add support for netdev notifier error injection · 02fff96a
      Nikolay Aleksandrov 提交于
      This module allows to insert errors in some of netdevice's notifier
      events. All network drivers use these notifiers to signal various events
      and to check if they are allowed, e.g. PRECHANGEMTU and CHANGEMTU
      afterwards. Until recently I had to run failure tests by injecting
      a custom module, but now this infrastructure makes it trivial to test
      these failure paths. Some of the recent bugs I fixed were found using
      this module.
      Here's an example:
       $ cd /sys/kernel/debug/notifier-error-inject/netdev
       $ echo -22 > actions/NETDEV_CHANGEMTU/error
       $ ip link set eth0 mtu 1024
       RTNETLINK answers: Invalid argument
      
      CC: Akinobu Mita <akinobu.mita@gmail.com>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: netdev <netdev@vger.kernel.org>
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      02fff96a
  22. 07 11月, 2015 1 次提交
    • R
      test_printf: test printf family at runtime · 707cc728
      Rasmus Villemoes 提交于
      This adds a simple module for testing the kernel's printf facilities.
      Previously, some %p extensions have caused a wrong return value in case
      the entire output didn't fit and/or been unusable in kasprintf().  This
      should help catch such issues.  Also, it should help ensure that changes
      to the formatting algorithms don't break anything.
      
      I'm not sure if we have a struct dentry or struct file lying around at
      boot time or if we can fake one, but most %p extensions should be
      testable, as should the ordinary number and string formatting.
      
      The nature of vararg functions means we can't use a more conventional
      table-driven approach.
      
      For now, this is mostly a skeleton; contributions are very
      welcome. Some tests are/will be slightly annoying to write, since the
      expected output depends on stuff like CONFIG_*, sizeof(long), runtime
      values etc.
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Martin Kletzander <mkletzan@redhat.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      707cc728
  23. 23 10月, 2015 1 次提交
  24. 06 10月, 2015 1 次提交
  25. 03 8月, 2015 2 次提交
  26. 23 7月, 2015 1 次提交
  27. 20 7月, 2015 2 次提交
    • D
      rtmutex: Delete scriptable tester · 1b0b7c17
      Davidlohr Bueso 提交于
      No one uses this anymore, and this is not the first time the
      idea of replacing it with a (now possible) userspace side.
      Lock stealing logic was removed long ago in when the lock
      was granted to the highest prio.
      Signed-off-by: NDavidlohr Bueso <dbueso@suse.de>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Mike Galbraith <umgwanakikbuti@gmail.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1435782588-4177-2-git-send-email-dave@stgolabs.netSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      1b0b7c17
    • D
      futex: Fault/error injection capabilities · ab51fbab
      Davidlohr Bueso 提交于
      Although futexes are well known for being a royal pita,
      we really have very little debugging capabilities - except
      for relying on tglx's eye half the time.
      
      By simply making use of the existing fault-injection machinery,
      we can improve this situation, allowing generating artificial
      uaddress faults and deadlock scenarios. Of course, when this is
      disabled in production systems, the overhead for failure checks
      is practically zero -- so this is very cheap at the same time.
      Future work would be nice to now enhance trinity to make use of
      this.
      
      There is a special tunable 'ignore-private', which can filter
      out private futexes. Given the tsk->make_it_fail filter and
      this option, pi futexes can be narrowed down pretty closely.
      Signed-off-by: NDavidlohr Bueso <dbueso@suse.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Darren Hart <darren@dvhart.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Link: http://lkml.kernel.org/r/1435645562-975-3-git-send-email-dave@stgolabs.netSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      ab51fbab
  28. 18 7月, 2015 1 次提交
  29. 04 7月, 2015 1 次提交
  30. 28 5月, 2015 3 次提交
    • P
      rcu: Conditionally compile RCU's eqs warnings · 1ce46ee5
      Paul E. McKenney 提交于
      This commit applies some warning-omission micro-optimizations to RCU's
      various extended-quiescent-state functions, which are on the kernel/user
      hotpath for CONFIG_NO_HZ_FULL=y.
      Reported-by: NRik van Riel <riel@redhat.com>
      Reported by: Mike Galbraith <umgwanakikbuti@gmail.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      1ce46ee5
    • P
      rcu: Directly drive TASKS_RCU from Kconfig · 82d0f4c0
      Paul E. McKenney 提交于
      Currently, Kconfig will ask the user whether TASKS_RCU should be set.
      This is silly because Kconfig already has all the information that it
      needs to set this parameter.  This commit therefore directly drives
      the value of TASKS_RCU via "select" statements.  Which means that
      as subsystems require TASKS_RCU, those subsystems will need to add
      "select" statements of their own.
      Reported-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Reviewed-by: NPranith Kumar <bobby.prani@gmail.com>
      82d0f4c0
    • P
      rcu: Provide diagnostic option to slow down grace-period scans · 0f41c0dd
      Paul E. McKenney 提交于
      Grace-period scans of the rcu_node combining tree normally
      proceed quite quickly, so that it is very difficult to reproduce
      races against them.  This commit therefore allows grace-period
      pre-initialization and cleanup to be artificially slowed down,
      increasing race-reproduction probability.  A pair of pairs of new
      Kconfig parameters are provided, RCU_TORTURE_TEST_SLOW_PREINIT to
      enable the slowing down of propagating CPU-hotplug changes up the
      combining tree along with RCU_TORTURE_TEST_SLOW_PREINIT_DELAY to
      specify the delay in jiffies, and RCU_TORTURE_TEST_SLOW_CLEANUP
      to enable the slowing down of the end-of-grace-period cleanup scan
      along with RCU_TORTURE_TEST_SLOW_CLEANUP_DELAY to specify the delay
      in jiffies.  Boot-time parameters named rcutree.gp_preinit_delay and
      rcutree.gp_cleanup_delay allow these delays to be specified at boot time.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      0f41c0dd
  31. 15 4月, 2015 1 次提交
    • P
      rcu: Control grace-period delays directly from value · 8d7dc928
      Paul E. McKenney 提交于
      In a misguided attempt to avoid an #ifdef, the use of the
      gp_init_delay module parameter was conditioned on the corresponding
      RCU_TORTURE_TEST_SLOW_INIT Kconfig variable, using IS_ENABLED() at
      the point of use in the code.  This meant that the compiler always saw
      the delay, which meant that RCU_TORTURE_TEST_SLOW_INIT_DELAY had to be
      unconditionally defined.  This in turn caused "make oldconfig" to ask
      pointless questions about the value of RCU_TORTURE_TEST_SLOW_INIT_DELAY
      in cases where it was not even used.
      
      This commit avoids these pointless questions by defining gp_init_delay
      under #ifdef.  In one branch, gp_init_delay is initialized to
      RCU_TORTURE_TEST_SLOW_INIT_DELAY and is also a module parameter (thus
      allowing boot-time modification), and in the other branch gp_init_delay
      is a const variable initialized by default to zero.
      
      This approach also simplifies the code at the delay point by eliminating
      the IS_DEFINED().  Because gp_init_delay is constant zero in the no-delay
      case intended for production use, the "gp_init_delay > 0" check causes
      the delay to become dead code, as desired in this case.  In addition,
      this commit replaces magic constant "10" with the preprocessor variable
      PER_RCU_NODE_PERIOD, which controls the number of grace periods that
      are allowed to elapse at full speed before a delay is inserted.
      
      Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by:
      Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      8d7dc928