1. 02 5月, 2019 34 次提交
  2. 27 4月, 2019 6 次提交
    • G
      Linux 4.19.37 · 19bb613a
      Greg Kroah-Hartman 提交于
      19bb613a
    • W
      kernel/sysctl.c: fix out-of-bounds access when setting file-max · cdd369fe
      Will Deacon 提交于
      commit 9002b21465fa4d829edfc94a5a441005cffaa972 upstream.
      
      Commit 32a5ad9c2285 ("sysctl: handle overflow for file-max") hooked up
      min/max values for the file-max sysctl parameter via the .extra1 and
      .extra2 fields in the corresponding struct ctl_table entry.
      
      Unfortunately, the minimum value points at the global 'zero' variable,
      which is an int.  This results in a KASAN splat when accessed as a long
      by proc_doulongvec_minmax on 64-bit architectures:
      
        | BUG: KASAN: global-out-of-bounds in __do_proc_doulongvec_minmax+0x5d8/0x6a0
        | Read of size 8 at addr ffff2000133d1c20 by task systemd/1
        |
        | CPU: 0 PID: 1 Comm: systemd Not tainted 5.1.0-rc3-00012-g40b114779944 #2
        | Hardware name: linux,dummy-virt (DT)
        | Call trace:
        |  dump_backtrace+0x0/0x228
        |  show_stack+0x14/0x20
        |  dump_stack+0xe8/0x124
        |  print_address_description+0x60/0x258
        |  kasan_report+0x140/0x1a0
        |  __asan_report_load8_noabort+0x18/0x20
        |  __do_proc_doulongvec_minmax+0x5d8/0x6a0
        |  proc_doulongvec_minmax+0x4c/0x78
        |  proc_sys_call_handler.isra.19+0x144/0x1d8
        |  proc_sys_write+0x34/0x58
        |  __vfs_write+0x54/0xe8
        |  vfs_write+0x124/0x3c0
        |  ksys_write+0xbc/0x168
        |  __arm64_sys_write+0x68/0x98
        |  el0_svc_common+0x100/0x258
        |  el0_svc_handler+0x48/0xc0
        |  el0_svc+0x8/0xc
        |
        | The buggy address belongs to the variable:
        |  zero+0x0/0x40
        |
        | Memory state around the buggy address:
        |  ffff2000133d1b00: 00 00 00 00 00 00 00 00 fa fa fa fa 04 fa fa fa
        |  ffff2000133d1b80: fa fa fa fa 04 fa fa fa fa fa fa fa 04 fa fa fa
        | >ffff2000133d1c00: fa fa fa fa 04 fa fa fa fa fa fa fa 00 00 00 00
        |                                ^
        |  ffff2000133d1c80: fa fa fa fa 00 fa fa fa fa fa fa fa 00 00 00 00
        |  ffff2000133d1d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      
      Fix the splat by introducing a unsigned long 'zero_ul' and using that
      instead.
      
      Link: http://lkml.kernel.org/r/20190403153409.17307-1-will.deacon@arm.com
      Fixes: 32a5ad9c2285 ("sysctl: handle overflow for file-max")
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Acked-by: NChristian Brauner <christian@brauner.io>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Matteo Croce <mcroce@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cdd369fe
    • G
      Revert "locking/lockdep: Add debug_locks check in __lock_downgrade()" · ac54bc12
      Greg Kroah-Hartman 提交于
      This reverts commit 0e0f7b30 which was
      commit 71492580571467fb7177aade19c18ce7486267f5 upstream.
      
      Tetsuo rightly points out that the backport here is incorrect, as it
      touches the __lock_set_class function instead of the intended
      __lock_downgrade function.
      Reported-by: NTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Cc: Waiman Long <longman@redhat.com>
      Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Sasha Levin <sashal@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ac54bc12
    • L
      i2c-hid: properly terminate i2c_hid_dmi_desc_override_table[] array · 9c186256
      Linus Torvalds 提交于
      commit b59dfdaef173677b0b7e10f375226c0a1114fd20 upstream.
      
      Commit 9ee3e06610fd ("HID: i2c-hid: override HID descriptors for certain
      devices") added a new dmi_system_id quirk table to override certain HID
      report descriptors for some systems that lack them.
      
      But the table wasn't properly terminated, causing the dmi matching to
      walk off into la-la-land, and starting to treat random data as dmi
      descriptor pointers, causing boot-time oopses if you were at all
      unlucky.
      
      Terminate the array.
      
      We really should have some way to just statically check that arrays that
      should be terminated by an empty entry actually are so.  But the HID
      people really should have caught this themselves, rather than have me
      deal with an oops during the merge window.  Tssk, tssk.
      
      Cc: Julian Sax <jsbc@gmx.de>
      Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Ambrož Bizjak <abizjak.pro@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9c186256
    • K
      ASoC: rockchip: add missing INTERLEAVED PCM attribute · 52dde116
      Katsuhiro Suzuki 提交于
      commit 24d6638302b48328a58c13439276d4531af4ca7d upstream.
      
      This patch adds SNDRV_PCM_INFO_INTERLEAVED into PCM hardware info.
      Signed-off-by: NKatsuhiro Suzuki <katsuhiro@katsuster.net>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      52dde116
    • A
      tools include: Adopt linux/bits.h · a782f847
      Arnaldo Carvalho de Melo 提交于
      commit ba4aa02b417f08a0bee5e7b8ed70cac788a7c854 upstream.
      
      So that we reduce the difference of tools/include/linux/bitops.h to the
      original kernel file, include/linux/bitops.h, trying to remove the need
      to define BITS_PER_LONG, to avoid clashes with asm/bitsperlong.h.
      
      And the things removed from tools/include/linux/bitops.h are really in
      linux/bits.h, so that we can have a copy and then
      tools/perf/check_headers.sh will tell us when new stuff gets added to
      linux/bits.h so that we can check if it is useful and if any adjustment
      needs to be done to the tools/{include,arch}/ copies.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Sverdlin <alexander.sverdlin@nokia.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-y1sqyydvfzo0bjjoj4zsl562@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a782f847