Skip to content
Snippets Groups Projects
  1. Jun 16, 2021
    • Greg Kroah-Hartman's avatar
    • Linus Torvalds's avatar
      proc: only require mm_struct for writing · 0646b0f9
      Linus Torvalds authored
      commit 94f0b2d4 upstream.
      
      Commit 591a22c1 ("proc: Track /proc/$pid/attr/ opener mm_struct") we
      started using __mem_open() to track the mm_struct at open-time, so that
      we could then check it for writes.
      
      But that also ended up making the permission checks at open time much
      stricter - and not just for writes, but for reads too.  And that in turn
      caused a regression for at least Fedora 29, where NIC interfaces fail to
      start when using NetworkManager.
      
      Since only the write side wanted the mm_struct test, ignore any failures
      by __mem_open() at open time, leaving reads unaffected.  The write()
      time verification of the mm_struct pointer will then catch the failure
      case because a NULL pointer will not match a valid 'current->mm'.
      
      Link: https://lore.kernel.org/netdev/YMjTlp2FSJYvoyFa@unreal/
      
      
      Fixes: 591a22c1 ("proc: Track /proc/$pid/attr/ opener mm_struct")
      Reported-and-tested-by: default avatarLeon Romanovsky <leon@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Christian Brauner <christian.brauner@ubuntu.com>
      Cc: Andrea Righi <andrea.righi@canonical.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0646b0f9
    • Steven Rostedt (VMware)'s avatar
      ftrace: Do not blindly read the ip address in ftrace_bug() · 0bc62e39
      Steven Rostedt (VMware) authored
      commit 6c14133d upstream.
      
      It was reported that a bug on arm64 caused a bad ip address to be used for
      updating into a nop in ftrace_init(), but the error path (rightfully)
      returned -EINVAL and not -EFAULT, as the bug caused more than one error to
      occur. But because -EINVAL was returned, the ftrace_bug() tried to report
      what was at the location of the ip address, and read it directly. This
      caused the machine to panic, as the ip was not pointing to a valid memory
      address.
      
      Instead, read the ip address with copy_from_kernel_nofault() to safely
      access the memory, and if it faults, report that the address faulted,
      otherwise report what was in that location.
      
      Link: https://lore.kernel.org/lkml/20210607032329.28671-1-mark-pk.tsai@mediatek.com/
      
      
      
      Cc: stable@vger.kernel.org
      Fixes: 05736a42 ("ftrace: warn on failure to disable mcount callers")
      Reported-by: default avatarMark-PK Tsai <mark-pk.tsai@mediatek.com>
      Tested-by: default avatarMark-PK Tsai <mark-pk.tsai@mediatek.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0bc62e39
    • Ming Lei's avatar
      scsi: core: Only put parent device if host state differs from SHOST_CREATED · f949bb6e
      Ming Lei authored
      commit 1e0d4e62 upstream.
      
      get_device(shost->shost_gendev.parent) is called after host state has
      switched to SHOST_RUNNING. scsi_host_dev_release() shouldn't release the
      parent device if host state is still SHOST_CREATED.
      
      Link: https://lore.kernel.org/r/20210602133029.2864069-5-ming.lei@redhat.com
      
      
      Cc: Bart Van Assche <bvanassche@acm.org>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Tested-by: default avatarJohn Garry <john.garry@huawei.com>
      Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f949bb6e
    • Dai Ngo's avatar
      NFSv4: nfs4_proc_set_acl needs to restore NFS_CAP_UIDGID_NOMAP on error. · 4ec68225
      Dai Ngo authored
      
      commit f8849e20 upstream.
      
      Currently if __nfs4_proc_set_acl fails with NFS4ERR_BADOWNER it
      re-enables the idmapper by clearing NFS_CAP_UIDGID_NOMAP before
      retrying again. The NFS_CAP_UIDGID_NOMAP remains cleared even if
      the retry fails. This causes problem for subsequent setattr
      requests for v4 server that does not have idmapping configured.
      
      This patch modifies nfs4_proc_set_acl to detect NFS4ERR_BADOWNER
      and NFS4ERR_BADNAME and skips the retry, since the kernel isn't
      involved in encoding the ACEs, and return -EINVAL.
      
      Steps to reproduce the problem:
      
       # mount -o vers=4.1,sec=sys server:/export/test /tmp/mnt
       # touch /tmp/mnt/file1
       # chown 99 /tmp/mnt/file1
       # nfs4_setfacl -a A::unknown.user@xyz.com:wrtncy /tmp/mnt/file1
       Failed setxattr operation: Invalid argument
       # chown 99 /tmp/mnt/file1
       chown: changing ownership of ‘/tmp/mnt/file1’: Invalid argument
       # umount /tmp/mnt
       # mount -o vers=4.1,sec=sys server:/export/test /tmp/mnt
       # chown 99 /tmp/mnt/file1
       #
      
      v2: detect NFS4ERR_BADOWNER and NFS4ERR_BADNAME and skip retry
             in nfs4_proc_set_acl.
      Signed-off-by: default avatarDai Ngo <dai.ngo@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4ec68225
    • Paolo Bonzini's avatar
      kvm: fix previous commit for 32-bit builds · 8060cc42
      Paolo Bonzini authored
      
      commit 4422829e upstream.
      
      array_index_nospec does not work for uint64_t on 32-bit builds.
      However, the size of a memory slot must be less than 20 bits wide
      on those system, since the memory slot must fit in the user
      address space.  So just store it in an unsigned long.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8060cc42
    • Leo Yan's avatar
      perf session: Correct buffer copying when peeking events · 066f0c68
      Leo Yan authored
      
      [ Upstream commit 197eecb6 ]
      
      When peeking an event, it has a short path and a long path.  The short
      path uses the session pointer "one_mmap_addr" to directly fetch the
      event; and the long path needs to read out the event header and the
      following event data from file and fill into the buffer pointer passed
      through the argument "buf".
      
      The issue is in the long path that it copies the event header and event
      data into the same destination address which pointer "buf", this means
      the event header is overwritten.  We are just lucky to run into the
      short path in most cases, so we don't hit the issue in the long path.
      
      This patch adds the offset "hdr_sz" to the pointer "buf" when copying
      the event data, so that it can reserve the event header which can be
      used properly by its caller.
      
      Fixes: 5a52f33a ("perf session: Add perf_session__peek_event()")
      Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
      Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210605052957.1070720-1-leo.yan@linaro.org
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      066f0c68
    • Dan Carpenter's avatar
      NFS: Fix a potential NULL dereference in nfs_get_client() · fab8bfdf
      Dan Carpenter authored
      
      [ Upstream commit 09226e83 ]
      
      None of the callers are expecting NULL returns from nfs_get_client() so
      this code will lead to an Oops.  It's better to return an error
      pointer.  I expect that this is dead code so hopefully no one is
      affected.
      
      Fixes: 31434f49 ("nfs: check hostname in nfs_get_client")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      fab8bfdf
    • Marco Elver's avatar
      perf: Fix data race between pin_count increment/decrement · 668bd53c
      Marco Elver authored
      
      commit 6c605f83 upstream.
      
      KCSAN reports a data race between increment and decrement of pin_count:
      
        write to 0xffff888237c2d4e0 of 4 bytes by task 15740 on cpu 1:
         find_get_context		kernel/events/core.c:4617
         __do_sys_perf_event_open	kernel/events/core.c:12097 [inline]
         __se_sys_perf_event_open	kernel/events/core.c:11933
         ...
        read to 0xffff888237c2d4e0 of 4 bytes by task 15743 on cpu 0:
         perf_unpin_context		kernel/events/core.c:1525 [inline]
         __do_sys_perf_event_open	kernel/events/core.c:12328 [inline]
         __se_sys_perf_event_open	kernel/events/core.c:11933
         ...
      
      Because neither read-modify-write here is atomic, this can lead to one
      of the operations being lost, resulting in an inconsistent pin_count.
      Fix it by adding the missing locking in the CPU-event case.
      
      Fixes: fe4b04fa ("perf: Cure task_oncpu_function_call() races")
      Reported-by: default avatar <syzbot+142c9018f5962db69c7e@syzkaller.appspotmail.com>
      Signed-off-by: default avatarMarco Elver <elver@google.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Link: https://lkml.kernel.org/r/20210527104711.2671610-1-elver@google.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      668bd53c
    • Linyu Yuan's avatar
      usb: gadget: eem: fix wrong eem header operation · 4e0d9280
      Linyu Yuan authored
      
      commit 305f6708 upstream.
      
      when skb_clone() or skb_copy_expand() fail,
      it should pull skb with lengh indicated by header,
      or not it will read network data and check it as header.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarLinyu Yuan <linyyuan@codeaurora.com>
      Link: https://lore.kernel.org/r/20210608233547.3767-1-linyyuan@codeaurora.org
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4e0d9280
    • Johan Hovold's avatar
      USB: serial: quatech2: fix control-request directions · c6db1c0f
      Johan Hovold authored
      
      commit eb8dbe80 upstream.
      
      The direction of the pipe argument must match the request-type direction
      bit or control requests may fail depending on the host-controller-driver
      implementation.
      
      Fix the three requests which erroneously used usb_rcvctrlpipe().
      
      Fixes: f7a33e60 ("USB: serial: add quatech2 usb to serial driver")
      Cc: stable@vger.kernel.org      # 3.5
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c6db1c0f
    • Alexandre GRIVEAUX's avatar
      USB: serial: omninet: add device id for Zyxel Omni 56K Plus · d307cd08
      Alexandre GRIVEAUX authored
      
      commit fc0b3dc9 upstream.
      
      Add device id for Zyxel Omni 56K Plus modem, this modem include:
      
      USB chip:
      NetChip
      NET2888
      
      Main chip:
      901041A
      F721501APGF
      
      Another modem using the same chips is the Zyxel Omni 56K DUO/NEO,
      could be added with the right USB ID.
      
      Signed-off-by: default avatarAlexandre GRIVEAUX <agriveaux@deutnet.info>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d307cd08
    • George McCollister's avatar
      USB: serial: ftdi_sio: add NovaTech OrionMX product ID · a6cff029
      George McCollister authored
      
      commit bc96c72d upstream.
      
      Add PID for the NovaTech OrionMX so it can be automatically detected.
      
      Signed-off-by: default avatarGeorge McCollister <george.mccollister@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a6cff029
    • Marian-Cristian Rotariu's avatar
      usb: dwc3: ep0: fix NULL pointer exception · 96b74a99
      Marian-Cristian Rotariu authored
      
      commit d0088908 upstream.
      
      There is no validation of the index from dwc3_wIndex_to_dep() and we might
      be referring a non-existing ep and trigger a NULL pointer exception. In
      certain configurations we might use fewer eps and the index might wrongly
      indicate a larger ep index than existing.
      
      By adding this validation from the patch we can actually report a wrong
      index back to the caller.
      
      In our usecase we are using a composite device on an older kernel, but
      upstream might use this fix also. Unfortunately, I cannot describe the
      hardware for others to reproduce the issue as it is a proprietary
      implementation.
      
      [   82.958261] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000a4
      [   82.966891] Mem abort info:
      [   82.969663]   ESR = 0x96000006
      [   82.972703]   Exception class = DABT (current EL), IL = 32 bits
      [   82.978603]   SET = 0, FnV = 0
      [   82.981642]   EA = 0, S1PTW = 0
      [   82.984765] Data abort info:
      [   82.987631]   ISV = 0, ISS = 0x00000006
      [   82.991449]   CM = 0, WnR = 0
      [   82.994409] user pgtable: 4k pages, 39-bit VAs, pgdp = 00000000c6210ccc
      [   83.000999] [00000000000000a4] pgd=0000000053aa5003, pud=0000000053aa5003, pmd=0000000000000000
      [   83.009685] Internal error: Oops: 96000006 [#1] PREEMPT SMP
      [   83.026433] Process irq/62-dwc3 (pid: 303, stack limit = 0x000000003985154c)
      [   83.033470] CPU: 0 PID: 303 Comm: irq/62-dwc3 Not tainted 4.19.124 #1
      [   83.044836] pstate: 60000085 (nZCv daIf -PAN -UAO)
      [   83.049628] pc : dwc3_ep0_handle_feature+0x414/0x43c
      [   83.054558] lr : dwc3_ep0_interrupt+0x3b4/0xc94
      
      ...
      
      [   83.141788] Call trace:
      [   83.144227]  dwc3_ep0_handle_feature+0x414/0x43c
      [   83.148823]  dwc3_ep0_interrupt+0x3b4/0xc94
      [   83.181546] ---[ end trace aac6b5267d84c32f ]---
      
      Signed-off-by: default avatarMarian-Cristian Rotariu <marian.c.rotariu@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20210608162650.58426-1-marian.c.rotariu@gmail.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      96b74a99
    • Maciej Żenczykowski's avatar
      USB: f_ncm: ncm_bitrate (speed) is unsigned · be4c15bc
      Maciej Żenczykowski authored
      
      commit 33701397 upstream.
      
      [  190.544755] configfs-gadget gadget: notify speed -44967296
      
      This is because 4250000000 - 2**32 is -44967296.
      
      Fixes: 9f6ce424 ("usb: gadget: f_ncm.c added")
      Cc: Brooke Basile <brookebasile@gmail.com>
      Cc: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
      Cc: Felipe Balbi <balbi@kernel.org>
      Cc: Lorenzo Colitti <lorenzo@google.com>
      Cc: Yauheni Kaliuta <yauheni.kaliuta@nokia.com>
      Cc: Linux USB Mailing List <linux-usb@vger.kernel.org>
      Acked-By: default avatarLorenzo Colitti <lorenzo@google.com>
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Cc: stable <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20210608005344.3762668-1-zenczykowski@gmail.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be4c15bc
    • Alexander Kuznetsov's avatar
      cgroup1: don't allow '\n' in renaming · 5eda8a8c
      Alexander Kuznetsov authored
      
      commit b7e24eb1 upstream.
      
      cgroup_mkdir() have restriction on newline usage in names:
      $ mkdir $'/sys/fs/cgroup/cpu/test\ntest2'
      mkdir: cannot create directory
      '/sys/fs/cgroup/cpu/test\ntest2': Invalid argument
      
      But in cgroup1_rename() such check is missed.
      This allows us to make /proc/<pid>/cgroup unparsable:
      $ mkdir /sys/fs/cgroup/cpu/test
      $ mv /sys/fs/cgroup/cpu/test $'/sys/fs/cgroup/cpu/test\ntest2'
      $ echo $$ > $'/sys/fs/cgroup/cpu/test\ntest2'
      $ cat /proc/self/cgroup
      11:pids:/
      10:freezer:/
      9:hugetlb:/
      8:cpuset:/
      7:blkio:/user.slice
      6:memory:/user.slice
      5:net_cls,net_prio:/
      4:perf_event:/
      3:devices:/user.slice
      2:cpu,cpuacct:/test
      test2
      1:name=systemd:/
      0::/
      
      Signed-off-by: default avatarAlexander Kuznetsov <wwfq@yandex-team.ru>
      Reported-by: default avatarAndrey Krasichkov <buglloc@yandex-team.ru>
      Acked-by: default avatarDmitry Yakunin <zeil@yandex-team.ru>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5eda8a8c
    • Ritesh Harjani's avatar
      btrfs: return value from btrfs_mark_extent_written() in case of error · 39b6d336
      Ritesh Harjani authored
      
      commit e7b2ec3d upstream.
      
      We always return 0 even in case of an error in btrfs_mark_extent_written().
      Fix it to return proper error value in case of a failure. All callers
      handle it.
      
      CC: stable@vger.kernel.org # 4.4+
      Signed-off-by: default avatarRitesh Harjani <riteshh@linux.ibm.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      39b6d336
    • Paolo Bonzini's avatar
      kvm: avoid speculation-based attacks from out-of-range memslot accesses · 3098b863
      Paolo Bonzini authored
      
      commit da27a83f upstream.
      
      KVM's mechanism for accessing guest memory translates a guest physical
      address (gpa) to a host virtual address using the right-shifted gpa
      (also known as gfn) and a struct kvm_memory_slot.  The translation is
      performed in __gfn_to_hva_memslot using the following formula:
      
            hva = slot->userspace_addr + (gfn - slot->base_gfn) * PAGE_SIZE
      
      It is expected that gfn falls within the boundaries of the guest's
      physical memory.  However, a guest can access invalid physical addresses
      in such a way that the gfn is invalid.
      
      __gfn_to_hva_memslot is called from kvm_vcpu_gfn_to_hva_prot, which first
      retrieves a memslot through __gfn_to_memslot.  While __gfn_to_memslot
      does check that the gfn falls within the boundaries of the guest's
      physical memory or not, a CPU can speculate the result of the check and
      continue execution speculatively using an illegal gfn. The speculation
      can result in calculating an out-of-bounds hva.  If the resulting host
      virtual address is used to load another guest physical address, this
      is effectively a Spectre gadget consisting of two consecutive reads,
      the second of which is data dependent on the first.
      
      Right now it's not clear if there are any cases in which this is
      exploitable.  One interesting case was reported by the original author
      of this patch, and involves visiting guest page tables on x86.  Right
      now these are not vulnerable because the hva read goes through get_user(),
      which contains an LFENCE speculation barrier.  However, there are
      patches in progress for x86 uaccess.h to mask kernel addresses instead of
      using LFENCE; once these land, a guest could use speculation to read
      from the VMM's ring 3 address space.  Other architectures such as ARM
      already use the address masking method, and would be susceptible to
      this same kind of data-dependent access gadgets.  Therefore, this patch
      proactively protects from these attacks by masking out-of-bounds gfns
      in __gfn_to_hva_memslot, which blocks speculation of invalid hvas.
      
      Sean Christopherson noted that this patch does not cover
      kvm_read_guest_offset_cached.  This however is limited to a few bytes
      past the end of the cache, and therefore it is unlikely to be useful in
      the context of building a chain of data dependent accesses.
      
      Reported-by: default avatarArtemiy Margaritov <artemiy.margaritov@gmail.com>
      Co-developed-by: default avatarArtemiy Margaritov <artemiy.margaritov@gmail.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3098b863
    • Chris Packham's avatar
      i2c: mpc: implement erratum A-004447 workaround · 1f631a7f
      Chris Packham authored
      
      [ Upstream commit 8f0cdec8 ]
      
      The P2040/P2041 has an erratum where the normal i2c recovery mechanism
      does not work. Implement the alternative recovery mechanism documented
      in the P2040 Chip Errata Rev Q.
      
      Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      1f631a7f
    • Chris Packham's avatar
      i2c: mpc: Make use of i2c_recover_bus() · b9e6f257
      Chris Packham authored
      
      [ Upstream commit 65171b2d ]
      
      Move the existing calls of mpc_i2c_fixup() to a recovery function
      registered via bus_recovery_info. This makes it more obvious that
      recovery is supported and allows for a future where recovery is
      triggered by the i2c core.
      
      Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      b9e6f257
    • Chris Packham's avatar
      powerpc/fsl: set fsl,i2c-erratum-a004447 flag for P1010 i2c controllers · 841fd967
      Chris Packham authored
      
      [ Upstream commit 19ae697a ]
      
      The i2c controllers on the P1010 have an erratum where the documented
      scheme for i2c bus recovery will not work (A-004447). A different
      mechanism is needed which is documented in the P1010 Chip Errata Rev L.
      
      Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
      Acked-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      841fd967
    • Chris Packham's avatar
      powerpc/fsl: set fsl,i2c-erratum-a004447 flag for P2041 i2c controllers · 172df61a
      Chris Packham authored
      
      [ Upstream commit 7adc7b22 ]
      
      The i2c controllers on the P2040/P2041 have an erratum where the
      documented scheme for i2c bus recovery will not work (A-004447). A
      different mechanism is needed which is documented in the P2040 Chip
      Errata Rev Q (latest available at the time of writing).
      
      Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
      Acked-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      172df61a
    • Jiapeng Chong's avatar
      bnx2x: Fix missing error code in bnx2x_iov_init_one() · c83f4661
      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>
      c83f4661
    • Tiezhu Yang's avatar
      MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER · d069f110
      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>
      d069f110
    • Saubhik Mukherjee's avatar
      net: appletalk: cops: Fix data race in cops_probe1 · ff4aab29
      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>
      ff4aab29
    • Zong Li's avatar
      net: macb: ensure the device is available before accessing GEMGXL control registers · 13b036fe
      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>
      13b036fe
    • Dmitry Bogdanov's avatar
      scsi: target: qla2xxx: Wait for stop_phase1 at WWN removal · 94d22d54
      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>
      94d22d54
    • Matt Wang's avatar
      scsi: vmw_pvscsi: Set correct residual data length · a1054659
      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>
      a1054659
    • Zheyu Ma's avatar
      net/qla3xxx: fix schedule while atomic in ql_sem_spinlock · 9cfaf83a
      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>
      9cfaf83a
    • Dan Carpenter's avatar
      net: mdiobus: get rid of a BUG_ON() · 38fe49aa
      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>
      38fe49aa
    • Johannes Berg's avatar
      netlink: disable IRQs for netlink_lock_table() · 5f155c40
      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>
      5f155c40
    • Johannes Berg's avatar
      bonding: init notify_work earlier to avoid uninitialized use · 818298d5
      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>
      818298d5
    • Zheyu Ma's avatar
      isdn: mISDN: netjet: Fix crash in nj_probe: · 958cb107
      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>
      958cb107
    • Zou Wei's avatar
      ASoC: sti-sas: add missing MODULE_DEVICE_TABLE · 62d2083f
      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>
      62d2083f
    • Jeimon's avatar
      net/nfc/rawsock.c: fix a permission check bug · c08e0be4
      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>
      c08e0be4
    • Kees Cook's avatar
      proc: Track /proc/$pid/attr/ opener mm_struct · bd354c01
      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>
      bd354c01
  2. Jun 10, 2021
Loading