1. 22 1月, 2022 8 次提交
    • X
      sysctl: use SYSCTL_ZERO to replace some static int zero uses · 2452dcb9
      Xiaoming Ni 提交于
      Use the variable SYSCTL_ZERO to replace some static int boundary
      variables with a value of 0 (minolduid, min_extfrag_threshold,
      min_wakeup_granularity_ns).
      
      Link: https://lkml.kernel.org/r/20211123202347.818157-8-mcgrof@kernel.orgSigned-off-by: NXiaoming Ni <nixiaoming@huawei.com>
      Signed-off-by: NLuis Chamberlain <mcgrof@kernel.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Amir Goldstein <amir73il@gmail.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Qing Wang <wangqing@vivo.com>
      Cc: Sebastian Reichel <sre@kernel.org>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Stephen Kitt <steve@sk2.org>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Antti Palosaari <crope@iki.fi>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Julia Lawall <julia.lawall@inria.fr>
      Cc: Lukas Middendorf <kernel@tuxforce.de>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Phillip Potter <phil@philpotter.co.uk>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Douglas Gilbert <dgilbert@interlog.com>
      Cc: James E.J. Bottomley <jejb@linux.ibm.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: John Ogness <john.ogness@linutronix.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2452dcb9
    • X
      sysctl: use const for typically used max/min proc sysctls · d73840ec
      Xiaoming Ni 提交于
      When proc_dointvec_minmax() or proc_doulongvec_minmax() are used we are
      using the extra1 and extra2 parameters on the sysctl table only for a
      min and max boundary, these extra1 and extra2 arguments are then used
      for read-only operations.  So make them const to reflect this.
      
      [mcgrof@kernel.org: commit log love]
      
      Link: https://lkml.kernel.org/r/20211123202347.818157-7-mcgrof@kernel.orgSigned-off-by: NXiaoming Ni <nixiaoming@huawei.com>
      Signed-off-by: NLuis Chamberlain <mcgrof@kernel.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Amir Goldstein <amir73il@gmail.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Qing Wang <wangqing@vivo.com>
      Cc: Sebastian Reichel <sre@kernel.org>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Stephen Kitt <steve@sk2.org>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Antti Palosaari <crope@iki.fi>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Julia Lawall <julia.lawall@inria.fr>
      Cc: Lukas Middendorf <kernel@tuxforce.de>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Phillip Potter <phil@philpotter.co.uk>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Douglas Gilbert <dgilbert@interlog.com>
      Cc: James E.J. Bottomley <jejb@linux.ibm.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: John Ogness <john.ogness@linutronix.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d73840ec
    • S
      sysctl: make ngroups_max const · f628867d
      Stephen Kitt 提交于
      ngroups_max is a read-only sysctl entry, reflecting NGROUPS_MAX.  Make
      it const, in the same way as cap_last_cap.
      
      Link: https://lkml.kernel.org/r/20211123202347.818157-6-mcgrof@kernel.orgSigned-off-by: NStephen Kitt <steve@sk2.org>
      Signed-off-by: NLuis Chamberlain <mcgrof@kernel.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Amir Goldstein <amir73il@gmail.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Qing Wang <wangqing@vivo.com>
      Cc: Sebastian Reichel <sre@kernel.org>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Xiaoming Ni <nixiaoming@huawei.com>
      Cc: Antti Palosaari <crope@iki.fi>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Julia Lawall <julia.lawall@inria.fr>
      Cc: Lukas Middendorf <kernel@tuxforce.de>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Phillip Potter <phil@philpotter.co.uk>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Douglas Gilbert <dgilbert@interlog.com>
      Cc: James E.J. Bottomley <jejb@linux.ibm.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: John Ogness <john.ogness@linutronix.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f628867d
    • X
      watchdog: move watchdog sysctl interface to watchdog.c · dd0693fd
      Xiaoming Ni 提交于
      The kernel/sysctl.c is a kitchen sink where everyone leaves their dirty
      dishes, this makes it very difficult to maintain.
      
      To help with this maintenance let's start by moving sysctls to places
      where they actually belong.  The proc sysctl maintainers do not want to
      know what sysctl knobs you wish to add for your own piece of code, we
      just care about the core logic of proc sysctl.
      
      So, move the watchdog syscl interface to watchdog.c.  Use
      register_sysctl() to register the sysctl interface to avoid merge
      conflicts when different features modify sysctl.c at the same time.
      
      [mcgrof@kernel.org: justify the move on the commit log]
      
      Link: https://lkml.kernel.org/r/20211123202347.818157-5-mcgrof@kernel.orgSigned-off-by: NXiaoming Ni <nixiaoming@huawei.com>
      Signed-off-by: NLuis Chamberlain <mcgrof@kernel.org>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Reviewed-by: NPetr Mladek <pmladek@suse.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Amir Goldstein <amir73il@gmail.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Qing Wang <wangqing@vivo.com>
      Cc: Sebastian Reichel <sre@kernel.org>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Stephen Kitt <steve@sk2.org>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Antti Palosaari <crope@iki.fi>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Julia Lawall <julia.lawall@inria.fr>
      Cc: Lukas Middendorf <kernel@tuxforce.de>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Phillip Potter <phil@philpotter.co.uk>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Douglas Gilbert <dgilbert@interlog.com>
      Cc: James E.J. Bottomley <jejb@linux.ibm.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: John Ogness <john.ogness@linutronix.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dd0693fd
    • X
      hung_task: move hung_task sysctl interface to hung_task.c · bbe7a10e
      Xiaoming Ni 提交于
      The kernel/sysctl.c is a kitchen sink where everyone leaves their dirty
      dishes, this makes it very difficult to maintain.
      
      To help with this maintenance let's start by moving sysctls to places
      where they actually belong.  The proc sysctl maintainers do not want to
      know what sysctl knobs you wish to add for your own piece of code, we
      just care about the core logic.
      
      So move hung_task sysctl interface to hung_task.c and use
      register_sysctl() to register the sysctl interface.
      
      [mcgrof@kernel.org: commit log refresh and fixed 2-3 0day reported compile issues]
      
      Link: https://lkml.kernel.org/r/20211123202347.818157-4-mcgrof@kernel.orgSigned-off-by: NXiaoming Ni <nixiaoming@huawei.com>
      Signed-off-by: NLuis Chamberlain <mcgrof@kernel.org>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Reviewed-by: NPetr Mladek <pmladek@suse.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Amir Goldstein <amir73il@gmail.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Qing Wang <wangqing@vivo.com>
      Cc: Sebastian Reichel <sre@kernel.org>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Stephen Kitt <steve@sk2.org>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Antti Palosaari <crope@iki.fi>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Julia Lawall <julia.lawall@inria.fr>
      Cc: Lukas Middendorf <kernel@tuxforce.de>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Phillip Potter <phil@philpotter.co.uk>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Douglas Gilbert <dgilbert@interlog.com>
      Cc: James E.J. Bottomley <jejb@linux.ibm.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: John Ogness <john.ogness@linutronix.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bbe7a10e
    • X
      sysctl: move some boundary constants from sysctl.c to sysctl_vals · 78e36f3b
      Xiaoming Ni 提交于
      sysctl has helpers which let us specify boundary values for a min or max
      int value.  Since these are used for a boundary check only they don't
      change, so move these variables to sysctl_vals to avoid adding duplicate
      variables.  This will help with our cleanup of kernel/sysctl.c.
      
      [akpm@linux-foundation.org: update it for "mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30%"]
      [mcgrof@kernel.org: major rebase]
      
      Link: https://lkml.kernel.org/r/20211123202347.818157-3-mcgrof@kernel.orgSigned-off-by: NXiaoming Ni <nixiaoming@huawei.com>
      Signed-off-by: NLuis Chamberlain <mcgrof@kernel.org>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Amir Goldstein <amir73il@gmail.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Qing Wang <wangqing@vivo.com>
      Cc: Sebastian Reichel <sre@kernel.org>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Stephen Kitt <steve@sk2.org>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Antti Palosaari <crope@iki.fi>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Julia Lawall <julia.lawall@inria.fr>
      Cc: Lukas Middendorf <kernel@tuxforce.de>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Phillip Potter <phil@philpotter.co.uk>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Douglas Gilbert <dgilbert@interlog.com>
      Cc: James E.J. Bottomley <jejb@linux.ibm.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: John Ogness <john.ogness@linutronix.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      78e36f3b
    • X
      sysctl: add a new register_sysctl_init() interface · 3ddd9a80
      Xiaoming Ni 提交于
      Patch series "sysctl: first set of kernel/sysctl cleanups", v2.
      
      Finally had time to respin the series of the work we had started last
      year on cleaning up the kernel/sysct.c kitchen sink.  People keeps
      stuffing their sysctls in that file and this creates a maintenance
      burden.  So this effort is aimed at placing sysctls where they actually
      belong.
      
      I'm going to split patches up into series as there is quite a bit of
      work.
      
      This first set adds register_sysctl_init() for uses of registerting a
      sysctl on the init path, adds const where missing to a few places,
      generalizes common values so to be more easy to share, and starts the
      move of a few kernel/sysctl.c out where they belong.
      
      The majority of rework on v2 in this first patch set is 0-day fixes.
      Eric Biederman's feedback is later addressed in subsequent patch sets.
      
      I'll only post the first two patch sets for now.  We can address the
      rest once the first two patch sets get completely reviewed / Acked.
      
      This patch (of 9):
      
      The kernel/sysctl.c is a kitchen sink where everyone leaves their dirty
      dishes, this makes it very difficult to maintain.
      
      To help with this maintenance let's start by moving sysctls to places
      where they actually belong.  The proc sysctl maintainers do not want to
      know what sysctl knobs you wish to add for your own piece of code, we
      just care about the core logic.
      
      Today though folks heavily rely on tables on kernel/sysctl.c so they can
      easily just extend this table with their needed sysctls.  In order to
      help users move their sysctls out we need to provide a helper which can
      be used during code initialization.
      
      We special-case the initialization use of register_sysctl() since it
      *is* safe to fail, given all that sysctls do is provide a dynamic
      interface to query or modify at runtime an existing variable.  So the
      use case of register_sysctl() on init should *not* stop if the sysctls
      don't end up getting registered.  It would be counter productive to stop
      boot if a simple sysctl registration failed.
      
      Provide a helper for init then, and document the recommended init levels
      to use for callers of this routine.  We will later use this in
      subsequent patches to start slimming down kernel/sysctl.c tables and
      moving sysctl registration to the code which actually needs these
      sysctls.
      
      [mcgrof@kernel.org: major commit log and documentation rephrasing also moved to fs/proc/proc_sysctl.c                  ]
      
      Link: https://lkml.kernel.org/r/20211123202347.818157-1-mcgrof@kernel.org
      Link: https://lkml.kernel.org/r/20211123202347.818157-2-mcgrof@kernel.orgSigned-off-by: NXiaoming Ni <nixiaoming@huawei.com>
      Signed-off-by: NLuis Chamberlain <mcgrof@kernel.org>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Sebastian Reichel <sre@kernel.org>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Qing Wang <wangqing@vivo.com>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Amir Goldstein <amir73il@gmail.com>
      Cc: Stephen Kitt <steve@sk2.org>
      Cc: Antti Palosaari <crope@iki.fi>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Julia Lawall <julia.lawall@inria.fr>
      Cc: Lukas Middendorf <kernel@tuxforce.de>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Phillip Potter <phil@philpotter.co.uk>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Douglas Gilbert <dgilbert@interlog.com>
      Cc: James E.J. Bottomley <jejb@linux.ibm.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: John Ogness <john.ogness@linutronix.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3ddd9a80
    • A
      mm/migrate.c: rework migration_entry_wait() to not take a pageref · ffa65753
      Alistair Popple 提交于
      This fixes the FIXME in migrate_vma_check_page().
      
      Before migrating a page migration code will take a reference and check
      there are no unexpected page references, failing the migration if there
      are.  When a thread faults on a migration entry it will take a temporary
      reference to the page to wait for the page to become unlocked signifying
      the migration entry has been removed.
      
      This reference is dropped just prior to waiting on the page lock,
      however the extra reference can cause migration failures so it is
      desirable to avoid taking it.
      
      As migration code already has a reference to the migrating page an extra
      reference to wait on PG_locked is unnecessary so long as the reference
      can't be dropped whilst setting up the wait.
      
      When faulting on a migration entry the ptl is taken to check the
      migration entry.  Removing a migration entry also requires the ptl, and
      migration code won't drop its page reference until after the migration
      entry has been removed.  Therefore retaining the ptl of a migration
      entry is sufficient to ensure the page has a reference.  Reworking
      migration_entry_wait() to hold the ptl until the wait setup is complete
      means the extra page reference is no longer needed.
      
      [apopple@nvidia.com: v5]
        Link: https://lkml.kernel.org/r/20211213033848.1973946-1-apopple@nvidia.com
      
      Link: https://lkml.kernel.org/r/20211118020754.954425-1-apopple@nvidia.comSigned-off-by: NAlistair Popple <apopple@nvidia.com>
      Acked-by: NDavid Hildenbrand <david@redhat.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Jason Gunthorpe <jgg@nvidia.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: John Hubbard <jhubbard@nvidia.com>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: Ralph Campbell <rcampbell@nvidia.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ffa65753
  2. 21 1月, 2022 18 次提交
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · 9b57f458
      Linus Torvalds 提交于
      Pull HID fixes from Jiri Kosina:
      
       - fix for race condition that could lead to NULL pointer dereferences
         or UAF during uhid device destruction (Jann Horn)
      
       - contact count handling regression fixes for Wacom devices (Jason
         Gerecke)
      
       - fix for handling unnumbered HID reports handling in Google Vivaldi
         driver (Dmitry Torokhov)
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: wacom: Avoid using stale array indicies to read contact count
        HID: wacom: Ignore the confidence flag when a touch is removed
        HID: wacom: Reset expected and received contact counts at the same time
        HID: uhid: Use READ_ONCE()/WRITE_ONCE() for ->running
        HID: uhid: Fix worker destroying device without any protection
        HID: vivaldi: Minor cleanups
        HID: vivaldi: fix handling devices not using numbered reports
        HID: Ignore battery for Elan touchscreen on HP Envy X360 15t-dr100
      9b57f458
    • L
      Merge tag 'block-5.17-2022-01-21' of git://git.kernel.dk/linux-block · 3c7c2503
      Linus Torvalds 提交于
      Pull block fixes from Jens Axboe:
       "Various little minor fixes that should go into this release:
      
         - Fix issue with cloned bios and IO accounting (Christoph)
      
         - Remove redundant assignments (Colin, GuoYong)
      
         - Fix an issue with the mq-deadline async_depth sysfs interface (me)
      
         - Fix brd module loading race (Tetsuo)
      
         - Shared tag map wakeup fix (Laibin)
      
         - End of bdev read fix (OGAWA)
      
         - srcu leak fix (Ming)"
      
      * tag 'block-5.17-2022-01-21' of git://git.kernel.dk/linux-block:
        block: fix async_depth sysfs interface for mq-deadline
        block: Fix wrong offset in bio_truncate()
        block: assign bi_bdev for cloned bios in blk_rq_prep_clone
        block: cleanup q->srcu
        block: Remove unnecessary variable assignment
        brd: remove brd_devices_mutex mutex
        aoe: remove redundant assignment on variable n
        loop: remove redundant initialization of pointer node
        blk-mq: fix tag_get wait task can't be awakened
      3c7c2503
    • J
      HID: wacom: Avoid using stale array indicies to read contact count · 20f3cf5f
      Jason Gerecke 提交于
      If we ever see a touch report with contact count data we initialize
      several variables used to read the contact count in the pre-report
      phase. These variables are never reset if we process a report which
      doesn't contain a contact count, however. This can cause the pre-
      report function to trigger a read of arbitrary memory (e.g. NULL
      if we're lucky) and potentially crash the driver.
      
      This commit restores resetting of the variables back to default
      "none" values that were used prior to the commit mentioned
      below.
      
      Link: https://github.com/linuxwacom/input-wacom/issues/276
      Fixes: 003f50ab (HID: wacom: Update last_slot_field during pre_report phase)
      CC: stable@vger.kernel.org
      Signed-off-by: NJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: NPing Cheng <ping.cheng@wacom.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      20f3cf5f
    • J
      HID: wacom: Ignore the confidence flag when a touch is removed · df03e9bd
      Jason Gerecke 提交于
      AES hardware may internally re-classify a contact that it thought was
      intentional as a palm. Intentional contacts are reported as "down" with
      the confidence bit set. When this re-classification occurs, however, the
      state transitions to "up" with the confidence bit cleared. This kind of
      transition appears to be legal according to Microsoft docs, but we do
      not handle it correctly. Because the confidence bit is clear, we don't
      call `wacom_wac_finger_slot` and update userspace. This causes hung
      touches that confuse userspace and interfere with pen arbitration.
      
      This commit adds a special case to ignore the confidence flag if a contact
      is reported as removed. This ensures we do not leave a hung touch if one
      of these re-classification events occured. Ideally we'd have some way to
      also let userspace know that the touch has been re-classified as a palm
      and needs to be canceled, but that's not possible right now :)
      
      Link: https://github.com/linuxwacom/input-wacom/issues/288
      Fixes: 7fb0413b (HID: wacom: Use "Confidence" flag to prevent reporting invalid contacts)
      CC: stable@vger.kernel.org
      Signed-off-by: NJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: NPing Cheng <ping.cheng@wacom.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      df03e9bd
    • J
      HID: wacom: Reset expected and received contact counts at the same time · 546e41ac
      Jason Gerecke 提交于
      These two values go hand-in-hand and must be valid for the driver to
      behave correctly. We are currently lazy about updating the values and
      rely on the "expected" code flow to take care of making sure they're
      valid at the point they're needed. The "expected" flow changed somewhat
      with commit f8b6a747 ("HID: wacom: generic: Support multiple tools
      per report"), however. This led to problems with the DTH-2452 due (in
      part) to *all* contacts being fully processed -- even those past the
      expected contact count. Specifically, the received count gets reset to
      0 once all expected fingers are processed, but not the expected count.
      The rest of the contacts in the report are then *also* processed since
      now the driver thinks we've only processed 0 of N expected contacts.
      
      Later commits such as 7fb0413b (HID: wacom: Use "Confidence" flag to
      prevent reporting invalid contacts) worked around the DTH-2452 issue by
      skipping the invalid contacts at the end of the report, but this is not
      a complete fix. The confidence flag cannot be relied on when a contact
      is removed (see the following patch), and dealing with that condition
      re-introduces the DTH-2452 issue unless we also address this contact
      count laziness. By resetting expected and received counts at the same
      time we ensure the driver understands that there are 0 more contacts
      expected in the report. Similarly, we also make sure to reset the
      received count if for some reason we're out of sync in the pre-report
      phase.
      
      Link: https://github.com/linuxwacom/input-wacom/issues/288
      Fixes: f8b6a747 ("HID: wacom: generic: Support multiple tools per report")
      CC: stable@vger.kernel.org
      Signed-off-by: NJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: NPing Cheng <ping.cheng@wacom.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      546e41ac
    • L
      Merge tag 'io_uring-5.17-2022-01-21' of git://git.kernel.dk/linux-block · f3a78227
      Linus Torvalds 提交于
      Pull io_uring fixes from Jens Axboe:
      
       - Fix the io_uring POLLFREE handling, similarly to how it was done for
         aio (Pavel)
      
       - Remove (now) unused function (Jiapeng)
      
       - Small series fixing an issue with work cancelations. A window exists
         where work isn't locatable in the pending list, and isn't active in a
         worker yet either. (me)
      
      * tag 'io_uring-5.17-2022-01-21' of git://git.kernel.dk/linux-block:
        io-wq: delete dead lock shuffling code
        io_uring: perform poll removal even if async work removal is successful
        io-wq: add intermediate work step between pending list and active work
        io-wq: perform both unstarted and started work cancelations in one go
        io-wq: invoke work cancelation with wqe->lock held
        io-wq: make io_worker lock a raw spinlock
        io-wq: remove useless 'work' argument to __io_worker_busy()
        io_uring: fix UAF due to missing POLLFREE handling
        io_uring: Remove unused function req_ref_put
      f3a78227
    • L
      Merge tag 'sound-fix-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 1f40caa0
      Linus Torvalds 提交于
      Pull sound fixes from Takashi Iwai:
       "A small set of HD-audio and USB-audio fixes as well as a couple of
        ALSA core fixes. Most of them are fix-ups for the newly added CS35L41
        codec"
      
      * tag 'sound-fix-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda/cs8409: Add new Warlock SKUs to patch_cs8409
        ALSA: core: Simplify snd_power_ref_and_wait() with the standard macro
        ALSA: hda: cs35l41: Make cs35l41_hda_remove() return void
        ALSA: hda: cs35l41: Tidyup code
        ALSA: hda: cs35l41: Make use of the helper function dev_err_probe()
        ALSA: hda: cs35l41: Add missing default cases
        ALSA: hda: cs35l41: Move cs35l41* calls to its own symbol namespace
        ALSA: hda: cs35l41: Add calls to newly added test key function
        ALSA: hda: cs35l41: Avoid overwriting register patch
        ALSA: core: Fix SSID quirk lookup for subvendor=0
        ALSA: usb-audio: add mapping for MSI MPG X570S Carbon Max Wifi.
        ALSA: hda/realtek: fix speakers and micmute on HP 855 G8
      1f40caa0
    • L
      Merge tag 'rtc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux · 75242f31
      Linus Torvalds 提交于
      Pull RTC updates from Alexandre Belloni:
       "Two new drivers this cycle and a significant rework of the CMOS driver
        make the bulk of the changes.
      
        I also carry powerpc changes with the agreement of Michael.
      
        New drivers:
         - Sunplus SP7021 RTC
         - Nintendo GameCube, Wii and Wii U RTC
      
        Driver updates:
         - cmos: refactor UIP handling and presence check, fix century
         - rs5c372: offset correction support, report low voltage
         - rv8803: Epson RX8804 support"
      
      * tag 'rtc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (33 commits)
        rtc: sunplus: fix return value in sp_rtc_probe()
        rtc: cmos: Evaluate century appropriate
        rtc: gamecube: Fix an IS_ERR() vs NULL check
        rtc: mc146818-lib: fix signedness bug in mc146818_get_time()
        dt-bindings: rtc: qcom-pm8xxx-rtc: update register numbers
        rtc: pxa: fix null pointer dereference
        rtc: ftrtc010: Use platform_get_irq() to get the interrupt
        rtc: Move variable into switch case statement
        rtc: pcf2127: Fix typo in comment
        dt-bindings: rtc: Add Sunplus RTC json-schema
        rtc: Add driver for RTC in Sunplus SP7021
        rtc: rs5c372: fix incorrect oscillation value on r2221tl
        rtc: rs5c372: add offset correction support
        rtc: cmos: avoid UIP when writing alarm time
        rtc: cmos: avoid UIP when reading alarm time
        rtc: mc146818-lib: refactor mc146818_does_rtc_work
        rtc: mc146818-lib: refactor mc146818_get_time
        rtc: mc146818-lib: extract mc146818_avoid_UIP
        rtc: mc146818-lib: fix RTC presence check
        rtc: Check return value from mc146818_get_time()
        ...
      75242f31
    • L
      Merge tag 'drm-next-2022-01-21' of git://anongit.freedesktop.org/drm/drm · c2c94b3b
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "Thanks to Daniel for taking care of things while I was out, just a set
        of merge window fixes that came in this week, two i915 display fixes
        and a bunch of misc amdgpu, along with a radeon regression fix.
      
        amdgpu:
         - SR-IOV fix
         - VCN harvest fix
         - Suspend/resume fixes
         - Tahiti fix
         - Enable GPU recovery on yellow carp
      
        radeon:
         - Fix error handling regression in radeon_driver_open_kms
      
        i915:
         - Update EHL display voltage swing table
         - Fix programming the ADL-P display TC voltage swing"
      
      * tag 'drm-next-2022-01-21' of git://anongit.freedesktop.org/drm/drm:
        drm/radeon: fix error handling in radeon_driver_open_kms
        drm/amd/amdgpu: fixing read wrong pf2vf data in SRIOV
        drm/amdgpu: apply vcn harvest quirk
        drm/i915/display/adlp: Implement new step in the TC voltage swing prog sequence
        drm/i915/display/ehl: Update voltage swing table
        drm/amd/display: Revert W/A for hard hangs on DCN20/DCN21
        drm/amdgpu: drop flags check for CHIP_IP_DISCOVERY
        drm/amdgpu: Fix rejecting Tahiti GPUs
        drm/amdgpu: don't do resets on APUs which don't support it
        drm/amdgpu: invert the logic in amdgpu_device_should_recover_gpu()
        drm/amdgpu: Enable recovery on yellow carp
      c2c94b3b
    • L
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 39e77c48
      Linus Torvalds 提交于
      Pull clk fixes from Stephen Boyd:
       "Some hot fixes for clk driver patches merged last week and one oops
        fix:
      
         - Fix license on recent MediaTek drivers
      
         - Initialize a variable before use in the new Visconti driver
      
         - Avoid an oops by unregistering the clk provider in si5341"
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: mediatek: relicense mt7986 clock driver to GPL-2.0
        clk: visconti: Fix uninitialized variable in printk
        clk: si5341: Fix clock HW provider cleanup
      39e77c48
    • L
      Merge tag 'pci-v5.17-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 4141a5e6
      Linus Torvalds 提交于
      Pull pci fix from Bjorn Helgaas:
      
       - Reserve "stolen memory" for integrated Intel GPU, even if it's not
         the first GPU to be enumerated (Lucas De Marchi)
      
      * tag 'pci-v5.17-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        x86/gpu: Reserve stolen memory for first integrated Intel GPU
      4141a5e6
    • L
      Merge tag 's390-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 85e67d56
      Linus Torvalds 提交于
      Pull more s390 updates from Heiko Carstens:
      
       - add Sven Schnelle as reviewer for s390 code
      
       - make uaccess code more readable
      
       - change cpu measurement facility code to also support counter second
         version number 7, and add discard support for limited samples
      
      * tag 's390-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390: add Sven Schnelle as reviewer
        s390/uaccess: introduce bit field for OAC specifier
        s390/cpumf: Support for CPU Measurement Sampling Facility LS bit
        s390/cpumf: Support for CPU Measurement Facility CSVN 7
      85e67d56
    • L
      Merge tag 'xfs-5.17-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 31d94978
      Linus Torvalds 提交于
      Pull more xfs irix ioctl housecleaning from Darrick Wong:
       "Withdraw the XFS_IOC_ALLOCSP* and XFS_IOC_FREESP* ioctl definitions.
      
        This is the third and final of a series of small pull requests that
        perform some long overdue housecleaning of XFS ioctls. This time,
        we're withdrawing all variants of the ALLOCSP and FREESP ioctls from
        XFS' userspace API. This might be a little premature since we've only
        just removed the functionality, but as I pointed out in the last pull
        request, nobody (including fstests) noticed that it was broken for 20
        years.
      
        In response to the patch, we received a single comment from someone
        who stated that they 'augment' the ioctl for their own purposes, but
        otherwise acquiesced to the withdrawal. I still want to try to clobber
        these old ioctl definitions in 5.17.
      
        So remove the header definitions for these ioctls. The just-removed
        implementation has allowed callers to read stale disk contents for
        more than **21 years** and nobody noticed or complained, which implies
        a lack of users aside from exploit programs"
      
      * tag 'xfs-5.17-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: remove the XFS_IOC_{ALLOC,FREE}SP* definitions
      31d94978
    • L
      Merge tag 'xfs-5.17-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · d701a8cc
      Linus Torvalds 提交于
      Pull xfs irix ioctl housecleaning from Darrick Wong:
       "Remove the XFS_IOC_ALLOCSP* and XFS_IOC_FREESP* ioctl families.
      
        This is the second of a series of small pull requests that perform
        some long overdue housecleaning of XFS ioctls. This time, we're
        vacating the implementation of all variants of the ALLOCSP and FREESP
        ioctls, which are holdovers from EFS in Irix, circa 1993. Roughly
        equivalent functionality have been available for both ioctls since
        2.6.25 (April 2008):
      
         - XFS_IOC_FREESP ftruncates a file.
      
         - XFS_IOC_ALLOCSP is the equivalent of fallocate.
      
        As noted in the fix patch for CVE 2021-4155, the ALLOCSP ioctl has
        been serving up stale disk blocks since 2000, and in 21 years
        **nobody** noticed. On those grounds I think it's safe to vacate the
        implementation.
      
        Note that we lose the ability to preallocate and truncate relative to
        the current file position, but as nobody's ever implemented that for
        the VFS, I conclude that it's not in high demand.
      
        Linux has always used fallocate as the space management system call,
        whereas these Irix legacy ioctls only ever worked on XFS, and have
        been the cause of recent stale data disclosure vulnerabilities. As
        equivalent functionality is available elsewhere, remove the code"
      
      * tag 'xfs-5.17-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: kill the XFS_IOC_{ALLOC,FREE}SP* ioctls
      d701a8cc
    • L
      Merge tag 'xfs-5.17-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 12a8fb20
      Linus Torvalds 提交于
      Pull xfs ioctl housecleaning from Darrick Wong:
       "This is the first of a series of small pull requests that perform some
        long overdue housecleaning of XFS ioctls. This first pull request
        removes the FSSETDM ioctl, which was used to set DMAPI event
        attributes on XFS files. The DMAPI support has never been merged
        upstream and the implementation of FSSETDM itself was removed two
        years ago, so let's withdraw it completely.
      
         - Withdraw the ioctl definition for the FSSETDM ioctl"
      
      * tag 'xfs-5.17-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: remove the XFS_IOC_FSSETDM definitions
      12a8fb20
    • D
      Merge tag 'amd-drm-fixes-5.17-2022-01-19' of... · ccf34586
      Dave Airlie 提交于
      Merge tag 'amd-drm-fixes-5.17-2022-01-19' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
      
      amd-drm-fixes-5.17-2022-01-19:
      
      amdgpu:
      - SR-IOV fix
      - VCN harvest fix
      - Suspend/resume fixes
      - Tahiti fix
      - Enable GPU recovery on yellow carp
      
      radeon:
      - Fix error handling regression in radeon_driver_open_kms
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220120013547.5649-1-alexander.deucher@amd.com
      ccf34586
    • D
      Merge tag 'drm-intel-next-fixes-2022-01-20' of... · 410482b5
      Dave Airlie 提交于
      Merge tag 'drm-intel-next-fixes-2022-01-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
      
      - Latest updates for the EHL display voltage swing table (José Roberto de Souza)
      - Additional step is required when programming the ADL-P display TC voltage swing (José Roberto de Souza)
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/Yek1zdsnRPiBVvFF@tursulin-mobl2
      410482b5
    • J
      block: fix async_depth sysfs interface for mq-deadline · 46cdc45a
      Jens Axboe 提交于
      A previous commit added this feature, but it inadvertently used the wrong
      variable to show/store the setting from/to, victimized by copy/paste. Fix
      it up so that the async_depth sysfs interface reads and writes from the
      right setting.
      
      Fixes: 07757588 ("block/mq-deadline: Reserve 25% of scheduler tags for synchronous requests")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=215485Reviewed-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      46cdc45a
  3. 20 1月, 2022 14 次提交
    • L
      Merge tag 'gpio-fixes-for-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · 2c271fe7
      Linus Torvalds 提交于
      Pull gpio fixes from Bartosz Golaszewski:
       "Fix the same error check issue in two drivers. And then the drivers
        are fixed even more because the first patches were incomplete which I
        missed.
      
        Summary:
      
         - fix the error checks of platform_get_irq() in gpio-mpc8xxx and
           gpio-idt3243x"
      
      * tag 'gpio-fixes-for-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: mpc8xxx: Fix an ignored error return from platform_get_irq()
        gpio: idt3243x: Fix an ignored error return from platform_get_irq()
        gpio: idt3243x: Fix IRQ check in idt_gpio_probe
        gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe
      2c271fe7
    • S
    • O
      block: Fix wrong offset in bio_truncate() · 3ee859e3
      OGAWA Hirofumi 提交于
      bio_truncate() clears the buffer outside of last block of bdev, however
      current bio_truncate() is using the wrong offset of page. So it can
      return the uninitialized data.
      
      This happened when both of truncated/corrupted FS and userspace (via
      bdev) are trying to read the last of bdev.
      
      Reported-by: syzbot+ac94ae5f68b84197f41c@syzkaller.appspotmail.com
      Signed-off-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Reviewed-by: NMing Lei <ming.lei@redhat.com>
      Link: https://lore.kernel.org/r/875yqt1c9g.fsf@mail.parknet.co.jpSigned-off-by: NJens Axboe <axboe@kernel.dk>
      3ee859e3
    • L
      Merge tag 'ceph-for-5.17-rc1' of git://github.com/ceph/ceph-client · 64f29d88
      Linus Torvalds 提交于
      Pull ceph updates from Ilya Dryomov:
       "The highlight is the new mount "device" string syntax implemented by
        Venky Shankar. It solves some long-standing issues with using
        different auth entities and/or mounting different CephFS filesystems
        from the same cluster, remounting and also misleading /proc/mounts
        contents. The existing syntax of course remains to be maintained.
      
        On top of that, there is a couple of fixes for edge cases in quota and
        a new mount option for turning on unbuffered I/O mode globally instead
        of on a per-file basis with ioctl(CEPH_IOC_SYNCIO)"
      
      * tag 'ceph-for-5.17-rc1' of git://github.com/ceph/ceph-client:
        ceph: move CEPH_SUPER_MAGIC definition to magic.h
        ceph: remove redundant Lsx caps check
        ceph: add new "nopagecache" option
        ceph: don't check for quotas on MDS stray dirs
        ceph: drop send metrics debug message
        rbd: make const pointer spaces a static const array
        ceph: Fix incorrect statfs report for small quota
        ceph: mount syntax module parameter
        doc: document new CephFS mount device syntax
        ceph: record updated mon_addr on remount
        ceph: new device mount syntax
        libceph: rename parse_fsid() to ceph_parse_fsid() and export
        libceph: generalize addr/ip parsing based on delimiter
      64f29d88
    • L
      Merge tag '5.17-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd · 67ed868d
      Linus Torvalds 提交于
      Pull ksmbd server fixes from Steve French:
      
       - authentication fix
      
       - RDMA (smbdirect) fixes (including fix for a memory corruption, and
         some performance improvements)
      
       - multiple improvements for multichannel
      
       - misc fixes, including crediting (flow control) improvements
      
       - cleanup fixes, including some kernel doc fixes
      
      * tag '5.17-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd: (23 commits)
        ksmbd: fix guest connection failure with nautilus
        ksmbd: uninitialized variable in create_socket()
        ksmbd: smbd: fix missing client's memory region invalidation
        ksmbd: add smb-direct shutdown
        ksmbd: smbd: change the default maximum read/write, receive size
        ksmbd: smbd: create MR pool
        ksmbd: add reserved room in ipc request/response
        ksmbd: smbd: call rdma_accept() under CM handler
        ksmbd: limits exceeding the maximum allowable outstanding requests
        ksmbd: move credit charge deduction under processing request
        ksmbd: add support for smb2 max credit parameter
        ksmbd: set 445 port to smbdirect port by default
        ksmbd: register ksmbd ib client with ib_register_client()
        ksmbd: Fix smb2_get_name() kernel-doc comment
        ksmbd: Delete an invalid argument description in smb2_populate_readdir_entry()
        ksmbd: Fix smb2_set_info_file() kernel-doc comment
        ksmbd: Fix buffer_check_err() kernel-doc comment
        ksmbd: fix multi session connection failure
        ksmbd: set both ipv4 and ipv6 in FSCTL_QUERY_NETWORK_INTERFACE_INFO
        ksmbd: set RSS capable in FSCTL_QUERY_NETWORK_INTERFACE_INFO
        ...
      67ed868d
    • L
      Merge tag 'vfio-v5.17-rc1' of git://github.com/awilliam/linux-vfio · c5a0b6e4
      Linus Torvalds 提交于
      Pull VFIO updates from Alex Williamson:
      
       - Fix sparse endian warnings in IGD code (Alex Williamson)
      
       - Balance kvzalloc with kvfree (Jiacheng Shi)
      
      * tag 'vfio-v5.17-rc1' of git://github.com/awilliam/linux-vfio:
        vfio/iommu_type1: replace kfree with kvfree
        vfio/pci: Resolve sparse endian warnings in IGD support
      c5a0b6e4
    • L
      Merge tag 'pwm/for-5.17-rc1' of... · 41652aae
      Linus Torvalds 提交于
      Merge tag 'pwm/for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
      
      Pull pwm updates from Thierry Reding:
       "This contains a number of nice cleanups and improvements for the core
        and various drivers, as well as a minor tweak to the json-schema
        device tree bindings"
      
      * tag 'pwm/for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
        dt-bindings: pwm: Avoid selecting schema on node name match
        pwm: img: Use only a single idiom to get a runtime PM reference
        pwm: vt8500: Implement .apply() callback
        pwm: img: Implement .apply() callback
        pwm: twl: Implement .apply() callback
        pwm: Restore initial state if a legacy callback fails
        pwm: Prevent a glitch for legacy drivers
        pwm: Move legacy driver handling into a dedicated function
      41652aae
    • L
      Merge tag 'net-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · fa2e1ba3
      Linus Torvalds 提交于
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from netfilter, bpf.
      
        Quite a handful of old regression fixes but most of those are
        pre-5.16.
      
        Current release - regressions:
      
         - fix memory leaks in the skb free deferral scheme if upper layer
           protocols are used, i.e. in-kernel TCP readers like TLS
      
        Current release - new code bugs:
      
         - nf_tables: fix NULL check typo in _clone() functions
      
         - change the default to y for Vertexcom vendor Kconfig
      
         - a couple of fixes to incorrect uses of ref tracking
      
         - two fixes for constifying netdev->dev_addr
      
        Previous releases - regressions:
      
         - bpf:
            - various verifier fixes mainly around register offset handling
              when passed to helper functions
            - fix mount source displayed for bpffs (none -> bpffs)
      
         - bonding:
            - fix extraction of ports for connection hash calculation
            - fix bond_xmit_broadcast return value when some devices are down
      
         - phy: marvell: add Marvell specific PHY loopback
      
         - sch_api: don't skip qdisc attach on ingress, prevent ref leak
      
         - htb: restore minimal packet size handling in rate control
      
         - sfp: fix high power modules without diagnostic monitoring
      
         - mscc: ocelot:
            - don't let phylink re-enable TX PAUSE on the NPI port
            - don't dereference NULL pointers with shared tc filters
      
         - smsc95xx: correct reset handling for LAN9514
      
         - cpsw: avoid alignment faults by taking NET_IP_ALIGN into account
      
         - phy: micrel: use kszphy_suspend/_resume for irq aware devices,
           avoid races with the interrupt
      
        Previous releases - always broken:
      
         - xdp: check prog type before updating BPF link
      
         - smc: resolve various races around abnormal connection termination
      
         - sit: allow encapsulated IPv6 traffic to be delivered locally
      
         - axienet: fix init/reset handling, add missing barriers, read the
           right status words, stop queues correctly
      
         - add missing dev_put() in sock_timestamping_bind_phc()
      
        Misc:
      
         - ipv4: prevent accidentally passing RTO_ONLINK to
           ip_route_output_key_hash() by sanitizing flags
      
         - ipv4: avoid quadratic behavior in netns dismantle
      
         - stmmac: dwmac-oxnas: add support for OX810SE
      
         - fsl: xgmac_mdio: add workaround for erratum A-009885"
      
      * tag 'net-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (92 commits)
        ipv4: add net_hash_mix() dispersion to fib_info_laddrhash keys
        ipv4: avoid quadratic behavior in netns dismantle
        net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module
        powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses
        dt-bindings: net: Document fsl,erratum-a009885
        net/fsl: xgmac_mdio: Add workaround for erratum A-009885
        net: mscc: ocelot: fix using match before it is set
        net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices
        net: cpsw: avoid alignment faults by taking NET_IP_ALIGN into account
        nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind()
        net: axienet: increase default TX ring size to 128
        net: axienet: fix for TX busy handling
        net: axienet: fix number of TX ring slots for available check
        net: axienet: Fix TX ring slot available check
        net: axienet: limit minimum TX ring size
        net: axienet: add missing memory barriers
        net: axienet: reset core on initialization prior to MDIO access
        net: axienet: Wait for PhyRstCmplt after core reset
        net: axienet: increase reset timeout
        bpf, selftests: Add ringbuf memory type confusion test
        ...
      fa2e1ba3
    • L
      Merge branch 'akpm' (patches from Andrew) · f4484d13
      Linus Torvalds 提交于
      Merge more updates from Andrew Morton:
       "55 patches.
      
        Subsystems affected by this patch series: percpu, procfs, sysctl,
        misc, core-kernel, get_maintainer, lib, checkpatch, binfmt, nilfs2,
        hfs, fat, adfs, panic, delayacct, kconfig, kcov, and ubsan"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (55 commits)
        lib: remove redundant assignment to variable ret
        ubsan: remove CONFIG_UBSAN_OBJECT_SIZE
        kcov: fix generic Kconfig dependencies if ARCH_WANTS_NO_INSTR
        lib/Kconfig.debug: make TEST_KMOD depend on PAGE_SIZE_LESS_THAN_256KB
        btrfs: use generic Kconfig option for 256kB page size limit
        arch/Kconfig: split PAGE_SIZE_LESS_THAN_256KB from PAGE_SIZE_LESS_THAN_64KB
        configs: introduce debug.config for CI-like setup
        delayacct: track delays from memory compact
        Documentation/accounting/delay-accounting.rst: add thrashing page cache and direct compact
        delayacct: cleanup flags in struct task_delay_info and functions use it
        delayacct: fix incomplete disable operation when switch enable to disable
        delayacct: support swapin delay accounting for swapping without blkio
        panic: remove oops_id
        panic: use error_report_end tracepoint on warnings
        fs/adfs: remove unneeded variable make code cleaner
        FAT: use io_schedule_timeout() instead of congestion_wait()
        hfsplus: use struct_group_attr() for memcpy() region
        nilfs2: remove redundant pointer sbufs
        fs/binfmt_elf: use PT_LOAD p_align values for static PIE
        const_structs.checkpatch: add frequently used ops structs
        ...
      f4484d13
    • Y
      gpio: mpc8xxx: Fix an ignored error return from platform_get_irq() · 9f51ce0b
      Yang Li 提交于
      The return from the call to platform_get_irq() is int, it can be
      a negative error code, however this is being assigned to an unsigned
      int variable 'irqn', so making 'irqn' an int.
      
      Eliminate the following coccicheck warning:
      ./drivers/gpio/gpio-mpc8xxx.c:391:5-21: WARNING: Unsigned expression
      compared with zero: mpc8xxx_gc -> irqn < 0
      Reported-by: NAbaci Robot <abaci@linux.alibaba.com>
      Fixes: 0b39536c ("gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe")
      Signed-off-by: NYang Li <yang.lee@linux.alibaba.com>
      Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
      9f51ce0b
    • Y
      gpio: idt3243x: Fix an ignored error return from platform_get_irq() · 7c1cf555
      Yang Li 提交于
      The return from the call to platform_get_irq() is int, it can be
      a negative error code, however this is being assigned to an unsigned
      int variable 'parent_irq', so making 'parent_irq' an int.
      
      Eliminate the following coccicheck warning:
      ./drivers/gpio/gpio-idt3243x.c:167:6-16: WARNING: Unsigned expression
      compared with zero: parent_irq < 0
      Reported-by: NAbaci Robot <abaci@linux.alibaba.com>
      Fixes: 30fee1d7 ("gpio: idt3243x: Fix IRQ check in idt_gpio_probe")
      Signed-off-by: NYang Li <yang.lee@linux.alibaba.com>
      Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
      7c1cf555
    • C
      lib: remove redundant assignment to variable ret · b1e78ef3
      Colin Ian King 提交于
      The variable ret is being assigned a value that is never read.  If the
      for-loop is entered then ret is immediately re-assigned a new value.  If
      the for-loop is not executed ret is never read.  The assignment is
      redundant and can be removed.
      
      Link: https://lkml.kernel.org/r/20211230134557.83633-1-colin.i.king@gmail.comSigned-off-by: NColin Ian King <colin.i.king@gmail.com>
      Reviewed-by: NJarkko Sakkinen <jarkko@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b1e78ef3
    • K
      ubsan: remove CONFIG_UBSAN_OBJECT_SIZE · 69d0db01
      Kees Cook 提交于
      The object-size sanitizer is redundant to -Warray-bounds, and
      inappropriately performs its checks at run-time when all information
      needed for the evaluation is available at compile-time, making it quite
      difficult to use:
      
        https://bugzilla.kernel.org/show_bug.cgi?id=214861
      
      With -Warray-bounds almost enabled globally, it doesn't make sense to
      keep this around.
      
      Link: https://lkml.kernel.org/r/20211203235346.110809-1-keescook@chromium.orgSigned-off-by: NKees Cook <keescook@chromium.org>
      Reviewed-by: NMarco Elver <elver@google.com>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Michal Marek <michal.lkml@markovi.net>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      69d0db01
    • M
      kcov: fix generic Kconfig dependencies if ARCH_WANTS_NO_INSTR · bece04b5
      Marco Elver 提交于
      Until recent versions of GCC and Clang, it was not possible to disable
      KCOV instrumentation via a function attribute.  The relevant function
      attribute was introduced in 540540d0 ("kcov: add
      __no_sanitize_coverage to fix noinstr for all architectures").
      
      x86 was the first architecture to want a working noinstr, and at the
      time no compiler support for the attribute existed yet.  Therefore,
      commit 0f1441b4 ("objtool: Fix noinstr vs KCOV") introduced the
      ability to NOP __sanitizer_cov_*() calls in .noinstr.text.
      
      However, this doesn't work for other architectures like arm64 and s390
      that want a working noinstr per ARCH_WANTS_NO_INSTR.
      
      At the time of 0f1441b4, we didn't yet have ARCH_WANTS_NO_INSTR,
      but now we can move the Kconfig dependency checks to the generic KCOV
      option.  KCOV will be available if:
      
      	- architecture does not care about noinstr, OR
      	- we have objtool support (like on x86), OR
      	- GCC is 12.0 or newer, OR
      	- Clang is 13.0 or newer.
      
      Link: https://lkml.kernel.org/r/20211201152604.3984495-1-elver@google.comSigned-off-by: NMarco Elver <elver@google.com>
      Reviewed-by: NNathan Chancellor <nathan@kernel.org>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bece04b5