1. 07 Mar, 2021 1 commit
  2. 01 Oct, 2020 1 commit
    • Xiaoming Ni's avatar
      kernel/notifier.c: intercept duplicate registrations to avoid infinite loops · e95e4ba3
      Xiaoming Ni authored
      [ Upstream commit 1a50cb80f219c44adb6265f5071b81fc3c1deced ]
      Registering the same notifier to a hook repeatedly can cause the hook
      list to form a ring or lose other members of the list.
        case1: An infinite loop in notifier_chain_register() can cause soft lockup
                atomic_notifier_chain_register(&test_notifier_list, &test1);
                atomic_notifier_chain_register(&test_notifier_list, &test1);
                atomic_notifier_chain_register(&test_notifier_list, &test2);
        case2: An infinite loop in notifier_chain_register() can cause soft lockup
                atomic_notifier_chain_register(&test_notifier_list, &test1);
                atomic_notifier_chain_register(&test_notifier_list, &test1);
                atomic_notifier_call_chain(&test_notifier_list, 0, NULL);
        case3: lose other hook test2
                atomic_notifier_chain_register(&test_notifier_list, &test1);
                atomic_notifier_chain_register(&test_notifier_list, &test2);
                atomic_notifier_chain_register(&test_notifier_list, &test1);
        case4: Unregister returns 0, but the hook is still in the linked list,
               and it is not really registered. If you call
               notifier_call_chain after ko is unloaded, it will trigger oops.
      If the system is configured with softlockup_panic and the same hook is
      repeatedly registered on the panic_notifier_list, it will cause a loop
      Add a check in notifier_chain_register(), intercepting duplicate
      registrations to avoid infinite loops
      Link: http://lkml.kernel.org/r/1568861888-34045-2-git-send-email-nixiaoming@huawei.com
      Signed-off-by: default avatarXiaoming Ni <nixiaoming@huawei.com>
      Reviewed-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Anna Schumaker <anna.schumaker@netapp.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: J. Bruce Fields <bfields@fieldses.org>
      Cc: Chuck Lever <chuck.lever@oracle.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jeff Layton <jlayton@kernel.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Nadia Derbey <Nadia.Derbey@bull.net>
      Cc: "Paul E. McKenney" <paulmck@kernel.org>
      Cc: Sam Protsenko <semen.protsenko@linaro.org>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: Xiaoming Ni <nixiaoming@huawei.com>
      Cc: YueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
  3. 25 Mar, 2020 1 commit
  4. 21 May, 2019 1 commit
  5. 15 May, 2019 1 commit
  6. 25 Feb, 2017 1 commit
  7. 07 Jul, 2015 1 commit
  8. 06 Jan, 2015 1 commit
    • Pranith Kumar's avatar
      rcu: Make SRCU optional by using CONFIG_SRCU · 83fe27ea
      Pranith Kumar authored
      SRCU is not necessary to be compiled by default in all cases. For tinification
      efforts not compiling SRCU unless necessary is desirable.
      The current patch tries to make compiling SRCU optional by introducing a new
      Kconfig option CONFIG_SRCU which is selected when any of the components making
      use of SRCU are selected.
      If we do not select CONFIG_SRCU, srcu.o will not be compiled at all.
         text    data     bss     dec     hex filename
         2007       0       0    2007     7d7 kernel/rcu/srcu.o
      Size of arch/powerpc/boot/zImage changes from
         text    data     bss     dec     hex filename
       831552   64180   23944  919676   e087c arch/powerpc/boot/zImage : before
       829504   64180   23952  917636   e0084 arch/powerpc/boot/zImage : after
      so the savings are about ~2000 bytes.
      Signed-off-by: default avatarPranith Kumar <bobby.prani@gmail.com>
      CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      CC: Josh Triplett <josh@joshtriplett.org>
      CC: Lai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      [ paulmck: resolve conflict due to removal of arch/ia64/kvm/Kconfig. ]
  9. 24 Apr, 2014 1 commit
  10. 26 Feb, 2014 1 commit
  11. 31 Oct, 2011 1 commit
    • Paul Gortmaker's avatar
      kernel: Map most files to use export.h instead of module.h · 9984de1a
      Paul Gortmaker authored
      The changed files were only including linux/module.h for the
      EXPORT_SYMBOL infrastructure, and nothing else.  Revector them
      onto the isolated export header for faster compile times.
      Nothing to see here but a whole lot of instances of:
        -#include <linux/module.h>
        +#include <linux/export.h>
      This commit is only changing the kernel dir; next targets
      will probably be mm, fs, the arch dirs, etc.
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
  12. 26 Jul, 2011 1 commit
  13. 25 Feb, 2010 1 commit
    • Paul E. McKenney's avatar
      sched: Use lockdep-based checking on rcu_dereference() · d11c563d
      Paul E. McKenney authored
      Update the rcu_dereference() usages to take advantage of the new
      lockdep-based checking.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: laijs@cn.fujitsu.com
      Cc: dipankar@in.ibm.com
      Cc: mathieu.desnoyers@polymtl.ca
      Cc: josh@joshtriplett.org
      Cc: dvhltc@us.ibm.com
      Cc: niv@us.ibm.com
      Cc: peterz@infradead.org
      Cc: rostedt@goodmis.org
      Cc: Valdis.Kletnieks@vt.edu
      Cc: dhowells@redhat.com
      LKML-Reference: <1266887105-1528-6-git-send-email-paulmck@linux.vnet.ibm.com>
      [ -v2: fix allmodconfig missing symbol export build failure on x86 ]
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
  14. 30 Aug, 2009 1 commit
  15. 14 Oct, 2008 1 commit
  16. 10 Sep, 2008 2 commits
  17. 29 Apr, 2008 1 commit
  18. 06 Feb, 2008 1 commit
  19. 19 Oct, 2007 1 commit