1. 19 Sep, 2018 1 commit
  2. 15 Sep, 2018 39 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.9.127 · 927556eb
      Greg Kroah-Hartman authored
      927556eb
    • Suzuki K Poulose's avatar
      arm64: Handle mismatched cache type · 67badb25
      Suzuki K Poulose authored
      commit 314d53d2 upstream.
      
      Track mismatches in the cache type register (CTR_EL0), other
      than the D/I min line sizes and trap user accesses if there are any.
      
      Fixes: be68a8aa ("arm64: cpufeature: Fix CTR_EL0 field definitions")
      Cc: <stable@vger.kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      67badb25
    • Suzuki K Poulose's avatar
      arm64: Fix mismatched cache line size detection · a6830095
      Suzuki K Poulose authored
      commit 4c4a39dd upstream.
      
      If there is a mismatch in the I/D min line size, we must
      always use the system wide safe value both in applications
      and in the kernel, while performing cache operations. However,
      we have been checking more bits than just the min line sizes,
      which triggers false negatives. We may need to trap the user
      accesses in such cases, but not necessarily patch the kernel.
      
      This patch fixes the check to do the right thing as advertised.
      A new capability will be added to check mismatches in other
      fields and ensure we trap the CTR accesses.
      
      Fixes: be68a8aa ("arm64: cpufeature: Fix CTR_EL0 field definitions")
      Cc: <stable@vger.kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Reported-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      a6830095
    • Ethan Lien's avatar
      btrfs: use correct compare function of dirty_metadata_bytes · d92fa5e1
      Ethan Lien authored
      commit d814a491 upstream.
      
      We use customized, nodesize batch value to update dirty_metadata_bytes.
      We should also use batch version of compare function or we will easily
      goto fast path and get false result from percpu_counter_compare().
      
      Fixes: e2d84521 ("Btrfs: use percpu counter for dirty metadata count")
      CC: stable@vger.kernel.org # 4.4+
      Signed-off-by: default avatarEthan Lien <ethanlien@synology.com>
      Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      nb: Rebased on 4.4.y ]
      Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d92fa5e1
    • Gustavo A. R. Silva's avatar
      ASoC: wm8994: Fix missing break in switch · d1f7cdc0
      Gustavo A. R. Silva authored
      commit ad0eaee6 upstream.
      
      Add missing break statement in order to prevent the code from falling
      through to the default case.
      
      Addresses-Coverity-ID: 115050 ("Missing break in switch")
      Reported-by: default avatarValdis Kletnieks <valdis.kletnieks@vt.edu>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      [Gustavo: Backported to 3.16..4.18 - Remove code comment removal]
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d1f7cdc0
    • Martin Schwidefsky's avatar
      s390/lib: use expoline for all bcr instructions · 9e9792d3
      Martin Schwidefsky authored
      commit 5eda25b1 upstream.
      
      The memove, memset, memcpy, __memset16, __memset32 and __memset64
      function have an additional indirect return branch in form of a
      "bzr" instruction. These need to use expolines as well.
      
      Cc: <stable@vger.kernel.org> # v4.17+
      Fixes: 97489e06 ("s390/lib: use expoline for indirect branches")
      Reviewed-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      9e9792d3
    • Tomas Winkler's avatar
      mei: me: allow runtime pm for platform with D0i3 · c0b80998
      Tomas Winkler authored
      commit cc365dcf upstream.
      
      >From the pci power documentation:
      "The driver itself should not call pm_runtime_allow(), though. Instead,
      it should let user space or some platform-specific code do that (user space
      can do it via sysfs as stated above)..."
      
      However, the S0ix residency cannot be reached without MEI device getting
      into low power state. Hence, for mei devices that support D0i3, it's better
      to make runtime power management mandatory and not rely on the system
      integration such as udev rules.
      This policy cannot be applied globally as some older platforms
      were found to have broken power management.
      
      Cc: <stable@vger.kernel.org> v4.13+
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
      Reviewed-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c0b80998
    • Nikolay Aleksandrov's avatar
      sch_tbf: fix two null pointer dereferences on init failure · 3d343258
      Nikolay Aleksandrov authored
      commit c2d6511e upstream.
      
      sch_tbf calls qdisc_watchdog_cancel() in both its ->reset and ->destroy
      callbacks but it may fail before the timer is initialized due to missing
      options (either not supplied by user-space or set as a default qdisc),
      also q->qdisc is used by ->reset and ->destroy so we need it initialized.
      
      Reproduce:
      $ sysctl net.core.default_qdisc=tbf
      $ ip l set ethX up
      
      Crash log:
      [  959.160172] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
      [  959.160323] IP: qdisc_reset+0xa/0x5c
      [  959.160400] PGD 59cdb067
      [  959.160401] P4D 59cdb067
      [  959.160466] PUD 59ccb067
      [  959.160532] PMD 0
      [  959.160597]
      [  959.160706] Oops: 0000 [#1] SMP
      [  959.160778] Modules linked in: sch_tbf sch_sfb sch_prio sch_netem
      [  959.160891] CPU: 2 PID: 1562 Comm: ip Not tainted 4.13.0-rc6+ #62
      [  959.160998] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
      [  959.161157] task: ffff880059c9a700 task.stack: ffff8800376d0000
      [  959.161263] RIP: 0010:qdisc_reset+0xa/0x5c
      [  959.161347] RSP: 0018:ffff8800376d3610 EFLAGS: 00010286
      [  959.161531] RAX: ffffffffa001b1dd RBX: ffff8800373a2800 RCX: 0000000000000000
      [  959.161733] RDX: ffffffff8215f160 RSI: ffffffff8215f160 RDI: 0000000000000000
      [  959.161939] RBP: ffff8800376d3618 R08: 00000000014080c0 R09: 00000000ffffffff
      [  959.162141] R10: ffff8800376d3578 R11: 0000000000000020 R12: ffffffffa001d2c0
      [  959.162343] R13: ffff880037538000 R14: 00000000ffffffff R15: 0000000000000001
      [  959.162546] FS:  00007fcc5126b740(0000) GS:ffff88005d900000(0000) knlGS:0000000000000000
      [  959.162844] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  959.163030] CR2: 0000000000000018 CR3: 000000005abc4000 CR4: 00000000000406e0
      [  959.163233] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  959.163436] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  959.163638] Call Trace:
      [  959.163788]  tbf_reset+0x19/0x64 [sch_tbf]
      [  959.163957]  qdisc_destroy+0x8b/0xe5
      [  959.164119]  qdisc_create_dflt+0x86/0x94
      [  959.164284]  ? dev_activate+0x129/0x129
      [  959.164449]  attach_one_default_qdisc+0x36/0x63
      [  959.164623]  netdev_for_each_tx_queue+0x3d/0x48
      [  959.164795]  dev_activate+0x4b/0x129
      [  959.164957]  __dev_open+0xe7/0x104
      [  959.165118]  __dev_change_flags+0xc6/0x15c
      [  959.165287]  dev_change_flags+0x25/0x59
      [  959.165451]  do_setlink+0x30c/0xb3f
      [  959.165613]  ? check_chain_key+0xb0/0xfd
      [  959.165782]  rtnl_newlink+0x3a4/0x729
      [  959.165947]  ? rtnl_newlink+0x117/0x729
      [  959.166121]  ? ns_capable_common+0xd/0xb1
      [  959.166288]  ? ns_capable+0x13/0x15
      [  959.166450]  rtnetlink_rcv_msg+0x188/0x197
      [  959.166617]  ? rcu_read_unlock+0x3e/0x5f
      [  959.166783]  ? rtnl_newlink+0x729/0x729
      [  959.166948]  netlink_rcv_skb+0x6c/0xce
      [  959.167113]  rtnetlink_rcv+0x23/0x2a
      [  959.167273]  netlink_unicast+0x103/0x181
      [  959.167439]  netlink_sendmsg+0x326/0x337
      [  959.167607]  sock_sendmsg_nosec+0x14/0x3f
      [  959.167772]  sock_sendmsg+0x29/0x2e
      [  959.167932]  ___sys_sendmsg+0x209/0x28b
      [  959.168098]  ? do_raw_spin_unlock+0xcd/0xf8
      [  959.168267]  ? _raw_spin_unlock+0x27/0x31
      [  959.168432]  ? __handle_mm_fault+0x651/0xdb1
      [  959.168602]  ? check_chain_key+0xb0/0xfd
      [  959.168773]  __sys_sendmsg+0x45/0x63
      [  959.168934]  ? __sys_sendmsg+0x45/0x63
      [  959.169100]  SyS_sendmsg+0x19/0x1b
      [  959.169260]  entry_SYSCALL_64_fastpath+0x23/0xc2
      [  959.169432] RIP: 0033:0x7fcc5097e690
      [  959.169592] RSP: 002b:00007ffd0d5c7b48 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
      [  959.169887] RAX: ffffffffffffffda RBX: ffffffff810d278c RCX: 00007fcc5097e690
      [  959.170089] RDX: 0000000000000000 RSI: 00007ffd0d5c7b90 RDI: 0000000000000003
      [  959.170292] RBP: ffff8800376d3f98 R08: 0000000000000001 R09: 0000000000000003
      [  959.170494] R10: 00007ffd0d5c7910 R11: 0000000000000246 R12: 0000000000000006
      [  959.170697] R13: 000000000066f1a0 R14: 00007ffd0d5cfc40 R15: 0000000000000000
      [  959.170900]  ? trace_hardirqs_off_caller+0xa7/0xcf
      [  959.171076] Code: 00 41 c7 84 24 14 01 00 00 00 00 00 00 41 c7 84 24
      98 00 00 00 00 00 00 00 41 5c 41 5d 41 5e 5d c3 66 66 66 66 90 55 48 89
      e5 53 <48> 8b 47 18 48 89 fb 48 8b 40 48 48 85 c0 74 02 ff d0 48 8b bb
      [  959.171637] RIP: qdisc_reset+0xa/0x5c RSP: ffff8800376d3610
      [  959.171821] CR2: 0000000000000018
      
      Fixes: 87b60cfa ("net_sched: fix error recovery at qdisc creation")
      Fixes: 0fbbeb1b ("[PKT_SCHED]: Fix missing qdisc_destroy() in qdisc_create_dflt()")
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3d343258
    • Nikolay Aleksandrov's avatar
      sch_netem: avoid null pointer deref on init failure · 977f75d5
      Nikolay Aleksandrov authored
      commit 634576a1 upstream.
      
      netem can fail in ->init due to missing options (either not supplied by
      user-space or used as a default qdisc) causing a timer->base null
      pointer deref in its ->destroy() and ->reset() callbacks.
      
      Reproduce:
      $ sysctl net.core.default_qdisc=netem
      $ ip l set ethX up
      
      Crash log:
      [ 1814.846943] BUG: unable to handle kernel NULL pointer dereference at (null)
      [ 1814.847181] IP: hrtimer_active+0x17/0x8a
      [ 1814.847270] PGD 59c34067
      [ 1814.847271] P4D 59c34067
      [ 1814.847337] PUD 37374067
      [ 1814.847403] PMD 0
      [ 1814.847468]
      [ 1814.847582] Oops: 0000 [#1] SMP
      [ 1814.847655] Modules linked in: sch_netem(O) sch_fq_codel(O)
      [ 1814.847761] CPU: 3 PID: 1573 Comm: ip Tainted: G           O 4.13.0-rc6+ #62
      [ 1814.847884] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
      [ 1814.848043] task: ffff88003723a700 task.stack: ffff88005adc8000
      [ 1814.848235] RIP: 0010:hrtimer_active+0x17/0x8a
      [ 1814.848407] RSP: 0018:ffff88005adcb590 EFLAGS: 00010246
      [ 1814.848590] RAX: 0000000000000000 RBX: ffff880058e359d8 RCX: 0000000000000000
      [ 1814.848793] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880058e359d8
      [ 1814.848998] RBP: ffff88005adcb5b0 R08: 00000000014080c0 R09: 00000000ffffffff
      [ 1814.849204] R10: ffff88005adcb660 R11: 0000000000000020 R12: 0000000000000000
      [ 1814.849410] R13: ffff880058e359d8 R14: 00000000ffffffff R15: 0000000000000001
      [ 1814.849616] FS:  00007f733bbca740(0000) GS:ffff88005d980000(0000) knlGS:0000000000000000
      [ 1814.849919] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 1814.850107] CR2: 0000000000000000 CR3: 0000000059f0d000 CR4: 00000000000406e0
      [ 1814.850313] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 1814.850518] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [ 1814.850723] Call Trace:
      [ 1814.850875]  hrtimer_try_to_cancel+0x1a/0x93
      [ 1814.851047]  hrtimer_cancel+0x15/0x20
      [ 1814.851211]  qdisc_watchdog_cancel+0x12/0x14
      [ 1814.851383]  netem_reset+0xe6/0xed [sch_netem]
      [ 1814.851561]  qdisc_destroy+0x8b/0xe5
      [ 1814.851723]  qdisc_create_dflt+0x86/0x94
      [ 1814.851890]  ? dev_activate+0x129/0x129
      [ 1814.852057]  attach_one_default_qdisc+0x36/0x63
      [ 1814.852232]  netdev_for_each_tx_queue+0x3d/0x48
      [ 1814.852406]  dev_activate+0x4b/0x129
      [ 1814.852569]  __dev_open+0xe7/0x104
      [ 1814.852730]  __dev_change_flags+0xc6/0x15c
      [ 1814.852899]  dev_change_flags+0x25/0x59
      [ 1814.853064]  do_setlink+0x30c/0xb3f
      [ 1814.853228]  ? check_chain_key+0xb0/0xfd
      [ 1814.853396]  ? check_chain_key+0xb0/0xfd
      [ 1814.853565]  rtnl_newlink+0x3a4/0x729
      [ 1814.853728]  ? rtnl_newlink+0x117/0x729
      [ 1814.853905]  ? ns_capable_common+0xd/0xb1
      [ 1814.854072]  ? ns_capable+0x13/0x15
      [ 1814.854234]  rtnetlink_rcv_msg+0x188/0x197
      [ 1814.854404]  ? rcu_read_unlock+0x3e/0x5f
      [ 1814.854572]  ? rtnl_newlink+0x729/0x729
      [ 1814.854737]  netlink_rcv_skb+0x6c/0xce
      [ 1814.854902]  rtnetlink_rcv+0x23/0x2a
      [ 1814.855064]  netlink_unicast+0x103/0x181
      [ 1814.855230]  netlink_sendmsg+0x326/0x337
      [ 1814.855398]  sock_sendmsg_nosec+0x14/0x3f
      [ 1814.855584]  sock_sendmsg+0x29/0x2e
      [ 1814.855747]  ___sys_sendmsg+0x209/0x28b
      [ 1814.855912]  ? do_raw_spin_unlock+0xcd/0xf8
      [ 1814.856082]  ? _raw_spin_unlock+0x27/0x31
      [ 1814.856251]  ? __handle_mm_fault+0x651/0xdb1
      [ 1814.856421]  ? check_chain_key+0xb0/0xfd
      [ 1814.856592]  __sys_sendmsg+0x45/0x63
      [ 1814.856755]  ? __sys_sendmsg+0x45/0x63
      [ 1814.856923]  SyS_sendmsg+0x19/0x1b
      [ 1814.857083]  entry_SYSCALL_64_fastpath+0x23/0xc2
      [ 1814.857256] RIP: 0033:0x7f733b2dd690
      [ 1814.857419] RSP: 002b:00007ffe1d3387d8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
      [ 1814.858238] RAX: ffffffffffffffda RBX: ffffffff810d278c RCX: 00007f733b2dd690
      [ 1814.858445] RDX: 0000000000000000 RSI: 00007ffe1d338820 RDI: 0000000000000003
      [ 1814.858651] RBP: ffff88005adcbf98 R08: 0000000000000001 R09: 0000000000000003
      [ 1814.858856] R10: 00007ffe1d3385a0 R11: 0000000000000246 R12: 0000000000000002
      [ 1814.859060] R13: 000000000066f1a0 R14: 00007ffe1d3408d0 R15: 0000000000000000
      [ 1814.859267]  ? trace_hardirqs_off_caller+0xa7/0xcf
      [ 1814.859446] Code: 10 55 48 89 c7 48 89 e5 e8 45 a1 fb ff 31 c0 5d c3
      31 c0 c3 66 66 66 66 90 55 48 89 e5 41 56 41 55 41 54 53 49 89 fd 49 8b
      45 30 <4c> 8b 20 41 8b 5c 24 38 31 c9 31 d2 48 c7 c7 50 8e 1d 82 41 89
      [ 1814.860022] RIP: hrtimer_active+0x17/0x8a RSP: ffff88005adcb590
      [ 1814.860214] CR2: 0000000000000000
      
      Fixes: 87b60cfa ("net_sched: fix error recovery at qdisc creation")
      Fixes: 0fbbeb1b ("[PKT_SCHED]: Fix missing qdisc_destroy() in qdisc_create_dflt()")
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      977f75d5
    • Nikolay Aleksandrov's avatar
      sch_hhf: fix null pointer dereference on init failure · bafe019d
      Nikolay Aleksandrov authored
      commit 32db864d upstream.
      
      If sch_hhf fails in its ->init() function (either due to wrong
      user-space arguments as below or memory alloc failure of hh_flows) it
      will do a null pointer deref of q->hh_flows in its ->destroy() function.
      
      To reproduce the crash:
      $ tc qdisc add dev eth0 root hhf quantum 2000000 non_hh_weight 10000000
      
      Crash log:
      [  690.654882] BUG: unable to handle kernel NULL pointer dereference at (null)
      [  690.655565] IP: hhf_destroy+0x48/0xbc
      [  690.655944] PGD 37345067
      [  690.655948] P4D 37345067
      [  690.656252] PUD 58402067
      [  690.656554] PMD 0
      [  690.656857]
      [  690.657362] Oops: 0000 [#1] SMP
      [  690.657696] Modules linked in:
      [  690.658032] CPU: 3 PID: 920 Comm: tc Not tainted 4.13.0-rc6+ #57
      [  690.658525] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
      [  690.659255] task: ffff880058578000 task.stack: ffff88005acbc000
      [  690.659747] RIP: 0010:hhf_destroy+0x48/0xbc
      [  690.660146] RSP: 0018:ffff88005acbf9e0 EFLAGS: 00010246
      [  690.660601] RAX: 0000000000000000 RBX: 0000000000000020 RCX: 0000000000000000
      [  690.661155] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffffffff821f63f0
      [  690.661710] RBP: ffff88005acbfa08 R08: ffffffff81b10a90 R09: 0000000000000000
      [  690.662267] R10: 00000000f42b7019 R11: ffff880058578000 R12: 00000000ffffffea
      [  690.662820] R13: ffff8800372f6400 R14: 0000000000000000 R15: 0000000000000000
      [  690.663769] FS:  00007f8ae5e8b740(0000) GS:ffff88005d980000(0000) knlGS:0000000000000000
      [  690.667069] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  690.667965] CR2: 0000000000000000 CR3: 0000000058523000 CR4: 00000000000406e0
      [  690.668918] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  690.669945] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  690.671003] Call Trace:
      [  690.671743]  qdisc_create+0x377/0x3fd
      [  690.672534]  tc_modify_qdisc+0x4d2/0x4fd
      [  690.673324]  rtnetlink_rcv_msg+0x188/0x197
      [  690.674204]  ? rcu_read_unlock+0x3e/0x5f
      [  690.675091]  ? rtnl_newlink+0x729/0x729
      [  690.675877]  netlink_rcv_skb+0x6c/0xce
      [  690.676648]  rtnetlink_rcv+0x23/0x2a
      [  690.677405]  netlink_unicast+0x103/0x181
      [  690.678179]  netlink_sendmsg+0x326/0x337
      [  690.678958]  sock_sendmsg_nosec+0x14/0x3f
      [  690.679743]  sock_sendmsg+0x29/0x2e
      [  690.680506]  ___sys_sendmsg+0x209/0x28b
      [  690.681283]  ? __handle_mm_fault+0xc7d/0xdb1
      [  690.681915]  ? check_chain_key+0xb0/0xfd
      [  690.682449]  __sys_sendmsg+0x45/0x63
      [  690.682954]  ? __sys_sendmsg+0x45/0x63
      [  690.683471]  SyS_sendmsg+0x19/0x1b
      [  690.683974]  entry_SYSCALL_64_fastpath+0x23/0xc2
      [  690.684516] RIP: 0033:0x7f8ae529d690
      [  690.685016] RSP: 002b:00007fff26d2d6b8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
      [  690.685931] RAX: ffffffffffffffda RBX: ffffffff810d278c RCX: 00007f8ae529d690
      [  690.686573] RDX: 0000000000000000 RSI: 00007fff26d2d700 RDI: 0000000000000003
      [  690.687047] RBP: ffff88005acbff98 R08: 0000000000000001 R09: 0000000000000000
      [  690.687519] R10: 00007fff26d2d480 R11: 0000000000000246 R12: 0000000000000002
      [  690.687996] R13: 0000000001258070 R14: 0000000000000001 R15: 0000000000000000
      [  690.688475]  ? trace_hardirqs_off_caller+0xa7/0xcf
      [  690.688887] Code: 00 00 e8 2a 02 ae ff 49 8b bc 1d 60 02 00 00 48 83
      c3 08 e8 19 02 ae ff 48 83 fb 20 75 dc 45 31 f6 4d 89 f7 4d 03 bd 20 02
      00 00 <49> 8b 07 49 39 c7 75 24 49 83 c6 10 49 81 fe 00 40 00 00 75 e1
      [  690.690200] RIP: hhf_destroy+0x48/0xbc RSP: ffff88005acbf9e0
      [  690.690636] CR2: 0000000000000000
      
      Fixes: 87b60cfa ("net_sched: fix error recovery at qdisc creation")
      Fixes: 10239edf ("net-qdisc-hhf: Heavy-Hitter Filter (HHF) qdisc")
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bafe019d
    • Nikolay Aleksandrov's avatar
      sch_multiq: fix double free on init failure · 9db519dc
      Nikolay Aleksandrov authored
      commit e89d469e upstream.
      
      The below commit added a call to ->destroy() on init failure, but multiq
      still frees ->queues on error in init, but ->queues is also freed by
      ->destroy() thus we get double free and corrupted memory.
      
      Very easy to reproduce (eth0 not multiqueue):
      $ tc qdisc add dev eth0 root multiq
      RTNETLINK answers: Operation not supported
      $ ip l add dumdum type dummy
      (crash)
      
      Trace log:
      [ 3929.467747] general protection fault: 0000 [#1] SMP
      [ 3929.468083] Modules linked in:
      [ 3929.468302] CPU: 3 PID: 967 Comm: ip Not tainted 4.13.0-rc6+ #56
      [ 3929.468625] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
      [ 3929.469124] task: ffff88003716a700 task.stack: ffff88005872c000
      [ 3929.469449] RIP: 0010:__kmalloc_track_caller+0x117/0x1be
      [ 3929.469746] RSP: 0018:ffff88005872f6a0 EFLAGS: 00010246
      [ 3929.470042] RAX: 00000000000002de RBX: 0000000058a59000 RCX: 00000000000002df
      [ 3929.470406] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff821f7020
      [ 3929.470770] RBP: ffff88005872f6e8 R08: 000000000001f010 R09: 0000000000000000
      [ 3929.471133] R10: ffff88005872f730 R11: 0000000000008cdd R12: ff006d75646d7564
      [ 3929.471496] R13: 00000000014000c0 R14: ffff88005b403c00 R15: ffff88005b403c00
      [ 3929.471869] FS:  00007f0b70480740(0000) GS:ffff88005d980000(0000) knlGS:0000000000000000
      [ 3929.472286] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 3929.472677] CR2: 00007ffcee4f3000 CR3: 0000000059d45000 CR4: 00000000000406e0
      [ 3929.473209] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 3929.474109] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [ 3929.474873] Call Trace:
      [ 3929.475337]  ? kstrdup_const+0x23/0x25
      [ 3929.475863]  kstrdup+0x2e/0x4b
      [ 3929.476338]  kstrdup_const+0x23/0x25
      [ 3929.478084]  __kernfs_new_node+0x28/0xbc
      [ 3929.478478]  kernfs_new_node+0x35/0x55
      [ 3929.478929]  kernfs_create_link+0x23/0x76
      [ 3929.479478]  sysfs_do_create_link_sd.isra.2+0x85/0xd7
      [ 3929.480096]  sysfs_create_link+0x33/0x35
      [ 3929.480649]  device_add+0x200/0x589
      [ 3929.481184]  netdev_register_kobject+0x7c/0x12f
      [ 3929.481711]  register_netdevice+0x373/0x471
      [ 3929.482174]  rtnl_newlink+0x614/0x729
      [ 3929.482610]  ? rtnl_newlink+0x17f/0x729
      [ 3929.483080]  rtnetlink_rcv_msg+0x188/0x197
      [ 3929.483533]  ? rcu_read_unlock+0x3e/0x5f
      [ 3929.483984]  ? rtnl_newlink+0x729/0x729
      [ 3929.484420]  netlink_rcv_skb+0x6c/0xce
      [ 3929.484858]  rtnetlink_rcv+0x23/0x2a
      [ 3929.485291]  netlink_unicast+0x103/0x181
      [ 3929.485735]  netlink_sendmsg+0x326/0x337
      [ 3929.486181]  sock_sendmsg_nosec+0x14/0x3f
      [ 3929.486614]  sock_sendmsg+0x29/0x2e
      [ 3929.486973]  ___sys_sendmsg+0x209/0x28b
      [ 3929.487340]  ? do_raw_spin_unlock+0xcd/0xf8
      [ 3929.487719]  ? _raw_spin_unlock+0x27/0x31
      [ 3929.488092]  ? __handle_mm_fault+0x651/0xdb1
      [ 3929.488471]  ? check_chain_key+0xb0/0xfd
      [ 3929.488847]  __sys_sendmsg+0x45/0x63
      [ 3929.489206]  ? __sys_sendmsg+0x45/0x63
      [ 3929.489576]  SyS_sendmsg+0x19/0x1b
      [ 3929.489901]  entry_SYSCALL_64_fastpath+0x23/0xc2
      [ 3929.490172] RIP: 0033:0x7f0b6fb93690
      [ 3929.490423] RSP: 002b:00007ffcee4ed588 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
      [ 3929.490881] RAX: ffffffffffffffda RBX: ffffffff810d278c RCX: 00007f0b6fb93690
      [ 3929.491198] RDX: 0000000000000000 RSI: 00007ffcee4ed5d0 RDI: 0000000000000003
      [ 3929.491521] RBP: ffff88005872ff98 R08: 0000000000000001 R09: 0000000000000000
      [ 3929.491801] R10: 00007ffcee4ed350 R11: 0000000000000246 R12: 0000000000000002
      [ 3929.492075] R13: 000000000066f1a0 R14: 00007ffcee4f5680 R15: 0000000000000000
      [ 3929.492352]  ? trace_hardirqs_off_caller+0xa7/0xcf
      [ 3929.492590] Code: 8b 45 c0 48 8b 45 b8 74 17 48 8b 4d c8 83 ca ff 44
      89 ee 4c 89 f7 e8 83 ca ff ff 49 89 c4 eb 49 49 63 56 20 48 8d 48 01 4d
      8b 06 <49> 8b 1c 14 48 89 c2 4c 89 e0 65 49 0f c7 08 0f 94 c0 83 f0 01
      [ 3929.493335] RIP: __kmalloc_track_caller+0x117/0x1be RSP: ffff88005872f6a0
      
      Fixes: 87b60cfa ("net_sched: fix error recovery at qdisc creation")
      Fixes: f07d1501 ("multiq: Further multiqueue cleanup")
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      [AmitP: Removed unused variable 'err' in multiq_init()]
      Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9db519dc
    • Nikolay Aleksandrov's avatar
      sch_htb: fix crash on init failure · 951104e4
      Nikolay Aleksandrov authored
      commit 88c2ace6 upstream.
      
      The commit below added a call to the ->destroy() callback for all qdiscs
      which failed in their ->init(), but some were not prepared for such
      change and can't handle partially initialized qdisc. HTB is one of them
      and if any error occurs before the qdisc watchdog timer and qdisc work are
      initialized then we can hit either a null ptr deref (timer->base) when
      canceling in ->destroy or lockdep error info about trying to register
      a non-static key and a stack dump. So to fix these two move the watchdog
      timer and workqueue init before anything that can err out.
      To reproduce userspace needs to send broken htb qdisc create request,
      tested with a modified tc (q_htb.c).
      
      Trace log:
      [ 2710.897602] BUG: unable to handle kernel NULL pointer dereference at (null)
      [ 2710.897977] IP: hrtimer_active+0x17/0x8a
      [ 2710.898174] PGD 58fab067
      [ 2710.898175] P4D 58fab067
      [ 2710.898353] PUD 586c0067
      [ 2710.898531] PMD 0
      [ 2710.898710]
      [ 2710.899045] Oops: 0000 [#1] SMP
      [ 2710.899232] Modules linked in:
      [ 2710.899419] CPU: 1 PID: 950 Comm: tc Not tainted 4.13.0-rc6+ #54
      [ 2710.899646] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
      [ 2710.900035] task: ffff880059ed2700 task.stack: ffff88005ad4c000
      [ 2710.900262] RIP: 0010:hrtimer_active+0x17/0x8a
      [ 2710.900467] RSP: 0018:ffff88005ad4f960 EFLAGS: 00010246
      [ 2710.900684] RAX: 0000000000000000 RBX: ffff88003701e298 RCX: 0000000000000000
      [ 2710.900933] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88003701e298
      [ 2710.901177] RBP: ffff88005ad4f980 R08: 0000000000000001 R09: 0000000000000001
      [ 2710.901419] R10: ffff88005ad4f800 R11: 0000000000000400 R12: 0000000000000000
      [ 2710.901663] R13: ffff88003701e298 R14: ffffffff822a4540 R15: ffff88005ad4fac0
      [ 2710.901907] FS:  00007f2f5e90f740(0000) GS:ffff88005d880000(0000) knlGS:0000000000000000
      [ 2710.902277] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 2710.902500] CR2: 0000000000000000 CR3: 0000000058ca3000 CR4: 00000000000406e0
      [ 2710.902744] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 2710.902977] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [ 2710.903180] Call Trace:
      [ 2710.903332]  hrtimer_try_to_cancel+0x1a/0x93
      [ 2710.903504]  hrtimer_cancel+0x15/0x20
      [ 2710.903667]  qdisc_watchdog_cancel+0x12/0x14
      [ 2710.903866]  htb_destroy+0x2e/0xf7
      [ 2710.904097]  qdisc_create+0x377/0x3fd
      [ 2710.904330]  tc_modify_qdisc+0x4d2/0x4fd
      [ 2710.904511]  rtnetlink_rcv_msg+0x188/0x197
      [ 2710.904682]  ? rcu_read_unlock+0x3e/0x5f
      [ 2710.904849]  ? rtnl_newlink+0x729/0x729
      [ 2710.905017]  netlink_rcv_skb+0x6c/0xce
      [ 2710.905183]  rtnetlink_rcv+0x23/0x2a
      [ 2710.905345]  netlink_unicast+0x103/0x181
      [ 2710.905511]  netlink_sendmsg+0x326/0x337
      [ 2710.905679]  sock_sendmsg_nosec+0x14/0x3f
      [ 2710.905847]  sock_sendmsg+0x29/0x2e
      [ 2710.906010]  ___sys_sendmsg+0x209/0x28b
      [ 2710.906176]  ? do_raw_spin_unlock+0xcd/0xf8
      [ 2710.906346]  ? _raw_spin_unlock+0x27/0x31
      [ 2710.906514]  ? __handle_mm_fault+0x651/0xdb1
      [ 2710.906685]  ? check_chain_key+0xb0/0xfd
      [ 2710.906855]  __sys_sendmsg+0x45/0x63
      [ 2710.907018]  ? __sys_sendmsg+0x45/0x63
      [ 2710.907185]  SyS_sendmsg+0x19/0x1b
      [ 2710.907344]  entry_SYSCALL_64_fastpath+0x23/0xc2
      
      Note that probably this bug goes further back because the default qdisc
      handling always calls ->destroy on init failure too.
      
      Fixes: 87b60cfa ("net_sched: fix error recovery at qdisc creation")
      Fixes: 0fbbeb1b ("[PKT_SCHED]: Fix missing qdisc_destroy() in qdisc_create_dflt()")
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      951104e4
    • Chas Williams's avatar
      Fixes: Commit 2aa6d036 ("mm: numa: avoid waiting on freed migrated pages") · 77d1a435
      Chas Williams authored
      Commit 2aa6d036 ("mm: numa: avoid waiting on freed migrated pages")
      was an incomplete backport of the upstream commit.  It is necessary to
      always reset page_nid before attempting any early exit.
      
      The original commit conflicted due to lack of commit 82b0f8c3
      ("mm: join struct fault_env and vm_fault") in 4.9 so it wasn't a clean
      application, and the change must have just gotten lost in the noise.
      Signed-off-by: default avatarChas Williams <chas3@att.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      77d1a435
    • Govindarajulu Varadarajan's avatar
      enic: do not call enic_change_mtu in enic_probe · 4438e9db
      Govindarajulu Varadarajan authored
      commit cb5c6568 upstream.
      
      In commit ab123fe0 ("enic: handle mtu change for vf properly")
      ASSERT_RTNL() is added to _enic_change_mtu() to prevent it from being
      called without rtnl held. enic_probe() calls enic_change_mtu()
      without rtnl held. At this point netdev is not registered yet.
      Remove call to enic_change_mtu and assign the mtu to netdev->mtu.
      
      Fixes: ab123fe0 ("enic: handle mtu change for vf properly")
      Signed-off-by: default avatarGovindarajulu Varadarajan <gvaradar@cisco.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4438e9db
    • Fabio Estevam's avatar
      Revert "ARM: imx_v6_v7_defconfig: Select ULPI support" · 55c6de19
      Fabio Estevam authored
      This reverts commit 72147614.
      
      This commit causes reboot to fail on imx6 wandboard, so let's
      revert it.
      
      Cc: <stable@vger.kernel.org> #4.9
      Reported-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
      Signed-off-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      55c6de19
    • Tyler Hicks's avatar
      irda: Only insert new objects into the global database via setsockopt · 18d94895
      Tyler Hicks authored
      The irda_setsockopt() function conditionally allocates memory for a new
      self->ias_object or, in some cases, reuses the existing
      self->ias_object. Existing objects were incorrectly reinserted into the
      LM_IAS database which corrupted the doubly linked list used for the
      hashbin implementation of the LM_IAS database. When combined with a
      memory leak in irda_bind(), this issue could be leveraged to create a
      use-after-free vulnerability in the hashbin list. This patch fixes the
      issue by only inserting newly allocated objects into the database.
      
      CVE-2018-6555
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
      Reviewed-by: default avatarSeth Arnold <seth.arnold@canonical.com>
      Reviewed-by: default avatarStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      18d94895
    • Tyler Hicks's avatar
      irda: Fix memory leak caused by repeated binds of irda socket · ce54bf4a
      Tyler Hicks authored
      The irda_bind() function allocates memory for self->ias_obj without
      checking to see if the socket is already bound. A userspace process
      could repeatedly bind the socket, have each new object added into the
      LM-IAS database, and lose the reference to the old object assigned to
      the socket to exhaust memory resources. This patch errors out of the
      bind operation when self->ias_obj is already assigned.
      
      CVE-2018-6554
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
      Reviewed-by: default avatarSeth Arnold <seth.arnold@canonical.com>
      Reviewed-by: default avatarStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ce54bf4a
    • Randy Dunlap's avatar
      kbuild: make missing $DEPMOD a Warning instead of an Error · a7522804
      Randy Dunlap authored
      commit 914b087f upstream.
      
      When $DEPMOD is not found, only print a warning instead of exiting
      with an error message and error status:
      
      Warning: 'make modules_install' requires /sbin/depmod. Please install it.
      This is probably in the kmod package.
      
      Change the Error to a Warning because "not all build hosts for cross
      compiling Linux are Linux systems and are able to provide a working
      port of depmod, especially at the file patch /sbin/depmod."
      
      I.e., "make modules_install" may be used to copy/install the
      loadable modules files to a target directory on a build system and
      then transferred to an embedded device where /sbin/depmod is run
      instead of it being run on the build system.
      
      Fixes: 934193a6 ("kbuild: verify that $DEPMOD is installed")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reported-by: default avatarH. Nikolaus Schaller <hns@goldelico.com>
      Cc: stable@vger.kernel.org
      Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
      Cc: Lucas De Marchi <lucas.de.marchi@gmail.com>
      Cc: Michal Marek <michal.lkml@markovi.net>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Chih-Wei Huang <cwhuang@linux.org.tw>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarMaxim Zhukov <mussitantesmortem@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a7522804
    • Juergen Gross's avatar
      x86/pae: use 64 bit atomic xchg function in native_ptep_get_and_clear · f3913ee2
      Juergen Gross authored
      commit b2d7a075 upstream.
      
      Using only 32-bit writes for the pte will result in an intermediate
      L1TF vulnerable PTE. When running as a Xen PV guest this will at once
      switch the guest to shadow mode resulting in a loss of performance.
      
      Use arch_atomic64_xchg() instead which will perform the requested
      operation atomically with all 64 bits.
      
      Some performance considerations according to:
      
      https://software.intel.com/sites/default/files/managed/ad/dc/Intel-Xeon-Scalable-Processor-throughput-latency.pdf
      
      The main number should be the latency, as there is no tight loop around
      native_ptep_get_and_clear().
      
      "lock cmpxchg8b" has a latency of 20 cycles, while "lock xchg" (with a
      memory operand) isn't mentioned in that document. "lock xadd" (with xadd
      having 3 cycles less latency than xchg) has a latency of 11, so we can
      assume a latency of 14 for "lock xchg".
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarJan Beulich <jbeulich@suse.com>
      Tested-by: default avatarJason Andryuk <jandryuk@gmail.com>
      Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      [ Atomic operations gained an arch_ prefix in 8bf705d1
      ("locking/atomic/x86: Switch atomic.h to use atomic-instrumented.h") so
      s/arch_atomic64_xchg/atomic64_xchg/ for backport.]
      Signed-off-by: default avatarJason Andryuk <jandryuk@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f3913ee2
    • Joel Fernandes (Google)'s avatar
      debugobjects: Make stack check warning more informative · 414bd73f
      Joel Fernandes (Google) authored
      commit fc91a3c4 upstream.
      
      While debugging an issue debugobject tracking warned about an annotation
      issue of an object on stack. It turned out that the issue was due to the
      object in concern being on a different stack which was due to another
      issue.
      
      Thomas suggested to print the pointers and the location of the stack for
      the currently running task. This helped to figure out that the object was
      on the wrong stack.
      
      As this is general useful information for debugging similar issues, make
      the error message more informative by printing the pointers.
      
      [ tglx: Massaged changelog ]
      Signed-off-by: default avatarJoel Fernandes (Google) <joel@joelfernandes.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarWaiman Long <longman@redhat.com>
      Acked-by: default avatarYang Shi <yang.shi@linux.alibaba.com>
      Cc: kernel-team@android.com
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: astrachan@google.com
      Link: https://lkml.kernel.org/r/20180723212531.202328-1-joel@joelfernandes.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      414bd73f
    • Eric Dumazet's avatar
      tcp: Revert "tcp: tcp_probe: use spin_lock_bh()" · 33d2811d
      Eric Dumazet authored
      commit 29869d66 upstream.
      
      This reverts commit e70ac171.
      
      jtcp_rcv_established() is in fact called with hard irq being disabled.
      
      Initial bug report from Ricardo Nabinger Sanchez [1] still needs
      to be investigated, but does not look like a TCP bug.
      
      [1] https://www.spinics.net/lists/netdev/msg420960.htmlSigned-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarkernel test robot <xiaolong.ye@intel.com>
      Cc: Ricardo Nabinger Sanchez <rnsanchez@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      33d2811d
    • Kai-Heng Feng's avatar
      drm/edid: Add 6 bpc quirk for SDC panel in Lenovo B50-80 · ee45a679
      Kai-Heng Feng authored
      commit 25da7504 upstream.
      
      Another panel that reports "DFP 1.x compliant TMDS" but it supports 6bpc
      instead of 8 bpc.
      
      Apply 6 bpc quirk for the panel to fix it.
      
      BugLink: https://bugs.launchpad.net/bugs/1788308
      Cc: <stable@vger.kernel.org> # v4.8+
      Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180823055332.7723-1-kai.heng.feng@canonical.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ee45a679
    • Marc Zyngier's avatar
      ARM: rockchip: Force CONFIG_PM on Rockchip systems · 36a7f0ad
      Marc Zyngier authored
      [ Upstream commit d1558dfd ]
      
      A number of the Rockchip-specific drivers (IOMMU, display controllers)
      are now assuming that CONFIG_PM is set, and may completely misbehave
      if that's not the case.
      
      Since there is hardly any reason for this configuration option not
      to be selected anyway, let's require it (in the same way Tegra already
      does).
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      36a7f0ad
    • Marc Zyngier's avatar
      arm64: rockchip: Force CONFIG_PM on Rockchip systems · 04a24a7d
      Marc Zyngier authored
      [ Upstream commit 7db7a8f5 ]
      
      A number of the Rockchip-specific drivers (IOMMU, display controllers)
      are now assuming that CONFIG_PM is set, and may completely misbehave
      if that's not the case.
      
      Since there is hardly any reason for this configuration option not
      to be selected anyway, let's require it (in the same way Tegra already
      does).
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      04a24a7d
    • Qu Wenruo's avatar
      btrfs: Don't remove block group that still has pinned down bytes · 1249b611
      Qu Wenruo authored
      [ Upstream commit 43794446 ]
      
      [BUG]
      Under certain KVM load and LTP tests, it is possible to hit the
      following calltrace if quota is enabled:
      
      BTRFS critical (device vda2): unable to find logical 8820195328 length 4096
      BTRFS critical (device vda2): unable to find logical 8820195328 length 4096
      
      WARNING: CPU: 0 PID: 49 at ../block/blk-core.c:172 blk_status_to_errno+0x1a/0x30
      CPU: 0 PID: 49 Comm: kworker/u2:1 Not tainted 4.12.14-15-default #1 SLE15 (unreleased)
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
      Workqueue: btrfs-endio-write btrfs_endio_write_helper [btrfs]
      task: ffff9f827b340bc0 task.stack: ffffb4f8c0304000
      RIP: 0010:blk_status_to_errno+0x1a/0x30
      Call Trace:
       submit_extent_page+0x191/0x270 [btrfs]
       ? btrfs_create_repair_bio+0x130/0x130 [btrfs]
       __do_readpage+0x2d2/0x810 [btrfs]
       ? btrfs_create_repair_bio+0x130/0x130 [btrfs]
       ? run_one_async_done+0xc0/0xc0 [btrfs]
       __extent_read_full_page+0xe7/0x100 [btrfs]
       ? run_one_async_done+0xc0/0xc0 [btrfs]
       read_extent_buffer_pages+0x1ab/0x2d0 [btrfs]
       ? run_one_async_done+0xc0/0xc0 [btrfs]
       btree_read_extent_buffer_pages+0x94/0xf0 [btrfs]
       read_tree_block+0x31/0x60 [btrfs]
       read_block_for_search.isra.35+0xf0/0x2e0 [btrfs]
       btrfs_search_slot+0x46b/0xa00 [btrfs]
       ? kmem_cache_alloc+0x1a8/0x510
       ? btrfs_get_token_32+0x5b/0x120 [btrfs]
       find_parent_nodes+0x11d/0xeb0 [btrfs]
       ? leaf_space_used+0xb8/0xd0 [btrfs]
       ? btrfs_leaf_free_space+0x49/0x90 [btrfs]
       ? btrfs_find_all_roots_safe+0x93/0x100 [btrfs]
       btrfs_find_all_roots_safe+0x93/0x100 [btrfs]
       btrfs_find_all_roots+0x45/0x60 [btrfs]
       btrfs_qgroup_trace_extent_post+0x20/0x40 [btrfs]
       btrfs_add_delayed_data_ref+0x1a3/0x1d0 [btrfs]
       btrfs_alloc_reserved_file_extent+0x38/0x40 [btrfs]
       insert_reserved_file_extent.constprop.71+0x289/0x2e0 [btrfs]
       btrfs_finish_ordered_io+0x2f4/0x7f0 [btrfs]
       ? pick_next_task_fair+0x2cd/0x530
       ? __switch_to+0x92/0x4b0
       btrfs_worker_helper+0x81/0x300 [btrfs]
       process_one_work+0x1da/0x3f0
       worker_thread+0x2b/0x3f0
       ? process_one_work+0x3f0/0x3f0
       kthread+0x11a/0x130
       ? kthread_create_on_node+0x40/0x40
       ret_from_fork+0x35/0x40
      
      BTRFS critical (device vda2): unable to find logical 8820195328 length 16384
      BTRFS: error (device vda2) in btrfs_finish_ordered_io:3023: errno=-5 IO failure
      BTRFS info (device vda2): forced readonly
      BTRFS error (device vda2): pending csums is 2887680
      
      [CAUSE]
      It's caused by race with block group auto removal:
      
      - There is a meta block group X, which has only one tree block
        The tree block belongs to fs tree 257.
      - In current transaction, some operation modified fs tree 257
        The tree block gets COWed, so the block group X is empty, and marked
        as unused, queued to be deleted.
      - Some workload (like fsync) wakes up cleaner_kthread()
        Which will call btrfs_delete_unused_bgs() to remove unused block
        groups.
        So block group X along its chunk map get removed.
      - Some delalloc work finished for fs tree 257
        Quota needs to get the original reference of the extent, which will
        read tree blocks of commit root of 257.
        Then since the chunk map gets removed, the above warning gets
        triggered.
      
      [FIX]
      Just let btrfs_delete_unused_bgs() skip block group which still has
      pinned bytes.
      
      However there is a minor side effect: currently we only queue empty
      blocks at update_block_group(), and such empty block group with pinned
      bytes won't go through update_block_group() again, such block group
      won't be removed, until it gets new extent allocated and removed.
      Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
      Reviewed-by: default avatarFilipe Manana <fdmanana@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1249b611
    • Qu Wenruo's avatar
      btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized · 93d960de
      Qu Wenruo authored
      [ Upstream commit 389305b2 ]
      
      Invalid reloc tree can cause kernel NULL pointer dereference when btrfs
      does some cleanup of the reloc roots.
      
      It turns out that fs_info::reloc_ctl can be NULL in
      btrfs_recover_relocation() as we allocate relocation control after all
      reloc roots have been verified.
      So when we hit: note, we haven't called set_reloc_control() thus
      fs_info::reloc_ctl is still NULL.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=199833Reported-by: default avatarXu Wen <wen.xu@gatech.edu>
      Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
      Tested-by: default avatarGu Jinxiang <gujx@cn.fujitsu.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      93d960de
    • Misono Tomohiro's avatar
      btrfs: replace: Reset on-disk dev stats value after replace · e22b36a3
      Misono Tomohiro authored
      [ Upstream commit 1e7e1f9e ]
      
      on-disk devs stats value is updated in btrfs_run_dev_stats(),
      which is called during commit transaction, if device->dev_stats_ccnt
      is not zero.
      
      Since current replace operation does not touch dev_stats_ccnt,
      on-disk dev stats value is not updated. Therefore "btrfs device stats"
      may return old device's value after umount/mount
      (Example: See "btrfs ins dump-t -t DEV $DEV" after btrfs/100 finish).
      
      Fix this by just incrementing dev_stats_ccnt in
      btrfs_dev_replace_finishing() when replace is succeeded and this will
      update the values.
      Signed-off-by: default avatarMisono Tomohiro <misono.tomohiro@jp.fujitsu.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e22b36a3
    • Levin Du's avatar
      clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399 · 4678c00e
      Levin Du authored
      [ Upstream commit 640332d1 ]
      
      PWM2 is commonly used to control voltage of PWM regulator of VDD_LOG in
      RK3399. On the Firefly-RK3399 board, PWM2 outputs 40 KHz square wave
      from power on and the VDD_LOG is about 0.9V. When the kernel boots
      normally into the system, the PWM2 keeps outputing PWM signal.
      
      But the kernel hangs randomly after "Starting kernel ..." line on that
      board. When it happens, PWM2 outputs high level which causes VDD_LOG
      drops to 0.4V below the normal operating voltage.
      
      By adding "pclk_rkpwm_pmu" to the rk3399_pmucru_critical_clocks array,
      PWM clock is ensured to be prepared at startup and the PWM2 output is
      normal. After repeated tests, the early boot hang is gone.
      
      This patch works on both Firefly-RK3399 and ROC-RK3399-PC boards.
      Signed-off-by: default avatarLevin Du <djw@t-chip.com.cn>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4678c00e
    • Mahesh Salgaonkar's avatar
      powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX. · 5cb80857
      Mahesh Salgaonkar authored
      [ Upstream commit 74e96bf4 ]
      
      The global mce data buffer that used to copy rtas error log is of 2048
      (RTAS_ERROR_LOG_MAX) bytes in size. Before the copy we read
      extended_log_length from rtas error log header, then use max of
      extended_log_length and RTAS_ERROR_LOG_MAX as a size of data to be copied.
      Ideally the platform (phyp) will never send extended error log with
      size > 2048. But if that happens, then we have a risk of buffer overrun
      and corruption. Fix this by using min_t instead.
      
      Fixes: d368514c ("powerpc: Fix corruption when grabbing FWNMI data")
      Reported-by: default avatarMichal Suchanek <msuchanek@suse.com>
      Signed-off-by: default avatarMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5cb80857
    • Steve French's avatar
      SMB3: Number of requests sent should be displayed for SMB3 not just CIFS · 7aed5a52
      Steve French authored
      [ Upstream commit 289131e1 ]
      
      For SMB2/SMB3 the number of requests sent was not displayed
      in /proc/fs/cifs/Stats unless CONFIG_CIFS_STATS2 was
      enabled (only number of failed requests displayed). As
      with earlier dialects, we should be displaying these
      counters if CONFIG_CIFS_STATS is enabled. They
      are important for debugging.
      
      e.g. when you cat /proc/fs/cifs/Stats (before the patch)
      Resources in use
      CIFS Session: 1
      Share (unique mount targets): 2
      SMB Request/Response Buffer: 1 Pool size: 5
      SMB Small Req/Resp Buffer: 1 Pool size: 30
      Operations (MIDs): 0
      
      0 session 0 share reconnects
      Total vfs operations: 690 maximum at one time: 2
      
      1) \\localhost\test
      SMBs: 975
      Negotiates: 0 sent 0 failed
      SessionSetups: 0 sent 0 failed
      Logoffs: 0 sent 0 failed
      TreeConnects: 0 sent 0 failed
      TreeDisconnects: 0 sent 0 failed
      Creates: 0 sent 2 failed
      Closes: 0 sent 0 failed
      Flushes: 0 sent 0 failed
      Reads: 0 sent 0 failed
      Writes: 0 sent 0 failed
      Locks: 0 sent 0 failed
      IOCTLs: 0 sent 1 failed
      Cancels: 0 sent 0 failed
      Echos: 0 sent 0 failed
      QueryDirectories: 0 sent 63 failed
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarAurelien Aptel <aaptel@suse.com>
      Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7aed5a52
    • Steve French's avatar
      smb3: fix reset of bytes read and written stats · 0da6c7d5
      Steve French authored
      [ Upstream commit c281bc0c ]
      
      echo 0 > /proc/fs/cifs/Stats is supposed to reset the stats
      but there were four (see example below) that were not reset
      (bytes read and witten, total vfs ops and max ops
      at one time).
      
      ...
      0 session 0 share reconnects
      Total vfs operations: 100 maximum at one time: 2
      
      1) \\localhost\test
      SMBs: 0
      Bytes read: 502092  Bytes written: 31457286
      TreeConnects: 0 total 0 failed
      TreeDisconnects: 0 total 0 failed
      ...
      
      This patch fixes cifs_stats_proc_write to properly reset
      those four.
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarAurelien Aptel <aaptel@suse.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0da6c7d5
    • YueHaibing's avatar
      RDS: IB: fix 'passing zero to ERR_PTR()' warning · fdb52b4f
      YueHaibing authored
      [ Upstream commit 5941923d ]
      
      Fix a static code checker warning:
       net/rds/ib_frmr.c:82 rds_ib_alloc_frmr() warn: passing zero to 'ERR_PTR'
      
      The error path for ib_alloc_mr failure should set err to PTR_ERR.
      
      Fixes: 1659185f ("RDS: IB: Support Fastreg MR (FRMR) memory registration mode")
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fdb52b4f
    • Breno Leitao's avatar
      selftests/powerpc: Kill child processes on SIGINT · 82e1e872
      Breno Leitao authored
      [ Upstream commit 7c27a26e ]
      
      There are some powerpc selftests, as tm/tm-unavailable, that run for a long
      period (>120 seconds), and if it is interrupted, as pressing CRTL-C
      (SIGINT), the foreground process (harness) dies but the child process and
      threads continue to execute (with PPID = 1 now) in background.
      
      In this case, you'd think the whole test exited, but there are remaining
      threads and processes being executed in background. Sometimes these
      zombies processes are doing annoying things, as consuming the whole CPU or
      dumping things to STDOUT.
      
      This patch fixes this problem by attaching an empty signal handler to
      SIGINT in the harness process. This handler will interrupt (EINTR) the
      parent process waitpid() call, letting the code to follow through the
      normal flow, which will kill all the processes in the child process group.
      
      This patch also fixes a typo.
      Signed-off-by: default avatarBreno Leitao <leitao@debian.org>
      Signed-off-by: default avatarGustavo Romero <gromero@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      82e1e872
    • Ian Abbott's avatar
      staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice · 50f8c8e4
      Ian Abbott authored
      [ Upstream commit e083926b ]
      
      The PFI subdevice flags indicate that the subdevice is readable and
      writeable, but that is only true for the supported "M-series" boards,
      not the older "E-series" boards.  Only set the SDF_READABLE and
      SDF_WRITABLE subdevice flags for the M-series boards.  These two flags
      are mainly for informational purposes.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      50f8c8e4
    • John Pittman's avatar
      dm kcopyd: avoid softlockup in run_complete_job · c2910ee6
      John Pittman authored
      [ Upstream commit 784c9a29 ]
      
      It was reported that softlockups occur when using dm-snapshot ontop of
      slow (rbd) storage.  E.g.:
      
      [ 4047.990647] watchdog: BUG: soft lockup - CPU#10 stuck for 22s! [kworker/10:23:26177]
      ...
      [ 4048.034151] Workqueue: kcopyd do_work [dm_mod]
      [ 4048.034156] RIP: 0010:copy_callback+0x41/0x160 [dm_snapshot]
      ...
      [ 4048.034190] Call Trace:
      [ 4048.034196]  ? __chunk_is_tracked+0x70/0x70 [dm_snapshot]
      [ 4048.034200]  run_complete_job+0x5f/0xb0 [dm_mod]
      [ 4048.034205]  process_jobs+0x91/0x220 [dm_mod]
      [ 4048.034210]  ? kcopyd_put_pages+0x40/0x40 [dm_mod]
      [ 4048.034214]  do_work+0x46/0xa0 [dm_mod]
      [ 4048.034219]  process_one_work+0x171/0x370
      [ 4048.034221]  worker_thread+0x1fc/0x3f0
      [ 4048.034224]  kthread+0xf8/0x130
      [ 4048.034226]  ? max_active_store+0x80/0x80
      [ 4048.034227]  ? kthread_bind+0x10/0x10
      [ 4048.034231]  ret_from_fork+0x35/0x40
      [ 4048.034233] Kernel panic - not syncing: softlockup: hung tasks
      
      Fix this by calling cond_resched() after run_complete_job()'s callout to
      the dm_kcopyd_notify_fn (which is dm-snap.c:copy_callback in the above
      trace).
      Signed-off-by: default avatarJohn Pittman <jpittman@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c2910ee6
    • Thomas Petazzoni's avatar
      PCI: mvebu: Fix I/O space end address calculation · e93d8210
      Thomas Petazzoni authored
      [ Upstream commit dfd0309f ]
      
      pcie->realio.end should be the address of last byte of the area,
      therefore using resource_size() of another resource is not correct, we
      must substract 1 to get the address of the last byte.
      
      Fixes: 11be6547 ("PCI: mvebu: Adapt to the new device tree layout")
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e93d8210
    • Dan Carpenter's avatar
      scsi: aic94xx: fix an error code in aic94xx_init() · c2842d10
      Dan Carpenter authored
      [ Upstream commit 0756c57b ]
      
      We accidentally return success instead of -ENOMEM on this error path.
      
      Fixes: 2908d778 ("[SCSI] aic94xx: new driver")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
      Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c2842d10
    • Hans de Goede's avatar
      ACPI / scan: Initialize status to ACPI_STA_DEFAULT · 51c84924
      Hans de Goede authored
      [ Upstream commit 5971b0c1 ]
      
      Since commit 63347db0 "ACPI / scan: Use acpi_bus_get_status() to
      initialize ACPI_TYPE_DEVICE devs" the status field of normal acpi_devices
      gets set to 0 by acpi_bus_type_and_status() and filled with its actual
      value later when acpi_add_single_object() calls acpi_bus_get_status().
      
      This means that any acpi_match_device_ids() calls in between will always
      fail with -ENOENT.
      
      We already have a workaround for this, which temporary forces status to
      ACPI_STA_DEFAULT in drivers/acpi/x86/utils.c: acpi_device_always_present()
      and the next commit in this series adds another acpi_match_device_ids()
      call between status being initialized as 0 and the acpi_bus_get_status()
      call.
      
      Rather then adding another workaround, this commit makes
      acpi_bus_type_and_status() initialize status to ACPI_STA_DEFAULT, this is
      safe to do as the only code looking at status between the initialization
      and the acpi_bus_get_status() call is those acpi_match_device_ids() calls.
      
      Note this does mean that we need to (re)set status to 0 in case the
      acpi_bus_get_status() call fails.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      51c84924
    • Stefan Haberland's avatar
      s390/dasd: fix panic for failed online processing · b84452f3
      Stefan Haberland authored
      [ Upstream commit 7c6553d4 ]
      
      Fix a panic that occurs for a device that got an error in
      dasd_eckd_check_characteristics() during online processing.
      For example the read configuration data command may have failed.
      
      If this error occurs the device is not being set online and the earlier
      invoked steps during online processing are rolled back. Therefore
      dasd_eckd_uncheck_device() is called which needs a valid private
      structure. But this pointer is not valid if
      dasd_eckd_check_characteristics() has failed.
      
      Check for a valid device->private pointer to prevent a panic.
      Reviewed-by: default avatarJan Hoeppner <hoeppner@linux.ibm.com>
      Signed-off-by: default avatarStefan Haberland <sth@linux.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b84452f3