Skip to content
  1. Dec 17, 2021
    • Antoine Tenart's avatar
      ethtool: do not perform operations on net devices being unregistered · 7c26da3b
      Antoine Tenart authored
      commit dde91ccf upstream.
      
      There is a short period between a net device starts to be unregistered
      and when it is actually gone. In that time frame ethtool operations
      could still be performed, which might end up in unwanted or undefined
      behaviours[1].
      
      Do not allow ethtool operations after a net device starts its
      unregistration. This patch targets the netlink part as the ioctl one
      isn't affected: the reference to the net device is taken and the
      operation is executed within an rtnl lock section and the net device
      won't be found after unregister.
      
      [1] For example adding Tx queues after unregister ends up in NULL
          pointer exceptions and UaFs, such as:
      
            BUG: KASAN: use-after-free in kobject_get+0x14/0x90
            Read of size 1 at addr ffff88801961248c by task ethtool/755
      
            CPU: 0 PID: 755 Comm: ethtool Not tainted 5.15.0-rc6+ #778
            Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-4.fc34 04/014
            Call Trace:
             dump_stack_lvl+0x57/0x72
             print_address_description.constprop.0+0x1f/0x140
             kasan_report.cold+0x7f/0x11b
             kobject_get+0x14/0x90
             kobject_add_internal+0x3d1/0x450
             kobject_init_and_add+0xba/0xf0
             netdev_queue_update_kobjects+0xcf/0x200
             netif_set_real_num_tx_queues+0xb4/0x310
             veth_set_channels+0x1c3/0x550
             ethnl_set_channels+0x524/0x610
      
      Fixes: 041b1c5d
      
       ("ethtool: helper functions for netlink interface")
      Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
      Link: https://lore.kernel.org/r/20211203101318.435618-1-atenart@kernel.org
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7c26da3b
    • Armin Wolf's avatar
      hwmon: (dell-smm) Fix warning on /proc/i8k creation error · 6992d8c2
      Armin Wolf authored
      commit dbd3e6ea upstream.
      
      The removal function is called regardless of whether
      /proc/i8k was created successfully or not, the later
      causing a WARN() on module removal.
      Fix that by only registering the removal function
      if /proc/i8k was created successfully.
      
      Tested on a Inspiron 3505.
      
      Fixes: 039ae585
      
       ("hwmon: Allow to compile dell-smm-hwmon driver without /proc/i8k")
      Signed-off-by: default avatarArmin Wolf <W_Armin@gmx.de>
      Acked-by: default avatarPali Rohár <pali@kernel.org>
      Link: https://lore.kernel.org/r/20211112171440.59006-1-W_Armin@gmx.de
      
      
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6992d8c2
    • Miklos Szeredi's avatar
      fuse: make sure reclaim doesn't write the inode · c31470a3
      Miklos Szeredi authored
      commit 5c791fe1
      
       upstream.
      
      In writeback cache mode mtime/ctime updates are cached, and flushed to the
      server using the ->write_inode() callback.
      
      Closing the file will result in a dirty inode being immediately written,
      but in other cases the inode can remain dirty after all references are
      dropped.  This result in the inode being written back from reclaim, which
      can deadlock on a regular allocation while the request is being served.
      
      The usual mechanisms (GFP_NOFS/PF_MEMALLOC*) don't work for FUSE, because
      serving a request involves unrelated userspace process(es).
      
      Instead do the same as for dirty pages: make sure the inode is written
      before the last reference is gone.
      
       - fallocate(2)/copy_file_range(2): these call file_update_time() or
         file_modified(), so flush the inode before returning from the call
      
       - unlink(2), link(2) and rename(2): these call fuse_update_ctime(), so
         flush the ctime directly from this helper
      
      Reported-by: default avatarchenguanyou <chenguanyou@xiaomi.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      Cc: Ed Tsai <ed.tsai@mediatek.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c31470a3
    • Bui Quang Minh's avatar
      bpf: Fix integer overflow in argument calculation for bpf_map_area_alloc · 61372543
      Bui Quang Minh authored
      commit 7dd5d437 upstream.
      
      In 32-bit architecture, the result of sizeof() is a 32-bit integer so
      the expression becomes the multiplication between 2 32-bit integer which
      can potentially leads to integer overflow. As a result,
      bpf_map_area_alloc() allocates less memory than needed.
      
      Fix this by casting 1 operand to u64.
      
      Fixes: 0d2c4f96 ("bpf: Eliminate rlimit-based memory accounting for sockmap and sockhash maps")
      Fixes: 99c51064 ("devmap: Use bpf_map_area_alloc() for allocating hash buckets")
      Fixes: 546ac1ff
      
       ("bpf: add devmap, a map for storing net device references")
      Signed-off-by: default avatarBui Quang Minh <minhquangbui99@gmail.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20210613143440.71975-1-minhquangbui99@gmail.com
      
      
      Signed-off-by: default avatarConnor O'Brien <connoro@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      61372543
    • Nikita Yushchenko's avatar
      staging: most: dim2: use device release method · 9099f351
      Nikita Yushchenko authored
      commit d445aa40 upstream.
      
      Commit 723de0f9 ("staging: most: remove device from interface
      structure") moved registration of driver-provided struct device to
      the most subsystem. This updated dim2 driver as well.
      
      However, struct device passed to register_device() becomes refcounted,
      and must not be explicitly deallocated, but must provide release method
      instead. Which is incompatible with managing it via devres.
      
      This patch makes the device structure allocated without devres, adds
      device release method, and moves device destruction there.
      
      Fixes: 723de0f9
      
       ("staging: most: remove device from interface structure")
      Signed-off-by: default avatarNikita Yushchenko <nikita.yoush@cogentembedded.com>
      Link: https://lore.kernel.org/r/20211005143448.8660-2-nikita.yoush@cogentembedded.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9099f351
    • Sean Christopherson's avatar
      KVM: x86: Ignore sparse banks size for an "all CPUs", non-sparse IPI req · ac76adc8
      Sean Christopherson authored
      commit 3244867a upstream.
      
      Do not bail early if there are no bits set in the sparse banks for a
      non-sparse, a.k.a. "all CPUs", IPI request.  Per the Hyper-V spec, it is
      legal to have a variable length of '0', e.g. VP_SET's BankContents in
      this case, if the request can be serviced without the extra info.
      
        It is possible that for a given invocation of a hypercall that does
        accept variable sized input headers that all the header input fits
        entirely within the fixed size header. In such cases the variable sized
        input header is zero-sized and the corresponding bits in the hypercall
        input should be set to zero.
      
      Bailing early results in KVM failing to send IPIs to all CPUs as expected
      by the guest.
      
      Fixes: 214ff83d
      
       ("KVM: x86: hyperv: implement PV IPI send hypercalls")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20211207220926.718794-2-seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ac76adc8
    • Chen Jun's avatar
      tracing: Fix a kmemleak false positive in tracing_map · 6f0d9d3e
      Chen Jun authored
      [ Upstream commit f25667e5 ]
      
      Doing the command:
        echo 'hist:key=common_pid.execname,common_timestamp' > /sys/kernel/debug/tracing/events/xxx/trigger
      
      Triggers many kmemleak reports:
      
      unreferenced object 0xffff0000c7ea4980 (size 128):
        comm "bash", pid 338, jiffies 4294912626 (age 9339.324s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<00000000f3469921>] kmem_cache_alloc_trace+0x4c0/0x6f0
          [<0000000054ca40c3>] hist_trigger_elt_data_alloc+0x140/0x178
          [<00000000633bd154>] tracing_map_init+0x1f8/0x268
          [<000000007e814ab9>] event_hist_trigger_func+0xca0/0x1ad0
          [<00000000bf8520ed>] trigger_process_regex+0xd4/0x128
          [<00000000f549355a>] event_trigger_write+0x7c/0x120
          [<00000000b80f898d>] vfs_write+0xc4/0x380
          [<00000000823e1055>] ksys_write+0x74/0xf8
          [<000000008a9374aa>] __arm64_sys_write+0x24/0x30
          [<0000000087124017>] do_el0_svc+0x88/0x1c0
          [<00000000efd0dcd1>] el0_svc+0x1c/0x28
          [<00000000dbfba9b3>] el0_sync_handler+0x88/0xc0
          [<00000000e7399680>] el0_sync+0x148/0x180
      unreferenced object 0xffff0000c7ea4980 (size 128):
        comm "bash", pid 338, jiffies 4294912626 (age 9339.324s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<00000000f3469921>] kmem_cache_alloc_trace+0x4c0/0x6f0
          [<0000000054ca40c3>] hist_trigger_elt_data_alloc+0x140/0x178
          [<00000000633bd154>] tracing_map_init+0x1f8/0x268
          [<000000007e814ab9>] event_hist_trigger_func+0xca0/0x1ad0
          [<00000000bf8520ed>] trigger_process_regex+0xd4/0x128
          [<00000000f549355a>] event_trigger_write+0x7c/0x120
          [<00000000b80f898d>] vfs_write+0xc4/0x380
          [<00000000823e1055>] ksys_write+0x74/0xf8
          [<000000008a9374aa>] __arm64_sys_write+0x24/0x30
          [<0000000087124017>] do_el0_svc+0x88/0x1c0
          [<00000000efd0dcd1>] el0_svc+0x1c/0x28
          [<00000000dbfba9b3>] el0_sync_handler+0x88/0xc0
          [<00000000e7399680>] el0_sync+0x148/0x180
      
      The reason is elts->pages[i] is alloced by get_zeroed_page.
      and kmemleak will not scan the area alloced by get_zeroed_page.
      The address stored in elts->pages will be regarded as leaked.
      
      That is, the elts->pages[i] will have pointers loaded onto it as well, and
      without telling kmemleak about it, those pointers will look like memory
      without a reference.
      
      To fix this, call kmemleak_alloc to tell kmemleak to scan elts->pages[i]
      
      Link: https://lkml.kernel.org/r/20211124140801.87121-1-chenjun102@huawei.com
      
      
      
      Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      6f0d9d3e
    • Perry Yuan's avatar
      drm/amd/display: add connector type check for CRC source set · f35f7f04
      Perry Yuan authored
      [ Upstream commit 2da34b7b ]
      
      [Why]
      IGT bypass test will set crc source as DPRX,and display DM didn`t check
      connection type, it run the test on the HDMI connector ,then the kernel
      will be crashed because aux->transfer is set null for HDMI connection.
      This patch will skip the invalid connection test and fix kernel crash issue.
      
      [How]
      Check the connector type while setting the pipe crc source as DPRX or
      auto,if the type is not DP or eDP, the crtc crc source will not be set
      and report error code to IGT test,IGT will show the this subtest as no
      valid crtc/connector combinations found.
      
      116.779714] [IGT] amd_bypass: starting subtest 8bpc-bypass-mode
      [ 117.730996] BUG: kernel NULL pointer dereference, address: 0000000000000000
      [ 117.731001] #PF: supervisor instruction fetch in kernel mode
      [ 117.731003] #PF: error_code(0x0010) - not-present page
      [ 117.731004] PGD 0 P4D 0
      [ 117.731006] Oops: 0010 [#1] SMP NOPTI
      [ 117.731009] CPU: 11 PID: 2428 Comm: amd_bypass Tainted: G OE 5.11.0-34-generic #36~20.04.1-Ubuntu
      [ 117.731011] Hardware name: AMD CZN/, BIOS AB.FD 09/07/2021
      [ 117.731012] RIP: 0010:0x0
      [ 117.731015] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
      [ 117.731016] RSP: 0018:ffffa8d64225bab8 EFLAGS: 00010246
      [ 117.731017] RAX: 0000000000000000 RBX: 0000000000000020 RCX: ffffa8d64225bb5e
      [ 117.731018] RDX: ffff93151d921880 RSI: ffffa8d64225bac8 RDI: ffff931511a1a9d8
      [ 117.731022] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 117.731023] CR2: ffffffffffffffd6 CR3: 000000010d5a4000 CR4: 0000000000750ee0
      [ 117.731023] PKRU: 55555554
      [ 117.731024] Call Trace:
      [ 117.731027] drm_dp_dpcd_access+0x72/0x110 [drm_kms_helper]
      [ 117.731036] drm_dp_dpcd_read+0xb7/0xf0 [drm_kms_helper]
      [ 117.731040] drm_dp_start_crc+0x38/0xb0 [drm_kms_helper]
      [ 117.731047] amdgpu_dm_crtc_set_crc_source+0x1ae/0x3e0 [amdgpu]
      [ 117.731149] crtc_crc_open+0x174/0x220 [drm]
      [ 117.731162] full_proxy_open+0x168/0x1f0
      [ 117.731165] ? open_proxy_open+0x100/0x100
      
      BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1546
      
      
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Reviewed-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
      Signed-off-by: default avatarPerry Yuan <Perry.Yuan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      f35f7f04
    • Mustapha Ghaddar's avatar
      drm/amd/display: Fix for the no Audio bug with Tiled Displays · dd3cea34
      Mustapha Ghaddar authored
      [ Upstream commit 5ceaebcd
      
       ]
      
      [WHY]
      It seems like after a series of plug/unplugs we end up in a situation
      where tiled display doesnt support Audio.
      
      [HOW]
      The issue seems to be related to when we check streams changed after an
      HPD, we should be checking the audio_struct as well to see if any of its
      values changed.
      
      Reviewed-by: default avatarJun Lei <Jun.Lei@amd.com>
      Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
      Signed-off-by: default avatarMustapha Ghaddar <mustapha.ghaddar@amd.com>
      Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      dd3cea34
    • Harshit Mogalapalli's avatar
      net: netlink: af_netlink: Prevent empty skb by adding a check on len. · dadce612
      Harshit Mogalapalli authored
      [ Upstream commit f123cffd
      
       ]
      
      Adding a check on len parameter to avoid empty skb. This prevents a
      division error in netem_enqueue function which is caused when skb->len=0
      and skb->data_len=0 in the randomized corruption step as shown below.
      
      skb->data[prandom_u32() % skb_headlen(skb)] ^= 1<<(prandom_u32() % 8);
      
      Crash Report:
      [  343.170349] netdevsim netdevsim0 netdevsim3: set [1, 0] type 2 family
      0 port 6081 - 0
      [  343.216110] netem: version 1.3
      [  343.235841] divide error: 0000 [#1] PREEMPT SMP KASAN NOPTI
      [  343.236680] CPU: 3 PID: 4288 Comm: reproducer Not tainted 5.16.0-rc1+
      [  343.237569] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
      BIOS 1.11.0-2.el7 04/01/2014
      [  343.238707] RIP: 0010:netem_enqueue+0x1590/0x33c0 [sch_netem]
      [  343.239499] Code: 89 85 58 ff ff ff e8 5f 5d e9 d3 48 8b b5 48 ff ff
      ff 8b 8d 50 ff ff ff 8b 85 58 ff ff ff 48 8b bd 70 ff ff ff 31 d2 2b 4f
      74 <f7> f1 48 b8 00 00 00 00 00 fc ff df 49 01 d5 4c 89 e9 48 c1 e9 03
      [  343.241883] RSP: 0018:ffff88800bcd7368 EFLAGS: 00010246
      [  343.242589] RAX: 00000000ba7c0a9c RBX: 0000000000000001 RCX:
      0000000000000000
      [  343.243542] RDX: 0000000000000000 RSI: ffff88800f8edb10 RDI:
      ffff88800f8eda40
      [  343.244474] RBP: ffff88800bcd7458 R08: 0000000000000000 R09:
      ffffffff94fb8445
      [  343.245403] R10: ffffffff94fb8336 R11: ffffffff94fb8445 R12:
      0000000000000000
      [  343.246355] R13: ffff88800a5a7000 R14: ffff88800a5b5800 R15:
      0000000000000020
      [  343.247291] FS:  00007fdde2bd7700(0000) GS:ffff888109780000(0000)
      knlGS:0000000000000000
      [  343.248350] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  343.249120] CR2: 00000000200000c0 CR3: 000000000ef4c000 CR4:
      00000000000006e0
      [  343.250076] Call Trace:
      [  343.250423]  <TASK>
      [  343.250713]  ? memcpy+0x4d/0x60
      [  343.251162]  ? netem_init+0xa0/0xa0 [sch_netem]
      [  343.251795]  ? __sanitizer_cov_trace_pc+0x21/0x60
      [  343.252443]  netem_enqueue+0xe28/0x33c0 [sch_netem]
      [  343.253102]  ? stack_trace_save+0x87/0xb0
      [  343.253655]  ? filter_irq_stacks+0xb0/0xb0
      [  343.254220]  ? netem_init+0xa0/0xa0 [sch_netem]
      [  343.254837]  ? __kasan_check_write+0x14/0x20
      [  343.255418]  ? _raw_spin_lock+0x88/0xd6
      [  343.255953]  dev_qdisc_enqueue+0x50/0x180
      [  343.256508]  __dev_queue_xmit+0x1a7e/0x3090
      [  343.257083]  ? netdev_core_pick_tx+0x300/0x300
      [  343.257690]  ? check_kcov_mode+0x10/0x40
      [  343.258219]  ? _raw_spin_unlock_irqrestore+0x29/0x40
      [  343.258899]  ? __kasan_init_slab_obj+0x24/0x30
      [  343.259529]  ? setup_object.isra.71+0x23/0x90
      [  343.260121]  ? new_slab+0x26e/0x4b0
      [  343.260609]  ? kasan_poison+0x3a/0x50
      [  343.261118]  ? kasan_unpoison+0x28/0x50
      [  343.261637]  ? __kasan_slab_alloc+0x71/0x90
      [  343.262214]  ? memcpy+0x4d/0x60
      [  343.262674]  ? write_comp_data+0x2f/0x90
      [  343.263209]  ? __kasan_check_write+0x14/0x20
      [  343.263802]  ? __skb_clone+0x5d6/0x840
      [  343.264329]  ? __sanitizer_cov_trace_pc+0x21/0x60
      [  343.264958]  dev_queue_xmit+0x1c/0x20
      [  343.265470]  netlink_deliver_tap+0x652/0x9c0
      [  343.266067]  netlink_unicast+0x5a0/0x7f0
      [  343.266608]  ? netlink_attachskb+0x860/0x860
      [  343.267183]  ? __sanitizer_cov_trace_pc+0x21/0x60
      [  343.267820]  ? write_comp_data+0x2f/0x90
      [  343.268367]  netlink_sendmsg+0x922/0xe80
      [  343.268899]  ? netlink_unicast+0x7f0/0x7f0
      [  343.269472]  ? __sanitizer_cov_trace_pc+0x21/0x60
      [  343.270099]  ? write_comp_data+0x2f/0x90
      [  343.270644]  ? netlink_unicast+0x7f0/0x7f0
      [  343.271210]  sock_sendmsg+0x155/0x190
      [  343.271721]  ____sys_sendmsg+0x75f/0x8f0
      [  343.272262]  ? kernel_sendmsg+0x60/0x60
      [  343.272788]  ? write_comp_data+0x2f/0x90
      [  343.273332]  ? write_comp_data+0x2f/0x90
      [  343.273869]  ___sys_sendmsg+0x10f/0x190
      [  343.274405]  ? sendmsg_copy_msghdr+0x80/0x80
      [  343.274984]  ? slab_post_alloc_hook+0x70/0x230
      [  343.275597]  ? futex_wait_setup+0x240/0x240
      [  343.276175]  ? security_file_alloc+0x3e/0x170
      [  343.276779]  ? write_comp_data+0x2f/0x90
      [  343.277313]  ? __sanitizer_cov_trace_pc+0x21/0x60
      [  343.277969]  ? write_comp_data+0x2f/0x90
      [  343.278515]  ? __fget_files+0x1ad/0x260
      [  343.279048]  ? __sanitizer_cov_trace_pc+0x21/0x60
      [  343.279685]  ? write_comp_data+0x2f/0x90
      [  343.280234]  ? __sanitizer_cov_trace_pc+0x21/0x60
      [  343.280874]  ? sockfd_lookup_light+0xd1/0x190
      [  343.281481]  __sys_sendmsg+0x118/0x200
      [  343.281998]  ? __sys_sendmsg_sock+0x40/0x40
      [  343.282578]  ? alloc_fd+0x229/0x5e0
      [  343.283070]  ? write_comp_data+0x2f/0x90
      [  343.283610]  ? write_comp_data+0x2f/0x90
      [  343.284135]  ? __sanitizer_cov_trace_pc+0x21/0x60
      [  343.284776]  ? ktime_get_coarse_real_ts64+0xb8/0xf0
      [  343.285450]  __x64_sys_sendmsg+0x7d/0xc0
      [  343.285981]  ? syscall_enter_from_user_mode+0x4d/0x70
      [  343.286664]  do_syscall_64+0x3a/0x80
      [  343.287158]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [  343.287850] RIP: 0033:0x7fdde24cf289
      [  343.288344] Code: 01 00 48 81 c4 80 00 00 00 e9 f1 fe ff ff 0f 1f 00
      48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f
      05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d b7 db 2c 00 f7 d8 64 89 01 48
      [  343.290729] RSP: 002b:00007fdde2bd6d98 EFLAGS: 00000246 ORIG_RAX:
      000000000000002e
      [  343.291730] RAX: ffffffffffffffda RBX: 0000000000000000 RCX:
      00007fdde24cf289
      [  343.292673] RDX: 0000000000000000 RSI: 00000000200000c0 RDI:
      0000000000000004
      [  343.293618] RBP: 00007fdde2bd6e20 R08: 0000000100000001 R09:
      0000000000000000
      [  343.294557] R10: 0000000100000001 R11: 0000000000000246 R12:
      0000000000000000
      [  343.295493] R13: 0000000000021000 R14: 0000000000000000 R15:
      00007fdde2bd7700
      [  343.296432]  </TASK>
      [  343.296735] Modules linked in: sch_netem ip6_vti ip_vti ip_gre ipip
      sit ip_tunnel geneve macsec macvtap tap ipvlan macvlan 8021q garp mrp
      hsr wireguard libchacha20poly1305 chacha_x86_64 poly1305_x86_64
      ip6_udp_tunnel udp_tunnel libblake2s blake2s_x86_64 libblake2s_generic
      curve25519_x86_64 libcurve25519_generic libchacha xfrm_interface
      xfrm6_tunnel tunnel4 veth netdevsim psample batman_adv nlmon dummy team
      bonding tls vcan ip6_gre ip6_tunnel tunnel6 gre tun ip6t_rpfilter
      ipt_REJECT nf_reject_ipv4 ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set
      ebtable_nat ebtable_broute ip6table_nat ip6table_mangle
      ip6table_security ip6table_raw iptable_nat nf_nat nf_conntrack
      nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_security
      iptable_raw ebtable_filter ebtables rfkill ip6table_filter ip6_tables
      iptable_filter ppdev bochs drm_vram_helper drm_ttm_helper ttm
      drm_kms_helper cec parport_pc drm joydev floppy parport sg syscopyarea
      sysfillrect sysimgblt i2c_piix4 qemu_fw_cfg fb_sys_fops pcspkr
      [  343.297459]  ip_tables xfs virtio_net net_failover failover sd_mod
      sr_mod cdrom t10_pi ata_generic pata_acpi ata_piix libata virtio_pci
      virtio_pci_legacy_dev serio_raw virtio_pci_modern_dev dm_mirror
      dm_region_hash dm_log dm_mod
      [  343.311074] Dumping ftrace buffer:
      [  343.311532]    (ftrace buffer empty)
      [  343.312040] ---[ end trace a2e3db5a6ae05099 ]---
      [  343.312691] RIP: 0010:netem_enqueue+0x1590/0x33c0 [sch_netem]
      [  343.313481] Code: 89 85 58 ff ff ff e8 5f 5d e9 d3 48 8b b5 48 ff ff
      ff 8b 8d 50 ff ff ff 8b 85 58 ff ff ff 48 8b bd 70 ff ff ff 31 d2 2b 4f
      74 <f7> f1 48 b8 00 00 00 00 00 fc ff df 49 01 d5 4c 89 e9 48 c1 e9 03
      [  343.315893] RSP: 0018:ffff88800bcd7368 EFLAGS: 00010246
      [  343.316622] RAX: 00000000ba7c0a9c RBX: 0000000000000001 RCX:
      0000000000000000
      [  343.317585] RDX: 0000000000000000 RSI: ffff88800f8edb10 RDI:
      ffff88800f8eda40
      [  343.318549] RBP: ffff88800bcd7458 R08: 0000000000000000 R09:
      ffffffff94fb8445
      [  343.319503] R10: ffffffff94fb8336 R11: ffffffff94fb8445 R12:
      0000000000000000
      [  343.320455] R13: ffff88800a5a7000 R14: ffff88800a5b5800 R15:
      0000000000000020
      [  343.321414] FS:  00007fdde2bd7700(0000) GS:ffff888109780000(0000)
      knlGS:0000000000000000
      [  343.322489] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  343.323283] CR2: 00000000200000c0 CR3: 000000000ef4c000 CR4:
      00000000000006e0
      [  343.324264] Kernel panic - not syncing: Fatal exception in interrupt
      [  343.333717] Dumping ftrace buffer:
      [  343.334175]    (ftrace buffer empty)
      [  343.334653] Kernel Offset: 0x13600000 from 0xffffffff81000000
      (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
      [  343.336027] Rebooting in 86400 seconds..
      
      Reported-by: default avatarsyzkaller <syzkaller@googlegroups.com>
      Signed-off-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
      Link: https://lore.kernel.org/r/20211129175328.55339-1-harshit.m.mogalapalli@oracle.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      dadce612
    • Ondrej Jirman's avatar
      i2c: rk3x: Handle a spurious start completion interrupt flag · bca6af43
      Ondrej Jirman authored
      [ Upstream commit 02fe0fbd
      
       ]
      
      In a typical read transfer, start completion flag is being set after
      read finishes (notice ipd bit 4 being set):
      
      trasnfer poll=0
      i2c start
      rk3x-i2c fdd40000.i2c: IRQ: state 1, ipd: 10
      i2c read
      rk3x-i2c fdd40000.i2c: IRQ: state 2, ipd: 1b
      i2c stop
      rk3x-i2c fdd40000.i2c: IRQ: state 4, ipd: 33
      
      This causes I2C transfer being aborted in polled mode from a stop completion
      handler:
      
      trasnfer poll=1
      i2c start
      rk3x-i2c fdd40000.i2c: IRQ: state 1, ipd: 10
      i2c read
      rk3x-i2c fdd40000.i2c: IRQ: state 2, ipd: 0
      rk3x-i2c fdd40000.i2c: IRQ: state 2, ipd: 1b
      i2c stop
      rk3x-i2c fdd40000.i2c: IRQ: state 4, ipd: 13
      i2c stop
      rk3x-i2c fdd40000.i2c: unexpected irq in STOP: 0x10
      
      Clearing the START flag after read fixes the issue without any obvious
      side effects.
      
      This issue was dicovered on RK3566 when adding support for powering
      off the RK817 PMIC.
      
      Signed-off-by: default avatarOndrej Jirman <megous@megous.com>
      Reviewed-by: default avatarJohn Keeping <john@metanate.com>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      bca6af43
    • Helge Deller's avatar
      parisc/agp: Annotate parisc agp init functions with __init · d6edec8a
      Helge Deller authored
      [ Upstream commit 8d88382b
      
       ]
      
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      d6edec8a
    • Kai Vehmanen's avatar
      ALSA: hda/hdmi: fix HDA codec entry table order for ADL-P · cf520ccf
      Kai Vehmanen authored
      [ Upstream commit 289047db
      
       ]
      
      Keep the HDA_CODEC_ENTRY entries sorted by the codec VID. ADL-P
      is the only misplaced Intel HDMI codec.
      
      Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Link: https://lore.kernel.org/r/20211130124732.696896-2-kai.vehmanen@linux.intel.com
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      cf520ccf
    • Kai Vehmanen's avatar
      ALSA: hda: Add Intel DG2 PCI ID and HDMI codec vid · 701a07fd
      Kai Vehmanen authored
      [ Upstream commit d85ffff5
      
       ]
      
      Add HD Audio PCI ID and HDMI codec vendor ID for Intel DG2.
      
      Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Link: https://lore.kernel.org/r/20211130124732.696896-1-kai.vehmanen@linux.intel.com
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      701a07fd
    • Erik Ekman's avatar
      net/mlx4_en: Update reported link modes for 1/10G · 6d22a96d
      Erik Ekman authored
      [ Upstream commit 2191b1df ]
      
      When link modes were initially added in commit 2c762679
      ("net/mlx4_en: Use PTYS register to query ethtool settings") and
      later updated for the new ethtool API in commit 3d8f7cc7
      ("net: mlx4: use new ETHTOOL_G/SSETTINGS API") the only 1/10G non-baseT
      link modes configured were 1000baseKX, 10000baseKX4 and 10000baseKR.
      It looks like these got picked to represent other modes since nothing
      better was available.
      
      Switch to using more specific link modes added in commit 5711a982
      
      
      ("net: ethtool: add support for 1000BaseX and missing 10G link modes").
      
      Tested with MCX311A-XCAT connected via DAC.
      Before:
      
      % sudo ethtool enp3s0
      Settings for enp3s0:
      	Supported ports: [ FIBRE ]
      	Supported link modes:   1000baseKX/Full
      	                        10000baseKR/Full
      	Supported pause frame use: Symmetric Receive-only
      	Supports auto-negotiation: No
      	Supported FEC modes: Not reported
      	Advertised link modes:  1000baseKX/Full
      	                        10000baseKR/Full
      	Advertised pause frame use: Symmetric
      	Advertised auto-negotiation: No
      	Advertised FEC modes: Not reported
      	Speed: 10000Mb/s
      	Duplex: Full
      	Auto-negotiation: off
      	Port: Direct Attach Copper
      	PHYAD: 0
      	Transceiver: internal
      	Supports Wake-on: d
      	Wake-on: d
              Current message level: 0x00000014 (20)
                                     link ifdown
      	Link detected: yes
      
      With this change:
      
      % sudo ethtool enp3s0
      	Settings for enp3s0:
      	Supported ports: [ FIBRE ]
      	Supported link modes:   1000baseX/Full
      	                        10000baseCR/Full
       	                        10000baseSR/Full
      	Supported pause frame use: Symmetric Receive-only
      	Supports auto-negotiation: No
      	Supported FEC modes: Not reported
      	Advertised link modes:  1000baseX/Full
       	                        10000baseCR/Full
       	                        10000baseSR/Full
      	Advertised pause frame use: Symmetric
      	Advertised auto-negotiation: No
      	Advertised FEC modes: Not reported
      	Speed: 10000Mb/s
      	Duplex: Full
      	Auto-negotiation: off
      	Port: Direct Attach Copper
      	PHYAD: 0
      	Transceiver: internal
      	Supports Wake-on: d
      	Wake-on: d
              Current message level: 0x00000014 (20)
                                     link ifdown
      	Link detected: yes
      
      Tested-by: default avatarMichael Stapelberg <michael@stapelberg.ch>
      Signed-off-by: default avatarErik Ekman <erik@kryo.se>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      6d22a96d
    • Alexander Stein's avatar
      Revert "tty: serial: fsl_lpuart: drop earlycon entry for i.MX8QXP" · 999069d8
      Alexander Stein authored
      [ Upstream commit 4e967973 ]
      
      Revert commit b4b84493
      
       ("tty: serial: fsl_lpuart: drop earlycon entry
      for i.MX8QXP"), because this breaks earlycon support on imx8qm/imx8qxp.
      While it is true that for earlycon there is no difference between
      i.MX8QXP and i.MX7ULP (for now at least), there are differences
      regarding clocks and fixups for wakeup support. For that reason it was
      deemed unacceptable to add the imx7ulp compatible to device tree in
      order to get earlycon working again.
      
      Reviewed-by: default avatarPeng Fan <peng.fan@nxp.com>
      Signed-off-by: default avatarAlexander Stein <alexander.stein@ew.tq-group.com>
      Link: https://lore.kernel.org/r/20211124073109.805088-1-alexander.stein@ew.tq-group.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      999069d8
    • Ilie Halip's avatar
      s390/test_unwind: use raw opcode instead of invalid instruction · 27f4ce02
      Ilie Halip authored
      [ Upstream commit 53ae7230
      
       ]
      
      Building with clang & LLVM_IAS=1 leads to an error:
          arch/s390/lib/test_unwind.c:179:4: error: invalid register pair
                              "       mvcl    %%r1,%%r1\n"
                              ^
      
      The test creates an invalid instruction that would trap at runtime, but the
      LLVM inline assembler tries to validate it at compile time too.
      
      Use the raw instruction opcode instead.
      
      Reported-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarIlie Halip <ilie.halip@gmail.com>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Suggested-by: default avatarUlrich Weigand <Ulrich.Weigand@de.ibm.com>
      Link: https://github.com/ClangBuiltLinux/linux/issues/1421
      Link: https://lore.kernel.org/r/20211117174822.3632412-1-ilie.halip@gmail.com
      
      
      Reviewed-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      [hca@linux.ibm.com: use illegal opcode, and update comment]
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      27f4ce02
    • Marc Zyngier's avatar
      KVM: arm64: Save PSTATE early on exit · 9eab949e
      Marc Zyngier authored
      [ Upstream commit 83bb2c1a
      
       ]
      
      In order to be able to use primitives such as vcpu_mode_is_32bit(),
      we need to synchronize the guest PSTATE. However, this is currently
      done deep into the bowels of the world-switch code, and we do have
      helpers evaluating this much earlier (__vgic_v3_perform_cpuif_access
      and handle_aarch32_guest, for example).
      
      Move the saving of the guest pstate into the early fixups, which
      cures the first issue. The second one will be addressed separately.
      
      Tested-by: default avatarFuad Tabba <tabba@google.com>
      Reviewed-by: default avatarFuad Tabba <tabba@google.com>
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      9eab949e
    • Philip Chen's avatar
      drm/msm/dsi: set default num_data_lanes · 990fd815
      Philip Chen authored
      [ Upstream commit cd92cc18
      
       ]
      
      If "data_lanes" property of the dsi output endpoint is missing in
      the DT, num_data_lanes would be 0 by default, which could cause
      dsi_host_attach() to fail if dsi->lanes is set to a non-zero value
      by the bridge driver.
      
      According to the binding document of msm dsi controller, the
      input/output endpoint of the controller is expected to have 4 lanes.
      So let's set num_data_lanes to 4 by default.
      
      Signed-off-by: default avatarPhilip Chen <philipchen@chromium.org>
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
      Link: https://lore.kernel.org/r/20211030100812.1.I6cd9af36b723fed277d34539d3b2ba4ca233ad2d@changeid
      
      
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      990fd815
    • Tadeusz Struk's avatar
      nfc: fix segfault in nfc_genl_dump_devices_done · c602863a
      Tadeusz Struk authored
      commit fd79a0cb upstream.
      
      When kmalloc in nfc_genl_dump_devices() fails then
      nfc_genl_dump_devices_done() segfaults as below
      
      KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
      CPU: 0 PID: 25 Comm: kworker/0:1 Not tainted 5.16.0-rc4-01180-g2a987e65025e-dirty #5
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-6.fc35 04/01/2014
      Workqueue: events netlink_sock_destruct_work
      RIP: 0010:klist_iter_exit+0x26/0x80
      Call Trace:
      <TASK>
      class_dev_iter_exit+0x15/0x20
      nfc_genl_dump_devices_done+0x3b/0x50
      genl_lock_done+0x84/0xd0
      netlink_sock_destruct+0x8f/0x270
      __sk_destruct+0x64/0x3b0
      sk_destruct+0xa8/0xd0
      __sk_free+0x2e8/0x3d0
      sk_free+0x51/0x90
      netlink_sock_destruct_work+0x1c/0x20
      process_one_work+0x411/0x710
      worker_thread+0x6fd/0xa80
      
      Link: https://syzkaller.appspot.com/bug?id=fc0fa5a53db9edd261d56e74325419faf18bd0df
      
      
      Reported-by: default avatar <syzbot+f9f76f4a0766420b4a02@syzkaller.appspotmail.com>
      Signed-off-by: default avatarTadeusz Struk <tadeusz.struk@linaro.org>
      Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
      Link: https://lore.kernel.org/r/20211208182742.340542-1-tadeusz.struk@linaro.org
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c602863a
  2. Dec 16, 2021
  3. Dec 14, 2021