1. 02 Aug, 2024 6 commits
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2024-08-02' of https://gitlab.freedesktop.org/drm/kernel · 29b4a699
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Regular weekly fixes. This is a bit larger than usual but doesn't seem
        too crazy.
      
        Most of it is vmwgfx changes that fix a bunch of issues with wayland
        userspaces with dma-buf/external buffers and modesetting fixes.
      
        Otherwise it's kinda spread out, v3d fixes some new ioctls, nouveau
        has regression revert and fixes, amdgpu, i915 and ast have some small
        fixes, and some core fixes spread about.
      
        client:
         - fix error code
      
        atomic:
         - allow damage clips with async flips
         - allow explicit sync with async flips
      
        kselftests:
         - fix dmabuf-heaps test
      
        panic:
         - fix schedule_work in panic paths
      
        panel:
         - fix OrangePi Neo orientation
      
        gpuvm:
         - fix missing dependency
      
        amdgpu:
         - SMU 14.x update
         - Fix contiguous VRAM handling for IB parsing
         - GFX 12 fix
         - Regression fix for old APUs
      
        i915:
         - Static analysis fix for int overflow
         - Fix for HDCP2_STREAM_STATUS macro and removal of PWR_CLK_STATE for gen12
      
        nouveau:
         - revert busy wait change that caused a resume regression
         - fix buffer placement fault on dynamic pm s/r
         - fix refcount underflow
      
        ast:
         - fix black screen on resume
         - wake during connector status detect
      
        v3d:
         - fix issues with perf/timestamp ioctls
      
        vmwgfx:
         - fix deadlock in dma-buf fence polling
         - fix screen surface refcounting
         - fix dumb buffer handling
         - fix support for external buffers
         - fix overlay with screen targets
         - trigger modeset on screen moves"
      
      * tag 'drm-fixes-2024-08-02' of https://gitlab.freedesktop.org/drm/kernel: (31 commits)
        Revert "nouveau: rip out busy fence waits"
        nouveau: set placement to original placement on uvmm validate.
        drm/atomic: Allow userspace to use damage clips with async flips
        drm/atomic: Allow userspace to use explicit sync with atomic async flips
        drm/i915: Fix possible int overflow in skl_ddi_calculate_wrpll()
        drm/i915/hdcp: Fix HDCP2_STREAM_STATUS macro
        drm/ast: astdp: Wake up during connector status detection
        i915/perf: Remove code to update PWR_CLK_STATE for gen12
        kselftests: dmabuf-heaps: Ensure the driver name is null-terminated
        drm/client: Fix error code in drm_client_buffer_vmap_local()
        drm/amdgpu: Fix APU handling in amdgpu_pm_load_smu_firmware()
        drm/amdgpu: increase mes log buffer size for gfx12
        drm/amdgpu: fix contiguous handling for IB parsing v2
        drm/amdgpu/pm: support gpu_metrics sysfs interface for smu v14.0.2/3
        drm/vmwgfx: Trigger a modeset when the screen moves
        drm/vmwgfx: Fix overlay when using Screen Targets
        drm/vmwgfx: Add basic support for external buffers
        drm/vmwgfx: Fix handling of dumb buffers
        drm/vmwgfx: Make sure the screen surface is ref counted
        drm/vmwgfx: Fix a deadlock in dma buf fence polling
        ...
      29b4a699
    • Linus Torvalds's avatar
      Merge tag 'ata-6.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux · 454e2370
      Linus Torvalds authored
      Pull ata fix from Damien Le Moal:
      
       - Add missing power-domains property to the device tree bindings for
         the Rockchip Designware AHCI adapter (from Heiko)
      
      * tag 'ata-6.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux:
        dt-bindings: ata: rockchip-dwc-ahci: add missing power-domains
      454e2370
    • Linus Torvalds's avatar
      Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · bbea34e6
      Linus Torvalds authored
      Pull vfs fix from Al Viro:
       "do_dup2() out-of-bounds array speculation fix"
      
      * tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        protect the fetch of ->fd[fd] in do_dup2() from mispredictions
      bbea34e6
    • Dave Airlie's avatar
      Revert "nouveau: rip out busy fence waits" · 27ce65f6
      Dave Airlie authored
      This reverts commit d45bb9c5.
      
      Just got a report that this causes some suspend/resume issues,
      so back it out and I'll investigate it later.
      Reported-by: default avatarMike Galbraith <efault@gmx.de>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      27ce65f6
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2024-08-01' of... · 4eb39974
      Dave Airlie authored
      Merge tag 'drm-misc-fixes-2024-08-01' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
      
      A couple drm_panic fixes, several v3d fixes to increase the new timestamp API
      safety, several fixes for vmwgfx for various modesetting issues, PM fixes
      for ast, async flips improvements and two fixes for nouveau to fix
      resource refcounting and buffer placement.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Maxime Ripard <mripard@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240801-interesting-antique-bat-2fe4c0@houat
      4eb39974
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2024-08-01' of... · 7b9b7651
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2024-08-01' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-fixes
      
      - Static analysis fix for int overflow
      - Fix for HDCP2_STREAM_STATUS macro and removal of PWR_CLK_STATE for gen12
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/ZqslBkcZlInYdYgm@jlahtine-mobl.ger.corp.intel.com
      7b9b7651
  2. 01 Aug, 2024 27 commits
  3. 31 Jul, 2024 7 commits
    • Dave Airlie's avatar
      nouveau: set placement to original placement on uvmm validate. · 9c685f61
      Dave Airlie authored
      When a buffer is evicted for memory pressure or TTM evict all,
      the placement is set to the eviction domain, this means the
      buffer never gets revalidated on the next exec to the correct domain.
      
      I think this should be fine to use the initial domain from the
      object creation, as least with VM_BIND this won't change after
      init so this should be the correct answer.
      
      Fixes: b88baab8 ("drm/nouveau: implement new VM_BIND uAPI")
      Cc: Danilo Krummrich <dakr@redhat.com>
      Cc: <stable@vger.kernel.org> # v6.6
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240515025542.2156774-1-airlied@gmail.com
      9c685f61
    • Kuniyuki Iwashima's avatar
      netfilter: iptables: Fix potential null-ptr-deref in ip6table_nat_table_init(). · c22921df
      Kuniyuki Iwashima authored
      ip6table_nat_table_init() accesses net->gen->ptr[ip6table_nat_net_ops.id],
      but the function is exposed to user space before the entry is allocated
      via register_pernet_subsys().
      
      Let's call register_pernet_subsys() before xt_register_template().
      
      Fixes: fdacd57c ("netfilter: x_tables: never register tables by default")
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c22921df
    • Kuniyuki Iwashima's avatar
      netfilter: iptables: Fix null-ptr-deref in iptable_nat_table_init(). · 5830aa86
      Kuniyuki Iwashima authored
      We had a report that iptables-restore sometimes triggered null-ptr-deref
      at boot time. [0]
      
      The problem is that iptable_nat_table_init() is exposed to user space
      before the kernel fully initialises netns.
      
      In the small race window, a user could call iptable_nat_table_init()
      that accesses net_generic(net, iptable_nat_net_id), which is available
      only after registering iptable_nat_net_ops.
      
      Let's call register_pernet_subsys() before xt_register_template().
      
      [0]:
      bpfilter: Loaded bpfilter_umh pid 11702
      Started bpfilter
      BUG: kernel NULL pointer dereference, address: 0000000000000013
       PF: supervisor write access in kernel mode
       PF: error_code(0x0002) - not-present page
      PGD 0 P4D 0
      PREEMPT SMP NOPTI
      CPU: 2 PID: 11879 Comm: iptables-restor Not tainted 6.1.92-99.174.amzn2023.x86_64 #1
      Hardware name: Amazon EC2 c6i.4xlarge/, BIOS 1.0 10/16/2017
      RIP: 0010:iptable_nat_table_init (net/ipv4/netfilter/iptable_nat.c:87 net/ipv4/netfilter/iptable_nat.c:121) iptable_nat
      Code: 10 4c 89 f6 48 89 ef e8 0b 19 bb ff 41 89 c4 85 c0 75 38 41 83 c7 01 49 83 c6 28 41 83 ff 04 75 dc 48 8b 44 24 08 48 8b 0c 24 <48> 89 08 4c 89 ef e8 a2 3b a2 cf 48 83 c4 10 44 89 e0 5b 5d 41 5c
      RSP: 0018:ffffbef902843cd0 EFLAGS: 00010246
      RAX: 0000000000000013 RBX: ffff9f4b052caa20 RCX: ffff9f4b20988d80
      RDX: 0000000000000000 RSI: 0000000000000064 RDI: ffffffffc04201c0
      RBP: ffff9f4b29394000 R08: ffff9f4b07f77258 R09: ffff9f4b07f77240
      R10: 0000000000000000 R11: ffff9f4b09635388 R12: 0000000000000000
      R13: ffff9f4b1a3c6c00 R14: ffff9f4b20988e20 R15: 0000000000000004
      FS:  00007f6284340000(0000) GS:ffff9f51fe280000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000013 CR3: 00000001d10a6005 CR4: 00000000007706e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      PKRU: 55555554
      Call Trace:
       <TASK>
       ? show_trace_log_lvl (arch/x86/kernel/dumpstack.c:259)
       ? show_trace_log_lvl (arch/x86/kernel/dumpstack.c:259)
       ? xt_find_table_lock (net/netfilter/x_tables.c:1259)
       ? __die_body.cold (arch/x86/kernel/dumpstack.c:478 arch/x86/kernel/dumpstack.c:420)
       ? page_fault_oops (arch/x86/mm/fault.c:727)
       ? exc_page_fault (./arch/x86/include/asm/irqflags.h:40 ./arch/x86/include/asm/irqflags.h:75 arch/x86/mm/fault.c:1470 arch/x86/mm/fault.c:1518)
       ? asm_exc_page_fault (./arch/x86/include/asm/idtentry.h:570)
       ? iptable_nat_table_init (net/ipv4/netfilter/iptable_nat.c:87 net/ipv4/netfilter/iptable_nat.c:121) iptable_nat
       xt_find_table_lock (net/netfilter/x_tables.c:1259)
       xt_request_find_table_lock (net/netfilter/x_tables.c:1287)
       get_info (net/ipv4/netfilter/ip_tables.c:965)
       ? security_capable (security/security.c:809 (discriminator 13))
       ? ns_capable (kernel/capability.c:376 kernel/capability.c:397)
       ? do_ipt_get_ctl (net/ipv4/netfilter/ip_tables.c:1656)
       ? bpfilter_send_req (net/bpfilter/bpfilter_kern.c:52) bpfilter
       nf_getsockopt (net/netfilter/nf_sockopt.c:116)
       ip_getsockopt (net/ipv4/ip_sockglue.c:1827)
       __sys_getsockopt (net/socket.c:2327)
       __x64_sys_getsockopt (net/socket.c:2342 net/socket.c:2339 net/socket.c:2339)
       do_syscall_64 (arch/x86/entry/common.c:51 arch/x86/entry/common.c:81)
       entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
      RIP: 0033:0x7f62844685ee
      Code: 48 8b 0d 45 28 0f 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 37 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 0a c3 66 0f 1f 84 00 00 00 00 00 48 8b 15 09
      RSP: 002b:00007ffd1f83d638 EFLAGS: 00000246 ORIG_RAX: 0000000000000037
      RAX: ffffffffffffffda RBX: 00007ffd1f83d680 RCX: 00007f62844685ee
      RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000004
      RBP: 0000000000000004 R08: 00007ffd1f83d670 R09: 0000558798ffa2a0
      R10: 00007ffd1f83d680 R11: 0000000000000246 R12: 00007ffd1f83e3b2
      R13: 00007f628455baa0 R14: 00007ffd1f83d7b0 R15: 00007f628457a008
       </TASK>
      Modules linked in: iptable_nat(+) bpfilter rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs lockd grace fscache veth xt_state xt_connmark xt_nat xt_statistic xt_MASQUERADE xt_mark xt_addrtype ipt_REJECT nf_reject_ipv4 nft_chain_nat nf_nat xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xt_comment nft_compat nf_tables nfnetlink overlay nls_ascii nls_cp437 vfat fat ghash_clmulni_intel aesni_intel ena crypto_simd ptp cryptd i8042 pps_core serio button sunrpc sch_fq_codel configfs loop dm_mod fuse dax dmi_sysfs crc32_pclmul crc32c_intel efivarfs
      CR2: 0000000000000013
      
      Fixes: fdacd57c ("netfilter: x_tables: never register tables by default")
      Reported-by: default avatarTakahiro Kawahara <takawaha@amazon.co.jp>
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      5830aa86
    • André Almeida's avatar
      drm/atomic: Allow userspace to use damage clips with async flips · f85de245
      André Almeida authored
      Allow userspace to use damage clips with atomic async flips. Damage
      clips are useful for partial plane updates, which can be helpful for
      clients that want to do flips asynchronously.
      
      Fixes: 0e26cc72 ("drm: Refuse to async flip with atomic prop changes")
      Signed-off-by: default avatarAndré Almeida <andrealmeid@igalia.com>
      Reviewed-by: default avatarSimon Ser <contact@emersion.fr>
      Signed-off-by: default avatarSimon Ser <contact@emersion.fr>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240702212215.109696-2-andrealmeid@igalia.com
      f85de245
    • André Almeida's avatar
      drm/atomic: Allow userspace to use explicit sync with atomic async flips · e0fa4132
      André Almeida authored
      Allow userspace to use explicit synchronization with atomic async flips.
      That means that the flip will wait for some hardware fence, and then
      will flip as soon as possible (async) in regard of the vblank.
      
      Fixes: 0e26cc72 ("drm: Refuse to async flip with atomic prop changes")
      Signed-off-by: default avatarAndré Almeida <andrealmeid@igalia.com>
      Reviewed-by: default avatarSimon Ser <contact@emersion.fr>
      Signed-off-by: default avatarSimon Ser <contact@emersion.fr>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240702212215.109696-1-andrealmeid@igalia.com
      e0fa4132
    • Linus Torvalds's avatar
      minmax: fix up min3() and max3() too · 21b136cc
      Linus Torvalds authored
      David Laight pointed out that we should deal with the min3() and max3()
      mess too, which still does excessive expansion.
      
      And our current macros are actually rather broken.
      
      In particular, the macros did this:
      
        #define min3(x, y, z) min((typeof(x))min(x, y), z)
        #define max3(x, y, z) max((typeof(x))max(x, y), z)
      
      and that not only is a nested expansion of possibly very complex
      arguments with all that involves, the typing with that "typeof()" cast
      is completely wrong.
      
      For example, imagine what happens in max3() if 'x' happens to be a
      'unsigned char', but 'y' and 'z' are 'unsigned long'.  The types are
      compatible, and there's no warning - but the result is just random
      garbage.
      
      No, I don't think we've ever hit that issue in practice, but since we
      now have sane infrastructure for doing this right, let's just use it.
      It fixes any excessive expansion, and also avoids these kinds of broken
      type issues.
      Requested-by: default avatarDavid Laight <David.Laight@aculab.com>
      Acked-by: default avatarArnd Bergmann <arnd@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      21b136cc
    • Linus Torvalds's avatar
      Merge tag 'for-6.11-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · e4fc196f
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
      
       - fix regression in extent map rework when handling insertion of
         overlapping compressed extent
      
       - fix unexpected file length when appending to a file using direct io
         and buffer not faulted in
      
       - in zoned mode, fix accounting of unusable space when flipping
         read-only block group back to read-write
      
       - fix page locking when COWing an inline range, assertion failure found
         by syzbot
      
       - fix calculation of space info in debugging print
      
       - tree-checker, add validation of data reference item
      
       - fix a few -Wmaybe-uninitialized build warnings
      
      * tag 'for-6.11-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: initialize location to fix -Wmaybe-uninitialized in btrfs_lookup_dentry()
        btrfs: fix corruption after buffer fault in during direct IO append write
        btrfs: zoned: fix zone_unusable accounting on making block group read-write again
        btrfs: do not subtract delalloc from avail bytes
        btrfs: make cow_file_range_inline() honor locked_page on error
        btrfs: fix corrupt read due to bad offset of a compressed extent map
        btrfs: tree-checker: validate dref root and objectid
      e4fc196f