Skip to content
  1. Nov 10, 2021
    • Arnd Bergmann's avatar
      hfs/hfsplus: use WARN_ON for sanity check · 55d1cbbb
      Arnd Bergmann authored
      
      
      gcc warns about a couple of instances in which a sanity check exists but
      the author wasn't sure how to react to it failing, which makes it look
      like a possible bug:
      
        fs/hfsplus/inode.c: In function 'hfsplus_cat_read_inode':
        fs/hfsplus/inode.c:503:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
          503 |                         /* panic? */;
              |                                     ^
        fs/hfsplus/inode.c:524:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
          524 |                         /* panic? */;
              |                                     ^
        fs/hfsplus/inode.c: In function 'hfsplus_cat_write_inode':
        fs/hfsplus/inode.c:582:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
          582 |                         /* panic? */;
              |                                     ^
        fs/hfsplus/inode.c:608:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
          608 |                         /* panic? */;
              |                                     ^
        fs/hfs/inode.c: In function 'hfs_write_inode':
        fs/hfs/inode.c:464:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
          464 |                         /* panic? */;
              |                                     ^
        fs/hfs/inode.c:485:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
          485 |                         /* panic? */;
              |                                     ^
      
      panic() is probably not the correct choice here, but a WARN_ON
      seems appropriate and avoids the compile-time warning.
      
      Link: https://lkml.kernel.org/r/20210927102149.1809384-1-arnd@kernel.org
      Link: https://lore.kernel.org/all/20210322223249.2632268-1-arnd@kernel.org/
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Christian Brauner <christian.brauner@ubuntu.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jan Kara <jack@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      55d1cbbb
    • Ryusuke Konishi's avatar
      nilfs2: remove filenames from file comments · 94ee1d91
      Ryusuke Konishi authored
      
      
      Remove filenames that are not particularly useful in file comments, and
      suppress checkpatch warnings
      
        WARNING: It's generally not useful to have the filename in the file
      
      Link: https://lkml.kernel.org/r/1635151862-11547-3-git-send-email-konishi.ryusuke@gmail.com
      Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
      Cc: Qing Wang <wangqing@vivo.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      94ee1d91
    • Qing Wang's avatar
      nilfs2: replace snprintf in show functions with sysfs_emit · 3bcd6c5b
      Qing Wang authored
      
      
      Patch series "nilfs2 updates".
      
      This patch (of 2):
      
      coccicheck complains about the use of snprintf() in sysfs show functions.
      
      Fix the coccicheck warning:
      
        WARNING: use scnprintf or sprintf.
      
      Use sysfs_emit instead of scnprintf or sprintf makes more sense.
      
      Link: https://lkml.kernel.org/r/1635151862-11547-1-git-send-email-konishi.ryusuke@gmail.com
      Link: https://lkml.kernel.org/r/1634095759-4625-1-git-send-email-wangqing@vivo.com
      Link: https://lkml.kernel.org/r/1635151862-11547-2-git-send-email-konishi.ryusuke@gmail.com
      Signed-off-by: default avatarQing Wang <wangqing@vivo.com>
      Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3bcd6c5b
    • Jan Harkes's avatar
      coda: bump module version to 7.2 · 98d5b61e
      Jan Harkes authored
      
      
      Helps with tracking which patches have been propagated upstream and if
      users are running the latest known version.
      
      Link: https://lkml.kernel.org/r/20210908140308.18491-10-jaharkes@cs.cmu.edu
      Signed-off-by: default avatarJan Harkes <jaharkes@cs.cmu.edu>
      Cc: Alex Shi <alex.shi@linux.alibaba.com>
      Cc: Jing Yangyang <jing.yangyang@zte.com.cn>
      Cc: Xin Tan <tanxin.ctf@gmail.com>
      Cc: Xiyu Yang <xiyuyang19@fudan.edu.cn>
      Cc: Zeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      98d5b61e
    • Jing Yangyang's avatar
      coda: use vmemdup_user to replace the open code · 118b7ee1
      Jing Yangyang authored
      
      
      vmemdup_user is better than duplicating its implementation, So just
      replace the open code.
      
        fs/coda/psdev.c:125:10-18:WARNING:opportunity for vmemdup_user
      
      The issue is detected with the help of Coccinelle.
      
      Link: https://lkml.kernel.org/r/20210908140308.18491-9-jaharkes@cs.cmu.edu
      Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarJing Yangyang <jing.yangyang@zte.com.cn>
      Signed-off-by: default avatarJan Harkes <jaharkes@cs.cmu.edu>
      Cc: Alex Shi <alex.shi@linux.alibaba.com>
      Cc: Xin Tan <tanxin.ctf@gmail.com>
      Cc: Xiyu Yang <xiyuyang19@fudan.edu.cn>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      118b7ee1
    • Xiyu Yang's avatar
      coda: convert from atomic_t to refcount_t on coda_vm_ops->refcnt · 1077c285
      Xiyu Yang authored
      
      
      refcount_t type and corresponding API can protect refcounters from
      accidental underflow and overflow and further use-after-free situations.
      
      Link: https://lkml.kernel.org/r/20210908140308.18491-8-jaharkes@cs.cmu.edu
      Signed-off-by: default avatarXiyu Yang <xiyuyang19@fudan.edu.cn>
      Signed-off-by: default avatarXin Tan <tanxin.ctf@gmail.com>
      Signed-off-by: default avatarJan Harkes <jaharkes@cs.cmu.edu>
      Cc: Alex Shi <alex.shi@linux.alibaba.com>
      Cc: Jing Yangyang <jing.yangyang@zte.com.cn>
      Cc: Zeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1077c285
    • Jan Harkes's avatar
      coda: avoid doing bad things on inode type changes during revalidation · 5a646fb3
      Jan Harkes authored
      
      
      When Coda discovers an inconsistent object, it turns it into a symlink.
      However we can't just follow this change in the kernel on an existing file
      or directory inode that may still have references.
      
      This patch removes the inconsistent inode from the inode hash and
      allocates a new inode for the symlink object.
      
      Link: https://lkml.kernel.org/r/20210908140308.18491-7-jaharkes@cs.cmu.edu
      Signed-off-by: default avatarJan Harkes <jaharkes@cs.cmu.edu>
      Cc: Alex Shi <alex.shi@linux.alibaba.com>
      Cc: Jing Yangyang <jing.yangyang@zte.com.cn>
      Cc: Xin Tan <tanxin.ctf@gmail.com>
      Cc: Xiyu Yang <xiyuyang19@fudan.edu.cn>
      Cc: Zeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5a646fb3
    • Jan Harkes's avatar
      coda: avoid hidden code duplication in rename · b2e36228
      Jan Harkes authored
      
      
      We were actually fixing up the directory mtime in both branches after the
      negative dentry test, it was just that one branch was only flagging the
      directory inodes to refresh their attributes while the other branch used
      the optional optimization to set mtime to the current time and not go back
      to the Coda client.
      
      Link: https://lkml.kernel.org/r/20210908140308.18491-6-jaharkes@cs.cmu.edu
      Signed-off-by: default avatarJan Harkes <jaharkes@cs.cmu.edu>
      Cc: Alex Shi <alex.shi@linux.alibaba.com>
      Cc: Jing Yangyang <jing.yangyang@zte.com.cn>
      Cc: Xin Tan <tanxin.ctf@gmail.com>
      Cc: Xiyu Yang <xiyuyang19@fudan.edu.cn>
      Cc: Zeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b2e36228
    • Jan Harkes's avatar
      coda: avoid flagging NULL inodes · 76097eb7
      Jan Harkes authored
      
      
      Somehow we hit a negative dentry in coda_rename even after checking with
      d_really_is_positive.  Maybe something raced and turned the new_dentry
      negative while we were fixing up directory link counts.
      
      Link: https://lkml.kernel.org/r/20210908140308.18491-5-jaharkes@cs.cmu.edu
      Signed-off-by: default avatarJan Harkes <jaharkes@cs.cmu.edu>
      Cc: Alex Shi <alex.shi@linux.alibaba.com>
      Cc: Jing Yangyang <jing.yangyang@zte.com.cn>
      Cc: Xin Tan <tanxin.ctf@gmail.com>
      Cc: Xiyu Yang <xiyuyang19@fudan.edu.cn>
      Cc: Zeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      76097eb7
    • Alex Shi's avatar
      coda: remove err which no one care · b1deb685
      Alex Shi authored
      
      
      No one care 'err' in func coda_release, so better remove it.
      
      Link: https://lkml.kernel.org/r/20210908140308.18491-4-jaharkes@cs.cmu.edu
      Signed-off-by: default avatarAlex Shi <alex.shi@linux.alibaba.com>
      Signed-off-by: default avatarJan Harkes <jaharkes@cs.cmu.edu>
      Cc: Jing Yangyang <jing.yangyang@zte.com.cn>
      Cc: Xin Tan <tanxin.ctf@gmail.com>
      Cc: Xiyu Yang <xiyuyang19@fudan.edu.cn>
      Cc: Zeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b1deb685
    • Jan Harkes's avatar
      coda: check for async upcall request using local state · 3d8e72d9
      Jan Harkes authored
      
      
      Originally flagged by Smatch because the code implicitly assumed outSize
      is not NULL for non-async upcalls because of a flag that was (not) set in
      req->uc_flags.
      
      However req->uc_flags field is in shared state and although the current
      code will not allow it to be changed before the async request check the
      code is more robust when it tests against the local outSize variable.
      
      Link: https://lkml.kernel.org/r/20210908140308.18491-3-jaharkes@cs.cmu.edu
      Signed-off-by: default avatarJan Harkes <jaharkes@cs.cmu.edu>
      Cc: Alex Shi <alex.shi@linux.alibaba.com>
      Cc: Jing Yangyang <jing.yangyang@zte.com.cn>
      Cc: Xin Tan <tanxin.ctf@gmail.com>
      Cc: Xiyu Yang <xiyuyang19@fudan.edu.cn>
      Cc: Zeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3d8e72d9
    • Jan Harkes's avatar
      coda: avoid NULL pointer dereference from a bad inode · 18319cb4
      Jan Harkes authored
      
      
      Patch series "Coda updates for -next".
      
      The following patch series contains some fixes for the Coda kernel module
      I've had sitting around and were tested extensively in a development
      version of the Coda kernel module that lives outside of the main kernel.
      
      This patch (of 9):
      
      Avoid accessing coda_inode_info from a dentry with a bad inode.
      
      Link: https://lkml.kernel.org/r/20210908140308.18491-1-jaharkes@cs.cmu.edu
      Link: https://lkml.kernel.org/r/20210908140308.18491-2-jaharkes@cs.cmu.edu
      Signed-off-by: default avatarJan Harkes <jaharkes@cs.cmu.edu>
      Cc: Alex Shi <alex.shi@linux.alibaba.com>
      Cc: Jing Yangyang <jing.yangyang@zte.com.cn>
      Cc: Xin Tan <tanxin.ctf@gmail.com>
      Cc: Xiyu Yang <xiyuyang19@fudan.edu.cn>
      Cc: Zeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      18319cb4
    • Andrew Halaney's avatar
      init: make unknown command line param message clearer · 8bc2b3dc
      Andrew Halaney authored
      The prior message is confusing users, which is the exact opposite of the
      goal.  If the message is being seen, one of the following situations is
      happening:
      
       1. the param is misspelled
       2. the param is not valid due to the kernel configuration
       3. the param is intended for init but isn't after the '--'
          delineator on the command line
      
      To make that more clear to the user, explicitly mention "kernel command
      line" and also note that the params are still passed to user space to
      avoid causing any alarm over params intended for init.
      
      Link: https://lkml.kernel.org/r/20211013223502.96756-1-ahalaney@redhat.com
      Fixes: 86d1919a
      
       ("init: print out unknown kernel parameters")
      Signed-off-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Suggested-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Borislav Petkov <bp@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8bc2b3dc
    • yangerkun's avatar
      ramfs: fix mount source show for ramfs · 0858d7da
      yangerkun authored
      
      
      ramfs_parse_param does not parse key "source", and will convert
      -ENOPARAM to 0. This will skip vfs_parse_fs_param_source in vfs_parse_fs_param, which
      lead always "none" mount source for ramfs.
      
      Fix it by parsing "source" in ramfs_parse_param like cgroup1_parse_param
      does.
      
      Link: https://lkml.kernel.org/r/20210924091756.1906118-1-yangerkun@huawei.com
      Signed-off-by: default avataryangerkun <yangerkun@huawei.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0858d7da
    • Kefeng Wang's avatar
      alpha: use is_kernel_text() helper · 2d93a583
      Kefeng Wang authored
      
      
      Use is_kernel_text() helper to simplify code.
      
      Link: https://lkml.kernel.org/r/20210930071143.63410-12-wangkefeng.wang@huawei.com
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2d93a583
    • Kefeng Wang's avatar
      microblaze: use is_kernel_text() helper · 4b5ef1e1
      Kefeng Wang authored
      
      
      Use is_kernel_text() helper to simplify code.
      
      Link: https://lkml.kernel.org/r/20210930071143.63410-11-wangkefeng.wang@huawei.com
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Acked-by: default avatarMichal Simek <michal.simek@xilinx.com>
      Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4b5ef1e1
    • Kefeng Wang's avatar
      powerpc/mm: use core_kernel_text() helper · 843a1ffa
      Kefeng Wang authored
      
      
      Use core_kernel_text() helper to simplify code, also drop etext, _stext,
      _sinittext, _einittext declaration which already declared in section.h.
      
      Link: https://lkml.kernel.org/r/20210930071143.63410-10-wangkefeng.wang@huawei.com
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      843a1ffa
    • Kefeng Wang's avatar
      extable: use is_kernel_text() helper · 808b6456
      Kefeng Wang authored
      
      
      The core_kernel_text() should check the gate area, as it is part of kernel
      text range, use is_kernel_text() in core_kernel_text().
      
      Link: https://lkml.kernel.org/r/20210930071143.63410-9-wangkefeng.wang@huawei.com
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      808b6456
    • Kefeng Wang's avatar
      mm: kasan: use is_kernel() helper · 3298cbe8
      Kefeng Wang authored
      
      
      Directly use is_kernel() helper in kernel_or_module_addr().
      
      Link: https://lkml.kernel.org/r/20210930071143.63410-8-wangkefeng.wang@huawei.com
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Reviewed-by: default avatarAlexander Potapenko <glider@google.com>
      Reviewed-by: default avatarAndrey Konovalov <andreyknvl@gmail.com>
      Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3298cbe8
    • Kefeng Wang's avatar
      sections: provide internal __is_kernel() and __is_kernel_text() helper · 8f6e42e8
      Kefeng Wang authored
      
      
      An internal __is_kernel() helper which only check the kernel address
      ranges, and an internal __is_kernel_text() helper which only check text
      section ranges.
      
      Link: https://lkml.kernel.org/r/20210930071143.63410-7-wangkefeng.wang@huawei.com
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8f6e42e8
    • Kefeng Wang's avatar
      x86: mm: rename __is_kernel_text() to is_x86_32_kernel_text() · 0a96c902
      Kefeng Wang authored
      Commit b56cd05c
      
       ("x86/mm: Rename is_kernel_text to __is_kernel_text"),
      add '__' prefix not to get in conflict with existing is_kernel_text() in
      <linux/kallsyms.h>.
      
      We will add __is_kernel_text() for the basic kernel text range check in
      the next patch, so use private is_x86_32_kernel_text() naming for x86
      special check.
      
      Link: https://lkml.kernel.org/r/20210930071143.63410-6-wangkefeng.wang@huawei.com
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0a96c902
    • Kefeng Wang's avatar
      sections: move is_kernel_inittext() into sections.h · b9ad8fe7
      Kefeng Wang authored
      
      
      The is_kernel_inittext() and init_kernel_text() are with same
      functionality, let's just keep is_kernel_inittext() and move it into
      sections.h, then update all the callers.
      
      Link: https://lkml.kernel.org/r/20210930071143.63410-5-wangkefeng.wang@huawei.com
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b9ad8fe7
    • Kefeng Wang's avatar
      sections: move and rename core_kernel_data() to is_kernel_core_data() · a20deb3a
      Kefeng Wang authored
      
      
      Move core_kernel_data() into sections.h and rename it to
      is_kernel_core_data(), also make it return bool value, then update all the
      callers.
      
      Link: https://lkml.kernel.org/r/20210930071143.63410-4-wangkefeng.wang@huawei.com
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a20deb3a
    • Kefeng Wang's avatar
      kallsyms: fix address-checks for kernel related range · e7d5c4b0
      Kefeng Wang authored
      
      
      The is_kernel_inittext/is_kernel_text/is_kernel function should not
      include the end address(the labels _einittext, _etext and _end) when check
      the address range, the issue exists since Linux v2.6.12.
      
      Link: https://lkml.kernel.org/r/20210930071143.63410-3-wangkefeng.wang@huawei.com
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
      Reviewed-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Acked-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e7d5c4b0
    • Kefeng Wang's avatar
      kallsyms: remove arch specific text and data check · 1b1ad288
      Kefeng Wang authored
      Patch series "sections: Unify kernel sections range check and use", v4.
      
      There are three head files(kallsyms.h, kernel.h and sections.h) which
      include the kernel sections range check, let's make some cleanup and unify
      them.
      
      1. cleanup arch specific text/data check and fix address boundary check
         in kallsyms.h
      
      2. make all the basic/core kernel range check function into sections.h
      
      3. update all the callers, and use the helper in sections.h to simplify
         the code
      
      After this series, we have 5 APIs about kernel sections range check in
      sections.h
      
       * is_kernel_rodata()		--- already in sections.h
       * is_kernel_core_data()	--- come from core_kernel_data() in kernel.h
       * is_kernel_inittext()		--- come from kernel.h and kallsyms.h
       * __is_kernel_text()		--- add new internal helper
       * __is_kernel()		--- add new internal helper
      
      Note: For the last two helpers, people should not use directly, consider to
            use corresponding function in kallsyms.h.
      
      This patch (of 11):
      
      Remove arch specific text and data check after commit 4ba66a97
      
       ("arch:
      remove blackfin port"), no need arch-specific text/data check.
      
      Link: https://lkml.kernel.org/r/20210930071143.63410-1-wangkefeng.wang@huawei.com
      Link: https://lkml.kernel.org/r/20210930071143.63410-2-wangkefeng.wang@huawei.com
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1b1ad288
    • Alexey Dobriyan's avatar
      ELF: simplify STACK_ALLOC macro · a43e5e3a
      Alexey Dobriyan authored
      
      
      "A -= B; A" is equivalent to "A -= B".
      
      Link: https://lkml.kernel.org/r/YVmcP256fRMqCwgK@localhost.localdomain
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a43e5e3a
    • Kees Cook's avatar
      binfmt_elf: reintroduce using MAP_FIXED_NOREPLACE · 5f501d55
      Kees Cook authored
      Commit b212921b ("elf: don't use MAP_FIXED_NOREPLACE for elf
      executable mappings") reverted back to using MAP_FIXED to map ELF LOAD
      segments because it was found that the segments in some binaries overlap
      and can cause MAP_FIXED_NOREPLACE to fail.
      
      The original intent of MAP_FIXED_NOREPLACE in the ELF loader was to
      prevent the silent clobbering of an existing mapping (e.g.  stack) by
      the ELF image, which could lead to exploitable conditions.  Quoting
      commit 4ed28639
      
       ("fs, elf: drop MAP_FIXED usage from elf_map"),
      which originally introduced the use of MAP_FIXED_NOREPLACE in the
      loader:
      
          Both load_elf_interp and load_elf_binary rely on elf_map to map
          segments [to a specific] address and they use MAP_FIXED to enforce
          that. This is however [a] dangerous thing prone to silent data
          corruption which can be even exploitable.
          ...
          Let's take CVE-2017-1000253 as an example ... we could end up mapping
          [the executable] over the existing stack ... The [stack layout] issue
          has been fixed since then ... So we should be safe and any [similar]
          attack should be impractical. On the other hand this is just too
          subtle [an] assumption ... it can break quite easily and [be] hard to
          spot.
          ...
          Address this [weakness] by changing MAP_FIXED to the newly added
          MAP_FIXED_NOREPLACE. This will mean that mmap will fail if there is
          an existing mapping clashing with the requested one [instead of
          silently] clobbering it.
      
      Then processing ET_DYN binaries the loader already calculates a total
      size for the image when the first segment is mapped, maps the entire
      image, and then unmaps the remainder before the remaining segments are
      then individually mapped.
      
      To avoid the earlier problems (legitimate overlapping LOAD segments
      specified in the ELF), apply the same logic to ET_EXEC binaries as well.
      
      For both ET_EXEC and ET_DYN+INTERP use MAP_FIXED_NOREPLACE for the
      initial total size mapping and then use MAP_FIXED to build the final
      (possibly legitimately overlapping) mappings.  For ET_DYN w/out INTERP,
      continue to map at a system-selected address in the mmap region.
      
      Link: https://lkml.kernel.org/r/20210916215947.3993776-1-keescook@chromium.org
      Link: https://lore.kernel.org/lkml/1595869887-23307-2-git-send-email-anthony.yznaga@oracle.com
      Co-developed-by: default avatarAnthony Yznaga <anthony.yznaga@oracle.com>
      Signed-off-by: default avatarAnthony Yznaga <anthony.yznaga@oracle.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Eric Biederman <ebiederm@xmission.com>
      Cc: Chen Jingwen <chenjingwen6@huawei.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Andrei Vagin <avagin@openvz.org>
      Cc: Khalid Aziz <khalid.aziz@oracle.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5f501d55
    • Peter Ujfalusi's avatar
      checkpatch: get default codespell dictionary path from package location · 0ee3e7b8
      Peter Ujfalusi authored
      
      
      The standard location of dictionary.txt is under codespell's package, on
      my machine atm (codespell 2.1, Artix Linux):
      
        /usr/lib/python3.9/site-packages/codespell_lib/data/dictionary.txt
      
      Since we enable the codespell by default for SOF I have constant:
      
        No codespell typos will be found - file '/usr/share/codespell/dictionary.txt': No such file or directory
      
      The patch proposes to try to fix up the path following the
      recommendation found here:
      
        https://github.com/codespell-project/codespell/issues/1540
      
      Link: https://lkml.kernel.org/r/29e25d1364c8ad7f7657cc0660f60c568074d438.camel@perches.com
      Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
      Acked-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0ee3e7b8
    • Joe Perches's avatar
      checkpatch: improve EXPORT_SYMBOL test for EXPORT_SYMBOL_NS uses · 70a11659
      Joe Perches authored
      
      
      The EXPORT_SYMBOL test expects a single argument but definitions of
      EXPORT_SYMBOL_NS have multiple arguments.
      
      Update the test to extract only the first argument from any
      EXPORT_SYMBOL related definition.
      
      Link: https://lkml.kernel.org/r/9e8f251b42e405f460f26a23ba9b33ef45a94adc.camel@perches.com
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Reported-by: default avatarIan Pilcher <arequipeno@gmail.com>
      Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
      Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      70a11659
    • Rikard Falkeborn's avatar
      const_structs.checkpatch: add a few sound ops structs · 3e421469
      Rikard Falkeborn authored
      
      
      Add a couple of commonly used (>50 instances) sound ops structs that are
      typically const.
      
      Link: https://lkml.kernel.org/r/20210922211042.38017-1-rikard.falkeborn@gmail.com
      Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3e421469
    • Thomas Gleixner's avatar
      mm/scatterlist: replace the !preemptible warning in sg_miter_stop() · 723aca20
      Thomas Gleixner authored
      
      
      sg_miter_stop() checks for disabled preemption before unmapping a page
      via kunmap_atomic().  The kernel doc mentions under context that
      preemption must be disabled if SG_MITER_ATOMIC is set.
      
      There is no active requirement for the caller to have preemption
      disabled before invoking sg_mitter_stop().  The sg_mitter_*()
      implementation itself has no such requirement.
      
      In fact, preemption is disabled by kmap_atomic() as part of
      sg_miter_next() and remains disabled as long as there is an active
      SG_MITER_ATOMIC mapping.  This is a consequence of kmap_atomic() and not
      a requirement for sg_mitter_*() itself.
      
      The user chooses SG_MITER_ATOMIC because it uses the API in a context
      where blocking is not possible or blocking is possible but he chooses a
      lower weight mapping which is not available on all CPUs and so it might
      need less overhead to setup at a price that now preemption will be
      disabled.
      
      The kmap_atomic() implementation on PREEMPT_RT does not disable
      preemption.  It simply disables CPU migration to ensure that the task
      remains on the same CPU while the caller remains preemptible.  This in
      turn triggers the warning in sg_miter_stop() because preemption is
      allowed.
      
      The PREEMPT_RT and !PREEMPT_RT implementation of kmap_atomic() disable
      pagefaults as a requirement.  It is sufficient to check for this instead
      of disabled preemption.
      
      Check for disabled pagefault handler in the SG_MITER_ATOMIC case.
      Remove the "preemption disabled" part from the kernel doc as the
      sg_milter*() implementation does not care.
      
      [bigeasy@linutronix.de: commit description]
      
      Link: https://lkml.kernel.org/r/20211015211409.cqopacv3pxdwn2ty@linutronix.de
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      723aca20
    • Alexey Dobriyan's avatar
      lib: uninline simple_strntoull() as well · 839b395e
      Alexey Dobriyan authored
      
      
      Codegen become bloated again after simple_strntoull() introduction
      
      	add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-224 (-224)
      	Function                                     old     new   delta
      	simple_strtoul                                 5       2      -3
      	simple_strtol                                 23      20      -3
      	simple_strtoull                              119      15    -104
      	simple_strtoll                               155      41    -114
      
      Link: https://lkml.kernel.org/r/YVmlB9yY4lvbNKYt@localhost.localdomain
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Cc: Richard Fitzgerald <rf@opensource.cirrus.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      839b395e
    • Lucas De Marchi's avatar
      include/linux/string_helpers.h: add linux/string.h for strlen() · bfb3ba32
      Lucas De Marchi authored
      
      
      linux/string_helpers.h uses strlen(), so include the correponding header.
      Otherwise we get a compilation error if it's not also included by whoever
      included the helper.
      
      Link: https://lkml.kernel.org/r/20211005212634.3223113-1-lucas.demarchi@intel.com
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bfb3ba32
    • Imran Khan's avatar
      lib, stackdepot: add helper to print stack entries into buffer · 0f68d45e
      Imran Khan authored
      
      
      To print stack entries into a buffer, users of stackdepot, first get a
      list of stack entries using stack_depot_fetch and then print this list
      into a buffer using stack_trace_snprint.  Provide a helper in stackdepot
      for this purpose.  Also change above mentioned users to use this helper.
      
      [imran.f.khan@oracle.com: fix build error]
        Link: https://lkml.kernel.org/r/20210915175321.3472770-4-imran.f.khan@oracle.com
      [imran.f.khan@oracle.com: export stack_depot_snprint() to modules]
        Link: https://lkml.kernel.org/r/20210916133535.3592491-4-imran.f.khan@oracle.com
      
      Link: https://lkml.kernel.org/r/20210915014806.3206938-4-imran.f.khan@oracle.com
      Signed-off-by: default avatarImran Khan <imran.f.khan@oracle.com>
      Suggested-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: Jani Nikula <jani.nikula@intel.com>	[i915]
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0f68d45e
    • Imran Khan's avatar
      lib, stackdepot: add helper to print stack entries · 505be481
      Imran Khan authored
      
      
      To print a stack entries, users of stackdepot, first use stack_depot_fetch
      to get a list of stack entries and then use stack_trace_print to print
      this list.  Provide a helper in stackdepot to print stack entries based on
      stackdepot handle.  Also change above mentioned users to use this helper.
      
      Link: https://lkml.kernel.org/r/20210915014806.3206938-3-imran.f.khan@oracle.com
      Signed-off-by: default avatarImran Khan <imran.f.khan@oracle.com>
      Suggested-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Reviewed-by: default avatarAlexander Potapenko <glider@google.com>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      505be481
    • Imran Khan's avatar
      lib, stackdepot: check stackdepot handle before accessing slabs · 4d4712c1
      Imran Khan authored
      
      
      Patch series "lib, stackdepot: check stackdepot handle before accessing slabs", v2.
      
      PATCH-1: Checks validity of a stackdepot handle before proceeding to
      access stackdepot slab/objects.
      
      PATCH-2: Adds a helper in stackdepot, to allow users to print stack
      entries just by specifying the stackdepot handle.  It also changes such
      users to use this new interface.
      
      PATCH-3: Adds a helper in stackdepot, to allow users to print stack
      entries into buffers just by specifying the stackdepot handle and
      destination buffer.  It also changes such users to use this new interface.
      
      This patch (of 3):
      
      stack_depot_save allocates slabs that will be used for storing objects in
      future.If this slab allocation fails we may get to a situation where space
      allocation for a new stack_record fails, causing stack_depot_save to
      return 0 as handle.  If user of this handle ends up invoking
      stack_depot_fetch with this handle value, current implementation of
      stack_depot_fetch will end up using slab from wrong index.  To avoid this
      check handle value at the beginning.
      
      Link: https://lkml.kernel.org/r/20210915175321.3472770-1-imran.f.khan@oracle.com
      Link: https://lkml.kernel.org/r/20210915014806.3206938-1-imran.f.khan@oracle.com
      Link: https://lkml.kernel.org/r/20210915014806.3206938-2-imran.f.khan@oracle.com
      Signed-off-by: default avatarImran Khan <imran.f.khan@oracle.com>
      Suggested-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4d4712c1
    • Lukas Bulwahn's avatar
      MAINTAINERS: rectify entry for ALLWINNER HARDWARE SPINLOCK SUPPORT · 57235b6e
      Lukas Bulwahn authored
      Commit f9e784dc ("dt-bindings: hwlock: add sun6i_hwspinlock") adds
      Documentation/devicetree/bindings/hwlock/allwinner,sun6i-a31-hwspinlock.yaml,
      but the related commit 3c881e05
      
       ("hwspinlock: add sun6i hardware
      spinlock support") adds a file reference to
      allwinner,sun6i-hwspinlock.yaml instead.
      
      Hence, ./scripts/get_maintainer.pl --self-test=patterns complains:
      
        warning: no file matches  F:  Documentation/devicetree/bindings/hwlock/allwinner,sun6i-hwspinlock.yaml
      
      Rectify this file reference in ALLWINNER HARDWARE SPINLOCK SUPPORT.
      
      Link: https://lkml.kernel.org/r/20211026141902.4865-5-lukas.bulwahn@gmail.com
      Reviewed-by: default avatarWilken Gottwalt <wilken.gottwalt@posteo.net>
      Signed-off-by: default avatarLukas Bulwahn <lukas.bulwahn@gmail.com>
      Cc: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
      Cc: Edmund Dea <edmund.j.dea@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Joe Perches <joe@perches.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
      Cc: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
      Cc: Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Yu Chen <chenyu56@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      57235b6e
    • Lukas Bulwahn's avatar
      MAINTAINERS: rectify entry for INTEL KEEM BAY DRM DRIVER · 65e5acbb
      Lukas Bulwahn authored
      Commit ed794057 ("drm/kmb: Build files for KeemBay Display driver")
      refers to the non-existing file intel,kmb_display.yaml in
      Documentation/devicetree/bindings/display/.
      
      Commit 5a76b1ed ("dt-bindings: display: Add support for Intel
      KeemBay Display") originating from the same patch series however adds
      the file intel,keembay-display.yaml in that directory instead.
      
      So, refer to intel,keembay-display.yaml in the INTEL KEEM BAY DRM DRIVER
      section instead.
      
      Link: https://lkml.kernel.org/r/20211026141902.4865-4-lukas.bulwahn@gmail.com
      Fixes: ed794057
      
       ("drm/kmb: Build files for KeemBay Display driver")
      Signed-off-by: default avatarLukas Bulwahn <lukas.bulwahn@gmail.com>
      Cc: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
      Cc: Edmund Dea <edmund.j.dea@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Joe Perches <joe@perches.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
      Cc: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
      Cc: Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Wilken Gottwalt <wilken.gottwalt@posteo.net>
      Cc: Yu Chen <chenyu56@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      65e5acbb
    • Lukas Bulwahn's avatar
      MAINTAINERS: rectify entry for HIKEY960 ONBOARD USB GPIO HUB DRIVER · b39c9206
      Lukas Bulwahn authored
      Commit 7a6ff4c4 ("misc: hisi_hikey_usb: Driver to support onboard
      USB gpio hub on Hikey960") refers to the non-existing file
      Documentation/devicetree/bindings/misc/hisilicon-hikey-usb.yaml, but
      this commit's patch series does not add any related devicetree binding
      in misc.
      
      So, just drop this file reference in HIKEY960 ONBOARD USB GPIO HUB DRIVER.
      
      Link: https://lkml.kernel.org/r/20211026141902.4865-3-lukas.bulwahn@gmail.com
      Fixes: 7a6ff4c4
      
       ("misc: hisi_hikey_usb: Driver to support onboard USB gpio hub on Hikey960")
      Signed-off-by: default avatarLukas Bulwahn <lukas.bulwahn@gmail.com>
      Cc: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
      Cc: Edmund Dea <edmund.j.dea@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Joe Perches <joe@perches.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
      Cc: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
      Cc: Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Wilken Gottwalt <wilken.gottwalt@posteo.net>
      Cc: Yu Chen <chenyu56@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b39c9206
    • Lukas Bulwahn's avatar
      MAINTAINERS: rectify entry for ARM/TOSHIBA VISCONTI ARCHITECTURE · 46bfa85f
      Lukas Bulwahn authored
      Patch series "Rectify file references for dt-bindings in MAINTAINERS", v5.
      
      A patch series that cleans up some file references for dt-bindings in
      MAINTAINERS.
      
      This patch (of 4):
      
      Commit 836863a0 ("MAINTAINERS: Add information for Toshiba Visconti
      ARM SoCs") refers to the non-existing file toshiba,tmpv7700-pinctrl.yaml
      in ./Documentation/devicetree/bindings/pinctrl/.  Commit 1825c1fe
      ("pinctrl: Add DT bindings for Toshiba Visconti TMPV7700 SoC")
      originating from the same patch series however adds the file
      toshiba,visconti-pinctrl.yaml in that directory instead.
      
      So, refer to toshiba,visconti-pinctrl.yaml in the ARM/TOSHIBA VISCONTI
      ARCHITECTURE section instead.
      
      Link: https://lkml.kernel.org/r/20211026141902.4865-1-lukas.bulwahn@gmail.com
      Link: https://lkml.kernel.org/r/20211026141902.4865-2-lukas.bulwahn@gmail.com
      Fixes: 836863a0
      
       ("MAINTAINERS: Add information for Toshiba Visconti ARM SoCs")
      Signed-off-by: default avatarLukas Bulwahn <lukas.bulwahn@gmail.com>
      Acked-by: default avatarNobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
      Reviewed-by: default avatarNobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
      Cc: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
      Cc: Wilken Gottwalt <wilken.gottwalt@posteo.net>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Cc: Yu Chen <chenyu56@huawei.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Edmund Dea <edmund.j.dea@intel.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      46bfa85f