1. 17 1月, 2019 28 次提交
  2. 13 1月, 2019 12 次提交
    • G
      Linux 4.19.15 · e3185123
      Greg Kroah-Hartman 提交于
      e3185123
    • I
      bnx2x: Fix NULL pointer dereference in bnx2x_del_all_vlans() on some hw · 6384c67c
      Ivan Mironov 提交于
      commit 38355a5f9a22bfa5bd5b1bb79805aca39fa53729 upstream.
      
      This happened when I tried to boot normal Fedora 29 system with latest
      available kernel (from fedora rawhide, plus some unrelated custom
      patches):
      
      	BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
      	PGD 0 P4D 0
      	Oops: 0010 [#1] SMP PTI
      	CPU: 6 PID: 1422 Comm: libvirtd Tainted: G          I       4.20.0-0.rc7.git3.hpsa2.1.fc29.x86_64 #1
      	Hardware name: HP ProLiant BL460c G6, BIOS I24 05/21/2018
      	RIP: 0010:          (null)
      	Code: Bad RIP value.
      	RSP: 0018:ffffa47ccdc9fbe0 EFLAGS: 00010246
      	RAX: 0000000000000000 RBX: 00000000000003e8 RCX: ffffa47ccdc9fbf8
      	RDX: ffffa47ccdc9fc00 RSI: ffff97d9ee7b01f8 RDI: ffff97d9f0150b80
      	RBP: ffff97d9f0150b80 R08: 0000000000000000 R09: 0000000000000000
      	R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000003
      	R13: ffff97d9ef1e53e8 R14: 0000000000000009 R15: ffff97d9f0ac6730
      	FS:  00007f4d224ef700(0000) GS:ffff97d9fa200000(0000) knlGS:0000000000000000
      	CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      	CR2: ffffffffffffffd6 CR3: 00000011ece52006 CR4: 00000000000206e0
      	Call Trace:
      	 ? bnx2x_chip_cleanup+0x195/0x610 [bnx2x]
      	 ? bnx2x_nic_unload+0x1e2/0x8f0 [bnx2x]
      	 ? bnx2x_reload_if_running+0x24/0x40 [bnx2x]
      	 ? bnx2x_set_features+0x79/0xa0 [bnx2x]
      	 ? __netdev_update_features+0x244/0x9e0
      	 ? netlink_broadcast_filtered+0x136/0x4b0
      	 ? netdev_update_features+0x22/0x60
      	 ? dev_disable_lro+0x1c/0xe0
      	 ? devinet_sysctl_forward+0x1c6/0x211
      	 ? proc_sys_call_handler+0xab/0x100
      	 ? __vfs_write+0x36/0x1a0
      	 ? rcu_read_lock_sched_held+0x79/0x80
      	 ? rcu_sync_lockdep_assert+0x2e/0x60
      	 ? __sb_start_write+0x14c/0x1b0
      	 ? vfs_write+0x159/0x1c0
      	 ? vfs_write+0xba/0x1c0
      	 ? ksys_write+0x52/0xc0
      	 ? do_syscall_64+0x60/0x1f0
      	 ? entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      After some investigation I figured out that recently added cleanup code
      tries to call VLAN filtering de-initialization function which exist only
      for newer hardware. Corresponding function pointer is not
      set (== 0) for older hardware, namely these chips:
      
      	#define CHIP_NUM_57710			0x164e
      	#define CHIP_NUM_57711			0x164f
      	#define CHIP_NUM_57711E			0x1650
      
      And I have one of those in my test system:
      
      	Broadcom Inc. and subsidiaries NetXtreme II BCM57711E 10-Gigabit PCIe [14e4:1650]
      
      Function bnx2x_init_vlan_mac_fp_objs() from
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h decides whether to
      initialize relevant pointers in bnx2x_sp_objs.vlan_obj or not.
      
      This regression was introduced after v4.20-rc7, and still exists in v4.20
      release.
      
      Fixes: 04f05230c5c13 ("bnx2x: Remove configured vlans as part of unload sequence.")
      Signed-off-by: NIvan Mironov <mironov.ivan@gmail.com>
      Signed-off-by: NIvan Mironov <mironov.ivan@gmail.com>
      Acked-by: NSudarsana Kalluru <Sudarsana.Kalluru@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6384c67c
    • N
      drm/amd/display: Fix unintialized max_bpc state values · 8e3a1c50
      Nicholas Kazlauskas 提交于
      commit 49f1c44b581b08e3289127ffe58bd208c3166701 upstream.
      
      [Why]
      If the "max bpc" isn't explicitly set in the atomic state then it
      have a value of 0. This has the correct behavior of limiting a panel
      to 8bpc in the case where the panel supports 8bpc. In the case of eDP
      panels this isn't a true assumption - there are panels that can only
      do 6bpc.
      
      Banding occurs for these displays.
      
      [How]
      Initialize the max_bpc when the connector resets to 8bpc. Also carry
      over the value when the state is duplicated.
      
      Bugzilla: https://bugs.freedesktop.org/108825
      Fixes: 307638884f72 ("drm/amd/display: Support amdgpu "max bpc" connector property")
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      8e3a1c50
    • E
      drm/rockchip: psr: do not dereference encoder before it is null checked. · 5f0ab980
      Enric Balletbo i Serra 提交于
      commit 4eda776c3cefcb1f01b2d85bd8753f67606282b5 upstream.
      
      'encoder' is dereferenced before it is null sanity checked, hence we
      potentially have a null pointer dereference bug. Instead, initialise
      drm_drv from encoder->dev->dev_private after we are sure 'encoder' is
      not null.
      
      Fixes: 5182c1a5 ("drm/rockchip: add an common abstracted PSR driver")
      Cc: stable@vger.kernel.org
      Signed-off-by: NEnric Balletbo i Serra <enric.balletbo@collabora.com>
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181013105654.11827-1-enric.balletbo@collabora.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5f0ab980
    • B
      drm/vc4: Set ->is_yuv to false when num_planes == 1 · 05a0177d
      Boris Brezillon 提交于
      commit 2b02a05bdc3a62d36e0d0b015351897109e25991 upstream.
      
      When vc4_plane_state is duplicated ->is_yuv is left assigned to its
      previous value, and we never set it back to false when switching to
      a non-YUV format.
      
      Fix that by setting ->is_yuv to false in the 'num_planes == 1' branch
      of the vc4_plane_setup_clipping_and_scaling() function.
      
      Fixes: fc04023f ("drm/vc4: Add support for YUV planes.")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181009132446.21960-1-boris.brezillon@bootlin.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      05a0177d
    • L
      drm/nouveau/drm/nouveau: Check rc from drm_dp_mst_topology_mgr_resume() · 85c8c610
      Lyude Paul 提交于
      commit b89fdf7ae8500feae1100d8b283176a44d31d698 upstream.
      
      We need to actually make sure we check this on resume since otherwise we
      won't know whether or not the topology is still there once we've
      resumed, which will cause us to still think the topology is connected
      even after it's been removed if the removal happens mid-suspend.
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      85c8c610
    • C
      lib: fix build failure in CONFIG_DEBUG_VIRTUAL test · 4f44e58a
      Christophe Leroy 提交于
      commit 10fdf838e5f540beca466e9d1325999c072e5d3f upstream.
      
      On several arches, virt_to_phys() is in io.h
      
      Build fails without it:
      
        CC      lib/test_debug_virtual.o
      lib/test_debug_virtual.c: In function 'test_debug_virtual_init':
      lib/test_debug_virtual.c:26:7: error: implicit declaration of function 'virt_to_phys' [-Werror=implicit-function-declaration]
        pa = virt_to_phys(va);
             ^
      
      Fixes: e4dace36 ("lib: add test module for CONFIG_DEBUG_VIRTUAL")
      CC: stable@vger.kernel.org
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4f44e58a
    • F
      of: __of_detach_node() - remove node from phandle cache · 8dbea644
      Frank Rowand 提交于
      commit 5801169a2ed20003f771acecf3ac00574cf10a38 upstream.
      
      Non-overlay dynamic devicetree node removal may leave the node in
      the phandle cache.  Subsequent calls to of_find_node_by_phandle()
      will incorrectly find the stale entry.  Remove the node from the
      cache.
      
      Add paranoia checks in of_find_node_by_phandle() as a second level
      of defense (do not return cached node if detached, do not add node
      to cache if detached).
      
      Fixes: 0b3ce78e ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()")
      Reported-by: NMichael Bringmann <mwb@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org # v4.17+
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8dbea644
    • F
      of: of_node_get()/of_node_put() nodes held in phandle cache · 1cb5a033
      Frank Rowand 提交于
      commit b8a9ac1a5b99a2fcbed19fd29d2d59270c281a31 upstream.
      
      The phandle cache contains struct device_node pointers.  The refcount
      of the pointers was not incremented while in the cache, allowing use
      after free error after kfree() of the node.  Add the proper increment
      and decrement of the use count.
      
      Fixes: 0b3ce78e ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()")
      Cc: stable@vger.kernel.org # v4.17+
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1cb5a033
    • L
      power: supply: olpc_battery: correct the temperature units · daa67bd5
      Lubomir Rintel 提交于
      commit ed54ffbe554f0902689fd6d1712bbacbacd11376 upstream.
      
      According to [1] and [2], the temperature values are in tenths of degree
      Celsius. Exposing the Celsius value makes the battery appear on fire:
      
        $ upower -i /org/freedesktop/UPower/devices/battery_olpc_battery
        ...
            temperature:         236.9 degrees C
      
      Tested on OLPC XO-1 and OLPC XO-1.75 laptops.
      
      [1] include/linux/power_supply.h
      [2] Documentation/power/power_supply_class.txt
      
      Fixes: fb972873 ("[BATTERY] One Laptop Per Child power/battery driver")
      Cc: stable@vger.kernel.org
      Signed-off-by: NLubomir Rintel <lkundrak@v3.sk>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      daa67bd5
    • A
      intel_th: msu: Fix an off-by-one in attribute store · f65b4d4f
      Alexander Shishkin 提交于
      commit ec5b5ad6e272d8d6b92d1007f79574919862a2d2 upstream.
      
      The 'nr_pages' attribute of the 'msc' subdevices parses a comma-separated
      list of window sizes, passed from userspace. However, there is a bug in
      the string parsing logic wherein it doesn't exclude the comma character
      from the range of characters as it consumes them. This leads to an
      out-of-bounds access given a sufficiently long list. For example:
      
      > # echo 8,8,8,8 > /sys/bus/intel_th/devices/0-msc0/nr_pages
      > ==================================================================
      > BUG: KASAN: slab-out-of-bounds in memchr+0x1e/0x40
      > Read of size 1 at addr ffff8803ffcebcd1 by task sh/825
      >
      > CPU: 3 PID: 825 Comm: npktest.sh Tainted: G        W         4.20.0-rc1+
      > Call Trace:
      >  dump_stack+0x7c/0xc0
      >  print_address_description+0x6c/0x23c
      >  ? memchr+0x1e/0x40
      >  kasan_report.cold.5+0x241/0x308
      >  memchr+0x1e/0x40
      >  nr_pages_store+0x203/0xd00 [intel_th_msu]
      
      Fix this by accounting for the comma character.
      Signed-off-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Fixes: ba82664c ("intel_th: Add Memory Storage Unit driver")
      Cc: stable@vger.kernel.org # v4.4+
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f65b4d4f
    • C
      genwqe: Fix size check · 998c3537
      Christian Borntraeger 提交于
      commit fdd669684655c07dacbdb0d753fd13833de69a33 upstream.
      
      Calling the test program genwqe_cksum with the default buffer size of
      2MB triggers the following kernel warning on s390:
      
      WARNING: CPU: 30 PID: 9311 at mm/page_alloc.c:3189 __alloc_pages_nodemask+0x45c/0xbe0
      CPU: 30 PID: 9311 Comm: genwqe_cksum Kdump: loaded Not tainted 3.10.0-957.el7.s390x #1
      task: 00000005e5d13980 ti: 00000005e7c6c000 task.ti: 00000005e7c6c000
      Krnl PSW : 0704c00180000000 00000000002780ac (__alloc_pages_nodemask+0x45c/0xbe0)
                 R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 EA:3
      Krnl GPRS: 00000000002932b8 0000000000b73d7c 0000000000000010 0000000000000009
                 0000000000000041 00000005e7c6f9b8 0000000000000001 00000000000080d0
                 0000000000000000 0000000000b70500 0000000000000001 0000000000000000
                 0000000000b70528 00000000007682c0 0000000000277df2 00000005e7c6f9a0
      Krnl Code: 000000000027809e: de7195001000	ed	1280(114,%r9),0(%r1)
      	   00000000002780a4: a774fead		brc	7,277dfe
      	  #00000000002780a8: a7f40001		brc	15,2780aa
      	  >00000000002780ac: 92011000		mvi	0(%r1),1
      	   00000000002780b0: a7f4fea7		brc	15,277dfe
      	   00000000002780b4: 9101c6b6		tm	1718(%r12),1
      	   00000000002780b8: a784ff3a		brc	8,277f2c
      	   00000000002780bc: a7f4fe2e		brc	15,277d18
      Call Trace:
      ([<0000000000277df2>] __alloc_pages_nodemask+0x1a2/0xbe0)
       [<000000000013afae>] s390_dma_alloc+0xfe/0x310
       [<000003ff8065f362>] __genwqe_alloc_consistent+0xfa/0x148 [genwqe_card]
       [<000003ff80658f7a>] genwqe_mmap+0xca/0x248 [genwqe_card]
       [<00000000002b2712>] mmap_region+0x4e2/0x778
       [<00000000002b2c54>] do_mmap+0x2ac/0x3e0
       [<0000000000292d7e>] vm_mmap_pgoff+0xd6/0x118
       [<00000000002b081c>] SyS_mmap_pgoff+0xdc/0x268
       [<00000000002b0a34>] SyS_old_mmap+0x8c/0xb0
       [<000000000074e518>] sysc_tracego+0x14/0x1e
       [<000003ffacf87dc6>] 0x3ffacf87dc6
      
      turns out the check in __genwqe_alloc_consistent uses "> MAX_ORDER"
      while the mm code uses ">= MAX_ORDER". Fix genwqe.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NFrank Haverkamp <haver@linux.vnet.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      998c3537