Skip to content
  1. Jun 16, 2021
    • Jiapeng Chong's avatar
      bnx2x: Fix missing error code in bnx2x_iov_init_one() · e862f600
      Jiapeng Chong authored
      [ Upstream commit 65161c35
      
       ]
      
      Eliminate the follow smatch warning:
      
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:1227
      bnx2x_iov_init_one() warn: missing error code 'err'.
      
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      e862f600
    • Tiezhu Yang's avatar
      MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER · 93f50351
      Tiezhu Yang authored
      [ Upstream commit 78cf0eb9 ]
      
      When update the latest mainline kernel with the following three configs,
      the kernel hangs during startup:
      
      (1) CONFIG_FUNCTION_GRAPH_TRACER=y
      (2) CONFIG_PREEMPT_TRACER=y
      (3) CONFIG_FTRACE_STARTUP_TEST=y
      
      When update the latest mainline kernel with the above two configs (1)
      and (2), the kernel starts normally, but it still hangs when execute
      the following command:
      
      echo "function_graph" > /sys/kernel/debug/tracing/current_tracer
      
      Without CONFIG_PREEMPT_TRACER=y, the above two kinds of kernel hangs
      disappeared, so it seems that CONFIG_PREEMPT_TRACER has some influences
      with function_graph tracer at the first glance.
      
      I use ejtag to find out the epc address is related with preempt_enable()
      in the file arch/mips/lib/mips-atomic.c, because function tracing can
      trace the preempt_{enable,disable} calls that are traced, replace them
      with preempt_{enable,disable}_notrace to prevent function tracing from
      going into an infinite loop, and then it can fix the kernel hang issue.
      
      By the way, it seems that this commit is a complement and improvement of
      commit f93a1a00
      
       ("MIPS: Fix crash that occurs when function tracing
      is enabled").
      
      Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      93f50351
    • Saubhik Mukherjee's avatar
      net: appletalk: cops: Fix data race in cops_probe1 · 1ca867fb
      Saubhik Mukherjee authored
      [ Upstream commit a4dd4fc6
      
       ]
      
      In cops_probe1(), there is a write to dev->base_addr after requesting an
      interrupt line and registering the interrupt handler cops_interrupt().
      The handler might be called in parallel to handle an interrupt.
      cops_interrupt() tries to read dev->base_addr leading to a potential
      data race. So write to dev->base_addr before calling request_irq().
      
      Found by Linux Driver Verification project (linuxtesting.org).
      
      Signed-off-by: default avatarSaubhik Mukherjee <saubhik.mukherjee@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      1ca867fb
    • Zong Li's avatar
      net: macb: ensure the device is available before accessing GEMGXL control registers · 4df0fc29
      Zong Li authored
      [ Upstream commit 5eff1461 ]
      
      If runtime power menagement is enabled, the gigabit ethernet PLL would
      be disabled after macb_probe(). During this period of time, the system
      would hang up if we try to access GEMGXL control registers.
      
      We can't put runtime_pm_get/runtime_pm_put/ there due to the issue of
      sleep inside atomic section (7fa2955f
      
       ("sh_eth: Fix sleeping
      function called from invalid context"). Add netif_running checking to
      ensure the device is available before accessing GEMGXL device.
      
      Changed in v2:
       - Use netif_running instead of its own flag
      
      Signed-off-by: default avatarZong Li <zong.li@sifive.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      4df0fc29
    • Dmitry Bogdanov's avatar
      scsi: target: qla2xxx: Wait for stop_phase1 at WWN removal · 81d3e493
      Dmitry Bogdanov authored
      [ Upstream commit 2ef7665d
      
       ]
      
      Target de-configuration panics at high CPU load because TPGT and WWPN can
      be removed on separate threads.
      
      TPGT removal requests a reset HBA on a separate thread and waits for reset
      complete (phase1). Due to high CPU load that HBA reset can be delayed for
      some time.
      
      WWPN removal does qlt_stop_phase2(). There it is believed that phase1 has
      already completed and thus tgt.tgt_ops is subsequently cleared. However,
      tgt.tgt_ops is needed to process incoming traffic and therefore this will
      cause one of the following panics:
      
      NIP qlt_reset+0x7c/0x220 [qla2xxx]
      LR  qlt_reset+0x68/0x220 [qla2xxx]
      Call Trace:
      0xc000003ffff63a78 (unreliable)
      qlt_handle_imm_notify+0x800/0x10c0 [qla2xxx]
      qlt_24xx_atio_pkt+0x208/0x590 [qla2xxx]
      qlt_24xx_process_atio_queue+0x33c/0x7a0 [qla2xxx]
      qla83xx_msix_atio_q+0x54/0x90 [qla2xxx]
      
      or
      
      NIP qlt_24xx_handle_abts+0xd0/0x2a0 [qla2xxx]
      LR  qlt_24xx_handle_abts+0xb4/0x2a0 [qla2xxx]
      Call Trace:
      qlt_24xx_handle_abts+0x90/0x2a0 [qla2xxx] (unreliable)
      qlt_24xx_process_atio_queue+0x500/0x7a0 [qla2xxx]
      qla83xx_msix_atio_q+0x54/0x90 [qla2xxx]
      
      or
      
      NIP qlt_create_sess+0x90/0x4e0 [qla2xxx]
      LR  qla24xx_do_nack_work+0xa8/0x180 [qla2xxx]
      Call Trace:
      0xc0000000348fba30 (unreliable)
      qla24xx_do_nack_work+0xa8/0x180 [qla2xxx]
      qla2x00_do_work+0x674/0xbf0 [qla2xxx]
      qla2x00_iocb_work_fn
      
      The patch fixes the issue by serializing qlt_stop_phase1() and
      qlt_stop_phase2() functions to make WWPN removal wait for phase1
      completion.
      
      Link: https://lore.kernel.org/r/20210415203554.27890-1-d.bogdanov@yadro.com
      Reviewed-by: default avatarRoman Bolshakov <r.bolshakov@yadro.com>
      Signed-off-by: default avatarDmitry Bogdanov <d.bogdanov@yadro.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      81d3e493
    • Matt Wang's avatar
      scsi: vmw_pvscsi: Set correct residual data length · 976894b5
      Matt Wang authored
      [ Upstream commit e662502b
      
       ]
      
      Some commands (such as INQUIRY) may return less data than the initiator
      requested. To avoid conducting useless information, set the right residual
      count to make upper layer aware of this.
      
      Before (INQUIRY PAGE 0xB0 with 128B buffer):
      
      $ sg_raw -r 128 /dev/sda 12 01 B0 00 80 00
      SCSI Status: Good
      
      Received 128 bytes of data:
       00 00 b0 00 3c 01 00 00 00 00 00 00 00 00 00 00 00 ...<............
       10 00 00 00 00 00 01 00 00 00 00 00 40 00 00 08 00 ...........@....
       20 80 00 00 00 00 00 00 00 00 00 20 00 00 00 00 00 .......... .....
       30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
       40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
       50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
       60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
       70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
      
      After:
      
      $ sg_raw -r 128 /dev/sda 12 01 B0 00 80 00
      SCSI Status: Good
      
      Received 64 bytes of data:
      00 00 b0 00 3c 01 00 00 00 00 00 00 00 00 00 00 00 ...<............
      10 00 00 00 00 00 01 00 00 00 00 00 40 00 00 08 00 ...........@....
      20 80 00 00 00 00 00 00 00 00 00 20 00 00 00 00 00 .......... .....
      30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
      
      [mkp: clarified description]
      
      Link: https://lore.kernel.org/r/03C41093-B62E-43A2-913E-CFC92F1C70C3@vmware.com
      Signed-off-by: default avatarMatt Wang <wwentao@vmware.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      976894b5
    • Zheyu Ma's avatar
      net/qla3xxx: fix schedule while atomic in ql_sem_spinlock · b0b447bc
      Zheyu Ma authored
      [ Upstream commit 13a6f315
      
       ]
      
      When calling the 'ql_sem_spinlock', the driver has already acquired the
      spin lock, so the driver should not call 'ssleep' in atomic context.
      
      This bug can be fixed by using 'mdelay' instead of 'ssleep'.
      
      The KASAN's log reveals it:
      
      [    3.238124 ] BUG: scheduling while atomic: swapper/0/1/0x00000002
      [    3.238748 ] 2 locks held by swapper/0/1:
      [    3.239151 ]  #0: ffff88810177b240 (&dev->mutex){....}-{3:3}, at:
      __device_driver_lock+0x41/0x60
      [    3.240026 ]  #1: ffff888107c60e28 (&qdev->hw_lock){....}-{2:2}, at:
      ql3xxx_probe+0x2aa/0xea0
      [    3.240873 ] Modules linked in:
      [    3.241187 ] irq event stamp: 460854
      [    3.241541 ] hardirqs last  enabled at (460853): [<ffffffff843051bf>]
      _raw_spin_unlock_irqrestore+0x4f/0x70
      [    3.242245 ] hardirqs last disabled at (460854): [<ffffffff843058ca>]
      _raw_spin_lock_irqsave+0x2a/0x70
      [    3.242245 ] softirqs last  enabled at (446076): [<ffffffff846002e4>]
      __do_softirq+0x2e4/0x4b1
      [    3.242245 ] softirqs last disabled at (446069): [<ffffffff811ba5e0>]
      irq_exit_rcu+0x100/0x110
      [    3.242245 ] Preemption disabled at:
      [    3.242245 ] [<ffffffff828ca5ba>] ql3xxx_probe+0x2aa/0xea0
      [    3.242245 ] Kernel panic - not syncing: scheduling while atomic
      [    3.242245 ] CPU: 2 PID: 1 Comm: swapper/0 Not tainted
      5.13.0-rc1-00145
      -gee7dc339169-dirty #16
      [    3.242245 ] Call Trace:
      [    3.242245 ]  dump_stack+0xba/0xf5
      [    3.242245 ]  ? ql3xxx_probe+0x1f0/0xea0
      [    3.242245 ]  panic+0x15a/0x3f2
      [    3.242245 ]  ? vprintk+0x76/0x150
      [    3.242245 ]  ? ql3xxx_probe+0x2aa/0xea0
      [    3.242245 ]  __schedule_bug+0xae/0xe0
      [    3.242245 ]  __schedule+0x72e/0xa00
      [    3.242245 ]  schedule+0x43/0xf0
      [    3.242245 ]  schedule_timeout+0x28b/0x500
      [    3.242245 ]  ? del_timer_sync+0xf0/0xf0
      [    3.242245 ]  ? msleep+0x2f/0x70
      [    3.242245 ]  msleep+0x59/0x70
      [    3.242245 ]  ql3xxx_probe+0x307/0xea0
      [    3.242245 ]  ? _raw_spin_unlock_irqrestore+0x3a/0x70
      [    3.242245 ]  ? pci_device_remove+0x110/0x110
      [    3.242245 ]  local_pci_probe+0x45/0xa0
      [    3.242245 ]  pci_device_probe+0x12b/0x1d0
      [    3.242245 ]  really_probe+0x2a9/0x610
      [    3.242245 ]  driver_probe_device+0x90/0x1d0
      [    3.242245 ]  ? mutex_lock_nested+0x1b/0x20
      [    3.242245 ]  device_driver_attach+0x68/0x70
      [    3.242245 ]  __driver_attach+0x124/0x1b0
      [    3.242245 ]  ? device_driver_attach+0x70/0x70
      [    3.242245 ]  bus_for_each_dev+0xbb/0x110
      [    3.242245 ]  ? rdinit_setup+0x45/0x45
      [    3.242245 ]  driver_attach+0x27/0x30
      [    3.242245 ]  bus_add_driver+0x1eb/0x2a0
      [    3.242245 ]  driver_register+0xa9/0x180
      [    3.242245 ]  __pci_register_driver+0x82/0x90
      [    3.242245 ]  ? yellowfin_init+0x25/0x25
      [    3.242245 ]  ql3xxx_driver_init+0x23/0x25
      [    3.242245 ]  do_one_initcall+0x7f/0x3d0
      [    3.242245 ]  ? rdinit_setup+0x45/0x45
      [    3.242245 ]  ? rcu_read_lock_sched_held+0x4f/0x80
      [    3.242245 ]  kernel_init_freeable+0x2aa/0x301
      [    3.242245 ]  ? rest_init+0x2c0/0x2c0
      [    3.242245 ]  kernel_init+0x18/0x190
      [    3.242245 ]  ? rest_init+0x2c0/0x2c0
      [    3.242245 ]  ? rest_init+0x2c0/0x2c0
      [    3.242245 ]  ret_from_fork+0x1f/0x30
      [    3.242245 ] Dumping ftrace buffer:
      [    3.242245 ]    (ftrace buffer empty)
      [    3.242245 ] Kernel Offset: disabled
      [    3.242245 ] Rebooting in 1 seconds.
      
      Reported-by: default avatarZheyu Ma <zheyuma97@gmail.com>
      Signed-off-by: default avatarZheyu Ma <zheyuma97@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      b0b447bc
    • Sergey Senozhatsky's avatar
      wq: handle VM suspension in stall detection · ec32c8ae
      Sergey Senozhatsky authored
      [ Upstream commit 940d71c6
      
       ]
      
      If VCPU is suspended (VM suspend) in wq_watchdog_timer_fn() then
      once this VCPU resumes it will see the new jiffies value, while it
      may take a while before IRQ detects PVCLOCK_GUEST_STOPPED on this
      VCPU and updates all the watchdogs via pvclock_touch_watchdogs().
      There is a small chance of misreported WQ stalls in the meantime,
      because new jiffies is time_after() old 'ts + thresh'.
      
      wq_watchdog_timer_fn()
      {
      	for_each_pool(pool, pi) {
      		if (time_after(jiffies, ts + thresh)) {
      			pr_emerg("BUG: workqueue lockup - pool");
      		}
      	}
      }
      
      Save jiffies at the beginning of this function and use that value
      for stall detection. If VM gets suspended then we continue using
      "old" jiffies value and old WQ touch timestamps. If IRQ at some
      point restarts the stall detection cycle (pvclock_touch_watchdogs())
      then old jiffies will always be before new 'ts + thresh'.
      
      Signed-off-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      ec32c8ae
    • Shakeel Butt's avatar
      cgroup: disable controllers at parse time · 455c38eb
      Shakeel Butt authored
      [ Upstream commit 45e1ba40 ]
      
      This patch effectively reverts the commit a3e72739 ("cgroup: fix
      too early usage of static_branch_disable()"). The commit 6041186a
      ("init: initialize jump labels before command line option parsing") has
      moved the jump_label_init() before parse_args() which has made the
      commit a3e72739
      
       unnecessary. On the other hand there are
      consequences of disabling the controllers later as there are subsystems
      doing the controller checks for different decisions. One such incident
      is reported [1] regarding the memory controller and its impact on memory
      reclaim code.
      
      [1] https://lore.kernel.org/linux-mm/921e53f3-4b13-aab8-4a9e-e83ff15371e4@nec.com
      
      Signed-off-by: default avatarShakeel Butt <shakeelb@google.com>
      Reported-by: default avatarNOMURA JUNICHI(野村 淳一) <junichi.nomura@nec.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Tested-by: default avatarJun'ichi Nomura <junichi.nomura@nec.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      455c38eb
    • Dan Carpenter's avatar
      net: mdiobus: get rid of a BUG_ON() · c3a362be
      Dan Carpenter authored
      [ Upstream commit 1dde47a6
      
       ]
      
      We spotted a bug recently during a review where a driver was
      unregistering a bus that wasn't registered, which would trigger this
      BUG_ON().  Let's handle that situation more gracefully, and just print
      a warning and return.
      
      Reported-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      c3a362be
    • Johannes Berg's avatar
      netlink: disable IRQs for netlink_lock_table() · 82b2ea5f
      Johannes Berg authored
      [ Upstream commit 1d482e66
      
       ]
      
      Syzbot reports that in mac80211 we have a potential deadlock
      between our "local->stop_queue_reasons_lock" (spinlock) and
      netlink's nl_table_lock (rwlock). This is because there's at
      least one situation in which we might try to send a netlink
      message with this spinlock held while it is also possible to
      take the spinlock from a hardirq context, resulting in the
      following deadlock scenario reported by lockdep:
      
             CPU0                    CPU1
             ----                    ----
        lock(nl_table_lock);
                                     local_irq_disable();
                                     lock(&local->queue_stop_reason_lock);
                                     lock(nl_table_lock);
        <Interrupt>
          lock(&local->queue_stop_reason_lock);
      
      This seems valid, we can take the queue_stop_reason_lock in
      any kind of context ("CPU0"), and call ieee80211_report_ack_skb()
      with the spinlock held and IRQs disabled ("CPU1") in some
      code path (ieee80211_do_stop() via ieee80211_free_txskb()).
      
      Short of disallowing netlink use in scenarios like these
      (which would be rather complex in mac80211's case due to
      the deep callchain), it seems the only fix for this is to
      disable IRQs while nl_table_lock is held to avoid hitting
      this scenario, this disallows the "CPU0" portion of the
      reported deadlock.
      
      Note that the writer side (netlink_table_grab()) already
      disables IRQs for this lock.
      
      Unfortunately though, this seems like a huge hammer, and
      maybe the whole netlink table locking should be reworked.
      
      Reported-by: default avatar <syzbot+69ff9dff50dcfe14ddd4@syzkaller.appspotmail.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      82b2ea5f
    • Johannes Berg's avatar
      bonding: init notify_work earlier to avoid uninitialized use · 1fb72dd4
      Johannes Berg authored
      [ Upstream commit 35d96e63
      
       ]
      
      If bond_kobj_init() or later kzalloc() in bond_alloc_slave() fail,
      then we call kobject_put() on the slave->kobj. This in turn calls
      the release function slave_kobj_release() which will always try to
      cancel_delayed_work_sync(&slave->notify_work), which shouldn't be
      done on an uninitialized work struct.
      
      Always initialize the work struct earlier to avoid problems here.
      
      Syzbot bisected this down to a completely pointless commit, some
      fault injection may have been at work here that caused the alloc
      failure in the first place, which may interact badly with bisect.
      
      Reported-by: default avatar <syzbot+bfda097c12a00c8cae67@syzkaller.appspotmail.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Acked-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      1fb72dd4
    • Zheyu Ma's avatar
      isdn: mISDN: netjet: Fix crash in nj_probe: · a0a37e44
      Zheyu Ma authored
      [ Upstream commit 9f6f8525
      
       ]
      
      'nj_setup' in netjet.c might fail with -EIO and in this case
      'card->irq' is initialized and is bigger than zero. A subsequent call to
      'nj_release' will free the irq that has not been requested.
      
      Fix this bug by deleting the previous assignment to 'card->irq' and just
      keep the assignment before 'request_irq'.
      
      The KASAN's log reveals it:
      
      [    3.354615 ] WARNING: CPU: 0 PID: 1 at kernel/irq/manage.c:1826
      free_irq+0x100/0x480
      [    3.355112 ] Modules linked in:
      [    3.355310 ] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
      5.13.0-rc1-00144-g25a1298726e #13
      [    3.355816 ] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
      rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
      [    3.356552 ] RIP: 0010:free_irq+0x100/0x480
      [    3.356820 ] Code: 6e 08 74 6f 4d 89 f4 e8 5e ac 09 00 4d 8b 74 24 18
      4d 85 f6 75 e3 e8 4f ac 09 00 8b 75 c8 48 c7 c7 78 c1 2e 85 e8 e0 cf f5
      ff <0f> 0b 48 8b 75 c0 4c 89 ff e8 72 33 0b 03 48 8b 43 40 4c 8b a0 80
      [    3.358012 ] RSP: 0000:ffffc90000017b48 EFLAGS: 00010082
      [    3.358357 ] RAX: 0000000000000000 RBX: ffff888104dc8000 RCX:
      0000000000000000
      [    3.358814 ] RDX: ffff8881003c8000 RSI: ffffffff8124a9e6 RDI:
      00000000ffffffff
      [    3.359272 ] RBP: ffffc90000017b88 R08: 0000000000000000 R09:
      0000000000000000
      [    3.359732 ] R10: ffffc900000179f0 R11: 0000000000001d04 R12:
      0000000000000000
      [    3.360195 ] R13: ffff888107dc6000 R14: ffff888107dc6928 R15:
      ffff888104dc80a8
      [    3.360652 ] FS:  0000000000000000(0000) GS:ffff88817bc00000(0000)
      knlGS:0000000000000000
      [    3.361170 ] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [    3.361538 ] CR2: 0000000000000000 CR3: 000000000582e000 CR4:
      00000000000006f0
      [    3.362003 ] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
      0000000000000000
      [    3.362175 ] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7:
      0000000000000400
      [    3.362175 ] Call Trace:
      [    3.362175 ]  nj_release+0x51/0x1e0
      [    3.362175 ]  nj_probe+0x450/0x950
      [    3.362175 ]  ? pci_device_remove+0x110/0x110
      [    3.362175 ]  local_pci_probe+0x45/0xa0
      [    3.362175 ]  pci_device_probe+0x12b/0x1d0
      [    3.362175 ]  really_probe+0x2a9/0x610
      [    3.362175 ]  driver_probe_device+0x90/0x1d0
      [    3.362175 ]  ? mutex_lock_nested+0x1b/0x20
      [    3.362175 ]  device_driver_attach+0x68/0x70
      [    3.362175 ]  __driver_attach+0x124/0x1b0
      [    3.362175 ]  ? device_driver_attach+0x70/0x70
      [    3.362175 ]  bus_for_each_dev+0xbb/0x110
      [    3.362175 ]  ? rdinit_setup+0x45/0x45
      [    3.362175 ]  driver_attach+0x27/0x30
      [    3.362175 ]  bus_add_driver+0x1eb/0x2a0
      [    3.362175 ]  driver_register+0xa9/0x180
      [    3.362175 ]  __pci_register_driver+0x82/0x90
      [    3.362175 ]  ? w6692_init+0x38/0x38
      [    3.362175 ]  nj_init+0x36/0x38
      [    3.362175 ]  do_one_initcall+0x7f/0x3d0
      [    3.362175 ]  ? rdinit_setup+0x45/0x45
      [    3.362175 ]  ? rcu_read_lock_sched_held+0x4f/0x80
      [    3.362175 ]  kernel_init_freeable+0x2aa/0x301
      [    3.362175 ]  ? rest_init+0x2c0/0x2c0
      [    3.362175 ]  kernel_init+0x18/0x190
      [    3.362175 ]  ? rest_init+0x2c0/0x2c0
      [    3.362175 ]  ? rest_init+0x2c0/0x2c0
      [    3.362175 ]  ret_from_fork+0x1f/0x30
      [    3.362175 ] Kernel panic - not syncing: panic_on_warn set ...
      [    3.362175 ] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
      5.13.0-rc1-00144-g25a1298726e #13
      [    3.362175 ] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
      rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
      [    3.362175 ] Call Trace:
      [    3.362175 ]  dump_stack+0xba/0xf5
      [    3.362175 ]  ? free_irq+0x100/0x480
      [    3.362175 ]  panic+0x15a/0x3f2
      [    3.362175 ]  ? __warn+0xf2/0x150
      [    3.362175 ]  ? free_irq+0x100/0x480
      [    3.362175 ]  __warn+0x108/0x150
      [    3.362175 ]  ? free_irq+0x100/0x480
      [    3.362175 ]  report_bug+0x119/0x1c0
      [    3.362175 ]  handle_bug+0x3b/0x80
      [    3.362175 ]  exc_invalid_op+0x18/0x70
      [    3.362175 ]  asm_exc_invalid_op+0x12/0x20
      [    3.362175 ] RIP: 0010:free_irq+0x100/0x480
      [    3.362175 ] Code: 6e 08 74 6f 4d 89 f4 e8 5e ac 09 00 4d 8b 74 24 18
      4d 85 f6 75 e3 e8 4f ac 09 00 8b 75 c8 48 c7 c7 78 c1 2e 85 e8 e0 cf f5
      ff <0f> 0b 48 8b 75 c0 4c 89 ff e8 72 33 0b 03 48 8b 43 40 4c 8b a0 80
      [    3.362175 ] RSP: 0000:ffffc90000017b48 EFLAGS: 00010082
      [    3.362175 ] RAX: 0000000000000000 RBX: ffff888104dc8000 RCX:
      0000000000000000
      [    3.362175 ] RDX: ffff8881003c8000 RSI: ffffffff8124a9e6 RDI:
      00000000ffffffff
      [    3.362175 ] RBP: ffffc90000017b88 R08: 0000000000000000 R09:
      0000000000000000
      [    3.362175 ] R10: ffffc900000179f0 R11: 0000000000001d04 R12:
      0000000000000000
      [    3.362175 ] R13: ffff888107dc6000 R14: ffff888107dc6928 R15:
      ffff888104dc80a8
      [    3.362175 ]  ? vprintk+0x76/0x150
      [    3.362175 ]  ? free_irq+0x100/0x480
      [    3.362175 ]  nj_release+0x51/0x1e0
      [    3.362175 ]  nj_probe+0x450/0x950
      [    3.362175 ]  ? pci_device_remove+0x110/0x110
      [    3.362175 ]  local_pci_probe+0x45/0xa0
      [    3.362175 ]  pci_device_probe+0x12b/0x1d0
      [    3.362175 ]  really_probe+0x2a9/0x610
      [    3.362175 ]  driver_probe_device+0x90/0x1d0
      [    3.362175 ]  ? mutex_lock_nested+0x1b/0x20
      [    3.362175 ]  device_driver_attach+0x68/0x70
      [    3.362175 ]  __driver_attach+0x124/0x1b0
      [    3.362175 ]  ? device_driver_attach+0x70/0x70
      [    3.362175 ]  bus_for_each_dev+0xbb/0x110
      [    3.362175 ]  ? rdinit_setup+0x45/0x45
      [    3.362175 ]  driver_attach+0x27/0x30
      [    3.362175 ]  bus_add_driver+0x1eb/0x2a0
      [    3.362175 ]  driver_register+0xa9/0x180
      [    3.362175 ]  __pci_register_driver+0x82/0x90
      [    3.362175 ]  ? w6692_init+0x38/0x38
      [    3.362175 ]  nj_init+0x36/0x38
      [    3.362175 ]  do_one_initcall+0x7f/0x3d0
      [    3.362175 ]  ? rdinit_setup+0x45/0x45
      [    3.362175 ]  ? rcu_read_lock_sched_held+0x4f/0x80
      [    3.362175 ]  kernel_init_freeable+0x2aa/0x301
      [    3.362175 ]  ? rest_init+0x2c0/0x2c0
      [    3.362175 ]  kernel_init+0x18/0x190
      [    3.362175 ]  ? rest_init+0x2c0/0x2c0
      [    3.362175 ]  ? rest_init+0x2c0/0x2c0
      [    3.362175 ]  ret_from_fork+0x1f/0x30
      [    3.362175 ] Dumping ftrace buffer:
      [    3.362175 ]    (ftrace buffer empty)
      [    3.362175 ] Kernel Offset: disabled
      [    3.362175 ] Rebooting in 1 seconds..
      
      Reported-by: default avatarZheyu Ma <zheyuma97@gmail.com>
      Signed-off-by: default avatarZheyu Ma <zheyuma97@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      a0a37e44
    • Zou Wei's avatar
      ASoC: sti-sas: add missing MODULE_DEVICE_TABLE · db228da6
      Zou Wei authored
      [ Upstream commit e072b267
      
       ]
      
      This patch adds missing MODULE_DEVICE_TABLE definition which generates
      correct modalias for automatic loading of this driver when it is built
      as an external module.
      
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarZou Wei <zou_wei@huawei.com>
      Link: https://lore.kernel.org/r/1620789145-14936-1-git-send-email-zou_wei@huawei.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      db228da6
    • Jeimon's avatar
      net/nfc/rawsock.c: fix a permission check bug · 38cb2e23
      Jeimon authored
      [ Upstream commit 8ab78863
      
       ]
      
      The function rawsock_create() calls a privileged function sk_alloc(), which requires a ns-aware check to check net->user_ns, i.e., ns_capable(). However, the original code checks the init_user_ns using capable(). So we replace the capable() with ns_capable().
      
      Signed-off-by: default avatarJeimon <jjjinmeng.zhou@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      38cb2e23
    • Kees Cook's avatar
      proc: Track /proc/$pid/attr/ opener mm_struct · 7e6d9c49
      Kees Cook authored
      commit 591a22c1 upstream.
      
      Commit bfb819ea
      
       ("proc: Check /proc/$pid/attr/ writes against file opener")
      tried to make sure that there could not be a confusion between the opener of
      a /proc/$pid/attr/ file and the writer. It used struct cred to make sure
      the privileges didn't change. However, there were existing cases where a more
      privileged thread was passing the opened fd to a differently privileged thread
      (during container setup). Instead, use mm_struct to track whether the opener
      and writer are still the same process. (This is what several other proc files
      already do, though for different reasons.)
      
      Reported-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
      Reported-by: default avatarAndrea Righi <andrea.righi@canonical.com>
      Tested-by: default avatarAndrea Righi <andrea.righi@canonical.com>
      Fixes: bfb819ea
      
       ("proc: Check /proc/$pid/attr/ writes against file opener")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7e6d9c49
  2. Jun 10, 2021