Skip to content
  1. Nov 12, 2021
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 600b18f8
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "Two locking fixes:
      
         - Add mutex protection to ring_buffer_reset()
      
         - Fix deadlock in modify_ftrace_direct_multi()"
      
      * tag 'trace-v5.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ftrace/direct: Fix lockup in modify_ftrace_direct_multi
        ring-buffer: Protect ring_buffer_reset() from reentrancy
      600b18f8
    • Linus Torvalds's avatar
      Merge tag 'net-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · f54ca91f
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from bpf, can and netfilter.
      
        Current release - regressions:
      
         - bpf: do not reject when the stack read size is different from the
           tracked scalar size
      
         - net: fix premature exit from NAPI state polling in napi_disable()
      
         - riscv, bpf: fix RV32 broken build, and silence RV64 warning
      
        Current release - new code bugs:
      
         - net: fix possible NULL deref in sock_reserve_memory
      
         - amt: fix error return code in amt_init(); fix stopping the
           workqueue
      
         - ax88796c: use the correct ioctl callback
      
        Previous releases - always broken:
      
         - bpf: stop caching subprog index in the bpf_pseudo_func insn
      
         - security: fixups for the security hooks in sctp
      
         - nfc: add necessary privilege flags in netlink layer, limit
           operations to admin only
      
         - vsock: prevent unnecessary refcnt inc for non-blocking connect
      
         - net/smc: fix sk_refcnt underflow on link down and fallback
      
         - nfnetlink_queue: fix OOB when mac header was cleared
      
         - can: j1939: ignore invalid messages per standard
      
         - bpf, sockmap:
            - fix race in ingress receive verdict with redirect to self
            - fix incorrect sk_skb data_end access when src_reg = dst_reg
            - strparser, and tls are reusing qdisc_skb_cb and colliding
      
         - ethtool: fix ethtool msg len calculation for pause stats
      
         - vlan: fix a UAF in vlan_dev_real_dev() when ref-holder tries to
           access an unregistering real_dev
      
         - udp6: make encap_rcv() bump the v6 not v4 stats
      
         - drv: prestera: add explicit padding to fix m68k build
      
         - drv: felix: fix broken VLAN-tagged PTP under VLAN-aware bridge
      
         - drv: mvpp2: fix wrong SerDes reconfiguration order
      
        Misc & small latecomers:
      
         - ipvs: auto-load ipvs on genl access
      
         - mctp: sanity check the struct sockaddr_mctp padding fields
      
         - libfs: support RENAME_EXCHANGE in simple_rename()
      
         - avoid double accounting for pure zerocopy skbs"
      
      * tag 'net-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (123 commits)
        selftests/net: udpgso_bench_rx: fix port argument
        net: wwan: iosm: fix compilation warning
        cxgb4: fix eeprom len when diagnostics not implemented
        net: fix premature exit from NAPI state polling in napi_disable()
        net/smc: fix sk_refcnt underflow on linkdown and fallback
        net/mlx5: Lag, fix a potential Oops with mlx5_lag_create_definer()
        gve: fix unmatched u64_stats_update_end()
        net: ethernet: lantiq_etop: Fix compilation error
        selftests: forwarding: Fix packet matching in mirroring selftests
        vsock: prevent unnecessary refcnt inc for nonblocking connect
        net: marvell: mvpp2: Fix wrong SerDes reconfiguration order
        net: ethernet: ti: cpsw_ale: Fix access to un-initialized memory
        net: stmmac: allow a tc-taprio base-time of zero
        selftests: net: test_vxlan_under_vrf: fix HV connectivity test
        net: hns3: allow configure ETS bandwidth of all TCs
        net: hns3: remove check VF uc mac exist when set by PF
        net: hns3: fix some mac statistics is always 0 in device version V2
        net: hns3: fix kernel crash when unload VF while it is being reset
        net: hns3: sync rx ring head in echo common pull
        net: hns3: fix pfc packet number incorrect after querying pfc parameters
        ...
      f54ca91f
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · c55a0417
      Linus Torvalds authored
      Pull char/misc fix from Greg KH:
       "Here is a single fix for 5.16-rc1 to resolve a build problem that came
        in through the coresight tree (and as such came in through the
        char/misc tree merge in the 5.16-rc1 merge window).
      
        It resolves a build problem with 'allmodconfig' on arm64 and is acked
        by the proper subsystem maintainers. It has been in linux-next all
        week with no reported problems"
      
      * tag 'char-misc-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        arm64: cpufeature: Export this_cpu_has_cap helper
      c55a0417
    • Linus Torvalds's avatar
      Merge tag 'usb-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 5625207d
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some small reverts and fixes for USB drivers for issues that
        came up during the 5.16-rc1 merge window.
      
        These include:
      
         - two reverts of xhci and USB core patches that are causing problems
           in many systems.
      
         - xhci 3.1 enumeration delay fix for systems that were having
           problems.
      
        All three of these have been in linux-next all week with no reported
        issues"
      
      * tag 'usb-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        xhci: Fix USB 3.1 enumeration issues by increasing roothub power-on-good delay
        Revert "usb: core: hcd: Add support for deferring roothub registration"
        Revert "xhci: Set HCD flag to defer primary roothub registration"
      5625207d
  2. Nov 11, 2021
    • Willem de Bruijn's avatar
      selftests/net: udpgso_bench_rx: fix port argument · d336509c
      Willem de Bruijn authored
      The below commit added optional support for passing a bind address.
      It configures the sockaddr bind arguments before parsing options and
      reconfigures on options -b and -4.
      
      This broke support for passing port (-p) on its own.
      
      Configure sockaddr after parsing all arguments.
      
      Fixes: 3327a9c4
      
       ("selftests: add functionals test for UDP GRO")
      Reported-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d336509c
    • M Chetan Kumar's avatar
      net: wwan: iosm: fix compilation warning · 29cd3867
      M Chetan Kumar authored
      curr_phase is unused. Removed the dead code.
      
      Fixes: 8d9be063
      
       ("net: wwan: iosm: transport layer support for fw flashing/cd")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarM Chetan Kumar <m.chetan.kumar@linux.intel.com>
      Reviewed-by: default avatarLoic Poulain <loic.poulain@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      29cd3867
    • Rahul Lakkireddy's avatar
      cxgb4: fix eeprom len when diagnostics not implemented · 4ca110bf
      Rahul Lakkireddy authored
      Ensure diagnostics monitoring support is implemented for the SFF 8472
      compliant port module and set the correct length for ethtool port
      module eeprom read.
      
      Fixes: f56ec676
      
       ("cxgb4: Add support for ethtool i2c dump")
      Signed-off-by: default avatarManoj Malviya <manojmalviya@chelsio.com>
      Signed-off-by: default avatarRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ca110bf
    • Alexander Lobakin's avatar
      net: fix premature exit from NAPI state polling in napi_disable() · 0315a075
      Alexander Lobakin authored
      Commit 719c5719 ("net: make napi_disable() symmetric with
      enable") accidentally introduced a bug sometimes leading to a kernel
      BUG when bringing an iface up/down under heavy traffic load.
      
      Prior to this commit, napi_disable() was polling n->state until
      none of (NAPIF_STATE_SCHED | NAPIF_STATE_NPSVC) is set and then
      always flip them. Now there's a possibility to get away with the
      NAPIF_STATE_SCHE unset as 'continue' drops us to the cmpxchg()
      call with an uninitialized variable, rather than straight to
      another round of the state check.
      
      Error path looks like:
      
      napi_disable():
      unsigned long val, new; /* new is uninitialized */
      
      do {
      	val = READ_ONCE(n->state); /* NAPIF_STATE_NPSVC and/or
      				      NAPIF_STATE_SCHED is set */
      	if (val & (NAPIF_STATE_SCHED | NAPIF_STATE_NPSVC)) { /* true */
      		usleep_range(20, 200);
      		continue; /* go straight to the condition check */
      	}
      	new = val | <...>
      } while (cmpxchg(&n->state, val, new) != val); /* state == val, cmpxchg()
      						  writes garbage */
      
      napi_enable():
      do {
      	val = READ_ONCE(n->state);
      	BUG_ON(!test_bit(NAPI_STATE_SCHED, &val)); /* 50/50 boom */
      <...>
      
      while the typical BUG splat is like:
      
      [  172.652461] ------------[ cut here ]------------
      [  172.652462] kernel BUG at net/core/dev.c:6937!
      [  172.656914] invalid opcode: 0000 [#1] PREEMPT SMP PTI
      [  172.661966] CPU: 36 PID: 2829 Comm: xdp_redirect_cp Tainted: G          I       5.15.0 #42
      [  172.670222] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0014.082620210524 08/26/2021
      [  172.680646] RIP: 0010:napi_enable+0x5a/0xd0
      [  172.684832] Code: 07 49 81 cc 00 01 00 00 4c 89 e2 48 89 d8 80 e6 fb f0 48 0f b1 55 10 48 39 c3 74 10 48 8b 5d 10 f6 c7 04 75 3d f6 c3 01 75 b4 <0f> 0b 5b 5d 41 5c c3 65 ff 05 b8 e5 61 53 48 c7 c6 c0 f3 34 ad 48
      [  172.703578] RSP: 0018:ffffa3c9497477a8 EFLAGS: 00010246
      [  172.708803] RAX: ffffa3c96615a014 RBX: 0000000000000000 RCX: ffff8a4b575301a0
      < snip >
      [  172.782403] Call Trace:
      [  172.784857]  <TASK>
      [  172.786963]  ice_up_complete+0x6f/0x210 [ice]
      [  172.791349]  ice_xdp+0x136/0x320 [ice]
      [  172.795108]  ? ice_change_mtu+0x180/0x180 [ice]
      [  172.799648]  dev_xdp_install+0x61/0xe0
      [  172.803401]  dev_xdp_attach+0x1e0/0x550
      [  172.807240]  dev_change_xdp_fd+0x1e6/0x220
      [  172.811338]  do_setlink+0xee8/0x1010
      [  172.814917]  rtnl_setlink+0xe5/0x170
      [  172.818499]  ? bpf_lsm_binder_set_context_mgr+0x10/0x10
      [  172.823732]  ? security_capable+0x36/0x50
      < snip >
      
      Fix this by replacing 'do { } while (cmpxchg())' with an "infinite"
      for-loop with an explicit break.
      
      From v1 [0]:
       - just use a for-loop to simplify both the fix and the existing
         code (Eric).
      
      [0] https://lore.kernel.org/netdev/20211110191126.1214-1-alexandr.lobakin@intel.com
      
      Fixes: 719c5719
      
       ("net: make napi_disable() symmetric with enable")
      Suggested-by: Eric Dumazet <edumazet@google.com> # for-loop
      Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Reviewed-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20211110195605.1304-1-alexandr.lobakin@intel.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0315a075
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · debe436e
      Linus Torvalds authored
      Pull ext4 updates from Ted Ts'o:
       "Only bug fixes and cleanups for ext4 this merge window.
      
        Of note are fixes for the combination of the inline_data and
        fast_commit fixes, and more accurately calculating when to schedule
        additional lazy inode table init, especially when CONFIG_HZ is 100HZ"
      
      * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: fix error code saved on super block during file system abort
        ext4: inline data inode fast commit replay fixes
        ext4: commit inline data during fast commit
        ext4: scope ret locally in ext4_try_to_trim_range()
        ext4: remove an unused variable warning with CONFIG_QUOTA=n
        ext4: fix boolreturn.cocci warnings in fs/ext4/name.c
        ext4: prevent getting empty inode buffer
        ext4: move ext4_fill_raw_inode() related functions
        ext4: factor out ext4_fill_raw_inode()
        ext4: prevent partial update of the extent blocks
        ext4: check for inconsistent extents between index and leaf block
        ext4: check for out-of-order index extents in ext4_valid_extent_entries()
        ext4: convert from atomic_t to refcount_t on ext4_io_end->count
        ext4: refresh the ext4_ext_path struct after dropping i_data_sem.
        ext4: ensure enough credits in ext4_ext_shift_path_extents
        ext4: correct the left/middle/right debug message for binsearch
        ext4: fix lazy initialization next schedule time computation in more granular unit
        Revert "ext4: enforce buffer head state assertion in ext4_da_map_blocks"
      debe436e
    • Linus Torvalds's avatar
      Merge tag 'for-5.16-deadlock-fix-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 6070dcc8
      Linus Torvalds authored
      Pull btrfs fix from David Sterba:
       "Fix for a deadlock when direct/buffered IO is done on a mmaped file
        and a fault happens (details in the patch). There's a fstest
        generic/647 that triggers the problem and makes testing hard"
      
      * tag 'for-5.16-deadlock-fix-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: fix deadlock due to page faults during direct IO reads and writes
      6070dcc8
    • Linus Torvalds's avatar
      Merge tag 'nfsd-5.16' of git://linux-nfs.org/~bfields/linux · 38764c73
      Linus Torvalds authored
      Pull nfsd updates from Bruce Fields:
       "A slow cycle for nfsd: mainly cleanup, including Neil's patch dropping
        support for a filehandle format deprecated 20 years ago, and further
        xdr-related cleanup from Chuck"
      
      * tag 'nfsd-5.16' of git://linux-nfs.org/~bfields/linux: (26 commits)
        nfsd4: remove obselete comment
        nfsd: document server-to-server-copy parameters
        NFSD:fix boolreturn.cocci warning
        nfsd: update create verifier comment
        SUNRPC: Change return value type of .pc_encode
        SUNRPC: Replace the "__be32 *p" parameter to .pc_encode
        NFSD: Save location of NFSv4 COMPOUND status
        SUNRPC: Change return value type of .pc_decode
        SUNRPC: Replace the "__be32 *p" parameter to .pc_decode
        SUNRPC: De-duplicate .pc_release() call sites
        SUNRPC: Simplify the SVC dispatch code path
        SUNRPC: Capture value of xdr_buf::page_base
        SUNRPC: Add trace event when alloc_pages_bulk() makes no progress
        svcrdma: Split svcrmda_wc_{read,write} tracepoints
        svcrdma: Split the svcrdma_wc_send() tracepoint
        svcrdma: Split the svcrdma_wc_receive() tracepoint
        NFSD: Have legacy NFSD WRITE decoders use xdr_stream_subsegment()
        SUNRPC: xdr_stream_subsegment() must handle non-zero page_bases
        NFSD: Initialize pointer ni with NULL and not plain integer 0
        NFSD: simplify struct nfsfh
        ...
      38764c73
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.16-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 2ec20f48
      Linus Torvalds authored
      Pull NFS client updates from Trond Myklebust:
       "Highlights include:
      
        Features:
         - NFSv4.1 can always retrieve and cache the ACCESS mode on OPEN
         - Optimisations for READDIR and the 'ls -l' style workload
         - Further replacements of dprintk() with tracepoints and other
           tracing improvements
         - Ensure we re-probe NFSv4 server capabilities when the user does a
           "mount -o remount"
      
        Bugfixes:
         - Fix an Oops in pnfs_mark_request_commit()
         - Fix up deadlocks in the commit code
         - Fix regressions in NFSv2/v3 attribute revalidation due to the
           change_attr_type optimisations
         - Fix some dentry verifier races
         - Fix some missing dentry verifier settings
         - Fix a performance regression in nfs_set_open_stateid_locked()
         - SUNRPC was sending multiple SYN calls when re-establishing a TCP
           connection.
         - Fix multiple NFSv4 issues due to missing sanity checking of server
           return values
         - Fix a potential Oops when FREE_STATEID races with an unmount
      
        Cleanups:
         - Clean up the labelled NFS code
         - Remove unused header <linux/pnfs_osd_xdr.h>"
      
      * tag 'nfs-for-5.16-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (84 commits)
        NFSv4: Sanity check the parameters in nfs41_update_target_slotid()
        NFS: Remove the nfs4_label argument from decode_getattr_*() functions
        NFS: Remove the nfs4_label argument from nfs_setsecurity
        NFS: Remove the nfs4_label argument from nfs_fhget()
        NFS: Remove the nfs4_label argument from nfs_add_or_obtain()
        NFS: Remove the nfs4_label argument from nfs_instantiate()
        NFS: Remove the nfs4_label from the nfs_setattrres
        NFS: Remove the nfs4_label from the nfs4_getattr_res
        NFS: Remove the f_label from the nfs4_opendata and nfs_openres
        NFS: Remove the nfs4_label from the nfs4_lookupp_res struct
        NFS: Remove the label from the nfs4_lookup_res struct
        NFS: Remove the nfs4_label from the nfs4_link_res struct
        NFS: Remove the nfs4_label from the nfs4_create_res struct
        NFS: Remove the nfs4_label from the nfs_entry struct
        NFS: Create a new nfs_alloc_fattr_with_label() function
        NFS: Always initialise fattr->label in nfs_fattr_alloc()
        NFSv4.2: alloc_file_pseudo() takes an open flag, not an f_mode
        NFS: Don't allocate nfs_fattr on the stack in __nfs42_ssc_open()
        NFSv4: Remove unnecessary 'minor version' check
        NFSv4: Fix potential Oops in decode_op_map()
        ...
      2ec20f48
    • Linus Torvalds's avatar
      Merge branch 'exit-cleanups-for-v5.16' of... · 5147da90
      Linus Torvalds authored
      Merge branch 'exit-cleanups-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
      
      Pull exit cleanups from Eric Biederman:
       "While looking at some issues related to the exit path in the kernel I
        found several instances where the code is not using the existing
        abstractions properly.
      
        This set of changes introduces force_fatal_sig a way of sending a
        signal and not allowing it to be caught, and corrects the misuse of
        the existing abstractions that I found.
      
        A lot of the misuse of the existing abstractions are silly things such
        as doing something after calling a no return function, rolling BUG by
        hand, doing more work than necessary to terminate a kernel thread, or
        calling do_exit(SIGKILL) instead of calling force_sig(SIGKILL).
      
        In the review a deficiency in force_fatal_sig and force_sig_seccomp
        where ptrace or sigaction could prevent the delivery of the signal was
        found. I have added a change that adds SA_IMMUTABLE to change that
        makes it impossible to interrupt the delivery of those signals, and
        allows backporting to fix force_sig_seccomp
      
        And Arnd found an issue where a function passed to kthread_run had the
        wrong prototype, and after my cleanup was failing to build."
      
      * 'exit-cleanups-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (23 commits)
        soc: ti: fix wkup_m3_rproc_boot_thread return type
        signal: Add SA_IMMUTABLE to ensure forced siganls do not get changed
        signal: Replace force_sigsegv(SIGSEGV) with force_fatal_sig(SIGSEGV)
        exit/r8188eu: Replace the macro thread_exit with a simple return 0
        exit/rtl8712: Replace the macro thread_exit with a simple return 0
        exit/rtl8723bs: Replace the macro thread_exit with a simple return 0
        signal/x86: In emulate_vsyscall force a signal instead of calling do_exit
        signal/sparc32: In setup_rt_frame and setup_fram use force_fatal_sig
        signal/sparc32: Exit with a fatal signal when try_to_clear_window_buffer fails
        exit/syscall_user_dispatch: Send ordinary signals on failure
        signal: Implement force_fatal_sig
        exit/kthread: Have kernel threads return instead of calling do_exit
        signal/s390: Use force_sigsegv in default_trap_handler
        signal/vm86_32: Properly send SIGSEGV when the vm86 state cannot be saved.
        signal/vm86_32: Replace open coded BUG_ON with an actual BUG_ON
        signal/sparc: In setup_tsb_params convert open coded BUG into BUG
        signal/powerpc: On swapcontext failure force SIGSEGV
        signal/sh: Use force_sig(SIGKILL) instead of do_group_exit(SIGKILL)
        signal/mips: Update (_save|_restore)_fp_context to fail with -EFAULT
        signal/sparc32: Remove unreachable do_exit in do_sparc_fault
        ...
      5147da90
    • Linus Torvalds's avatar
      Merge tag 'kernel.sys.v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux · a41b7445
      Linus Torvalds authored
      Pull prctl updates from Christian Brauner:
       "This contains the missing prctl uapi pieces for PR_SCHED_CORE.
      
        In order to activate core scheduling the caller is expected to specify
        the scope of the new core scheduling domain.
      
        For example, passing 2 in the 4th argument of
      
           prctl(PR_SCHED_CORE, PR_SCHED_CORE_CREATE, <pid>,  2, 0);
      
        would indicate that the new core scheduling domain encompasses all
        tasks in the process group of <pid>. Specifying 0 would only create a
        core scheduling domain for the thread identified by <pid> and 2 would
        encompass the whole thread-group of <pid>.
      
        Note, the values 0, 1, and 2 correspond to PIDTYPE_PID, PIDTYPE_TGID,
        and PIDTYPE_PGID. A first version tried to expose those values
        directly to which I objected because:
      
         - PIDTYPE_* is an enum that is kernel internal which we should not
           expose to userspace directly.
      
         - PIDTYPE_* indicates what a given struct pid is used for it doesn't
           express a scope.
      
        But what the 4th argument of PR_SCHED_CORE prctl() expresses is the
        scope of the operation, i.e. the scope of the core scheduling domain
        at creation time. So Eugene's patch now simply introduces three new
        defines PR_SCHED_CORE_SCOPE_THREAD, PR_SCHED_CORE_SCOPE_THREAD_GROUP,
        and PR_SCHED_CORE_SCOPE_PROCESS_GROUP. They simply express what
        happens.
      
        This has been on the mailing list for quite a while with all relevant
        scheduler folks Cced. I announced multiple times that I'd pick this up
        if I don't see or her anyone else doing it. None of this touches
        proper scheduler code but only concerns uapi so I think this is fine.
      
        With core scheduling being quite common now for vm managers (e.g.
        moving individual vcpu threads into their own core scheduling domain)
        and container managers (e.g. moving the init process into its own core
        scheduling domain and letting all created children inherit it) having
        to rely on raw numbers passed as the 4th argument in prctl() is a bit
        annoying and everyone is starting to come up with their own defines"
      
      * tag 'kernel.sys.v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
        uapi/linux/prctl: provide macro definitions for the PR_SCHED_CORE type argument
      a41b7445
    • Linus Torvalds's avatar
      Merge tag 'pidfd.v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux · 6752de1a
      Linus Torvalds authored
      Pull pidfd updates from Christian Brauner:
       "Various places in the kernel have picked up pidfds.
      
        The two most recent additions have probably been the ability to use
        pidfds in bpf maps and the usage of pidfds in mm-based syscalls such
        as process_mrelease() and process_madvise().
      
        The same pattern to turn a pidfd into a struct task exists in two
        places. One of those places used PIDTYPE_TGID while the other one used
        PIDTYPE_PID even though it is clearly documented in all pidfd-helpers
        that pidfds __currently__ only refer to thread-group leaders (subject
        to change in the future if need be).
      
        This isn't a bug per se but has the potential to be one if we allow
        pidfds to refer to individual threads. If that happens we want to
        audit all codepaths that make use of them to ensure they can deal with
        pidfds refering to individual threads.
      
        This adds a simple helper to turn a pidfd into a struct task making it
        easy to grep for such places. Plus, it gets rid of code-duplication"
      
      * tag 'pidfd.v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
        mm: use pidfd_get_task()
        pid: add pidfd_get_task() helper
      6752de1a
    • Linus Torvalds's avatar
      Merge tag 'thermal-5.16-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 88100752
      Linus Torvalds authored
      Pull more thermal control updates from Rafael Wysocki:
       "These fix two issues in the thermal core and one in the int340x
        thermal driver.
      
        Specifics:
      
         - Replace pr_warn() with pr_warn_once() in user_space_bind() to
           reduce kernel log noise (Rafael Wysocki).
      
         - Extend the RFIM mailbox interface in the int340x thermal driver to
           return 64 bit values to allow all values returned by the hardware
           to be handled correctly (Srinivas Pandruvada).
      
         - Fix possible NULL pointer dereferences in the of_thermal_ family of
           functions (Subbaraman Narayanamurthy)"
      
      * tag 'thermal-5.16-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        thermal: Replace pr_warn() with pr_warn_once() in user_space_bind()
        thermal: Fix NULL pointer dereferences in of_thermal_ functions
        thermal/drivers/int340x: processor_thermal: Suppot 64 bit RFIM responses
      88100752
    • Linus Torvalds's avatar
      Merge tag 'pm-5.16-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · d422555f
      Linus Torvalds authored
      Pull more power management updates from Rafael Wysocki:
       "These fix three intel_pstate driver regressions, fix locking in the
        core code suspending and resuming devices during system PM
        transitions, fix the handling of cpuidle drivers based on runtime PM
        during system-wide suspend, fix two issues in the operating
        performance points (OPP) framework and resource-managed helpers to it.
      
        Specifics:
      
         - Fix two intel_pstate driver regressions related to the HWP
           interrupt handling added recently (Srinivas Pandruvada).
      
         - Fix intel_pstate driver regression introduced during the 5.11 cycle
           and causing HWP desired performance to be mishandled in some cases
           when switching driver modes and during system suspend and shutdown
           (Rafael Wysocki).
      
         - Fix system-wide device suspend and resume locking to avoid
           deadlocks when device objects are deleted during a system-wide PM
           transition (Rafael Wysocki).
      
         - Modify system-wide suspend of devices to prevent cpuidle drivers
           based on runtime PM from misbehaving during the "no IRQ" phase of
           it (Ulf Hansson).
      
         - Fix return value of _opp_add_static_v2() helper (YueHaibing).
      
         - Fix required-opp handle count (Pavankumar Kondeti).
      
         - Add resource managed OPP helpers, update dev_pm_opp_attach_genpd(),
           update their devfreq users, and make minor DT binding change
           (Dmitry Osipenko)"
      
      * tag 'pm-5.16-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        PM: sleep: Avoid calling put_device() under dpm_list_mtx
        cpufreq: intel_pstate: Clear HWP Status during HWP Interrupt enable
        cpufreq: intel_pstate: Fix unchecked MSR 0x773 access
        cpufreq: intel_pstate: Clear HWP desired on suspend/shutdown and offline
        PM: sleep: Fix runtime PM based cpuidle support
        dt-bindings: opp: Allow multi-worded OPP entry name
        opp: Fix return in _opp_add_static_v2()
        PM / devfreq: tegra30: Check whether clk_round_rate() returns zero rate
        PM / devfreq: tegra30: Use resource-managed helpers
        PM / devfreq: Add devm_devfreq_add_governor()
        opp: Add more resource-managed variants of dev_pm_opp_of_add_table()
        opp: Change type of dev_pm_opp_attach_genpd(names) argument
        opp: Fix required-opps phandle array count check
      d422555f
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.16-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 285fc3db
      Linus Torvalds authored
      Pull more ACPI updates from Rafael Wysocki:
       "These add support for a new ACPI device configuration object called
        _DSC, fix some issues including one recent regression, add two new
        items to quirk lists and clean up assorted pieces of code.
      
        Specifics:
      
         - Add support for new ACPI device configuration object called _DSC
           ("Deepest State for Configuration") to allow certain devices to be
           probed without changing their power states, document it and make
           two drivers use it (Sakari Ailus, Rajmohan Mani).
      
         - Fix device wakeup power reference counting broken recently by
           mistake (Rafael Wysocki).
      
         - Drop unused symbol and macros depending on it from acgcc.h (Rafael
           Wysocki).
      
         - Add HP ZHAN 66 Pro to the "no EC wakeup" quirk list (Binbin Zhou).
      
         - Add Xiaomi Mi Pad 2 to the backlight quirk list and drop an unused
           piece of data from all of the list entries (Hans de Goede).
      
         - Fix register read accesses handling in the Intel PMIC operation
           region driver (Hans de Goede).
      
         - Clean up static variables initialization in the EC driver
           (wangzhitong)"
      
      * tag 'acpi-5.16-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        Documentation: ACPI: Fix non-D0 probe _DSC object example
        ACPI: Drop ACPI_USE_BUILTIN_STDARG ifdef from acgcc.h
        ACPI: PM: Fix device wakeup power reference counting error
        ACPI: video: use platform backlight driver on Xiaomi Mi Pad 2
        ACPI: video: Drop dmi_system_id.ident settings from video_detect_dmi_table[]
        ACPI: PMIC: Fix intel_pmic_regs_handler() read accesses
        ACPI: EC: Remove initialization of static variables to false
        ACPI: EC: Use ec_no_wakeup on HP ZHAN 66 Pro
        at24: Support probing while in non-zero ACPI D state
        media: i2c: imx319: Support device probe in non-zero ACPI D state
        ACPI: Add a convenience function to tell a device is in D0 state
        Documentation: ACPI: Document _DSC object usage for enum power state
        i2c: Allow an ACPI driver to manage the device's power state during probe
        ACPI: scan: Obtain device's desired enumeration power state
      285fc3db
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · e68a7d35
      Linus Torvalds authored
      Pull dmaengine updates from Vinod Koul:
       "A bunch of driver updates, no new driver or controller support this
        time though:
      
         - Another pile of idxd updates
      
         - pm routines cleanup for at_xdmac driver
      
         - Correct handling of callback_result for few drivers
      
         - zynqmp_dma driver updates and descriptor management refinement
      
         - Hardware handshaking support for dw-axi-dmac
      
         - Support for remotely powered controllers in Qcom bam dma
      
         - tegra driver updates"
      
      * tag 'dmaengine-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (69 commits)
        dmaengine: ti: k3-udma: Set r/tchan or rflow to NULL if request fail
        dmaengine: ti: k3-udma: Set bchan to NULL if a channel request fail
        dmaengine: stm32-dma: avoid 64-bit division in stm32_dma_get_max_width
        dmaengine: fsl-edma: support edma memcpy
        dmaengine: idxd: fix resource leak on dmaengine driver disable
        dmaengine: idxd: cleanup completion record allocation
        dmaengine: zynqmp_dma: Correctly handle descriptor callbacks
        dmaengine: xilinx_dma: Correctly handle cyclic descriptor callbacks
        dmaengine: altera-msgdma: Correctly handle descriptor callbacks
        dmaengine: at_xdmac: fix compilation warning
        dmaengine: dw-axi-dmac: Simplify assignment in dma_chan_pause()
        dmaengine: qcom: bam_dma: Add "powered remotely" mode
        dt-bindings: dmaengine: bam_dma: Add "powered remotely" mode
        dmaengine: sa11x0: Mark PM functions as __maybe_unused
        dmaengine: switch from 'pci_' to 'dma_' API
        dmaengine: ioat: switch from 'pci_' to 'dma_' API
        dmaengine: hsu: switch from 'pci_' to 'dma_' API
        dmaengine: hisi_dma: switch from 'pci_' to 'dma_' API
        dmaengine: dw: switch from 'pci_' to 'dma_' API
        dmaengine: dw-edma-pcie: switch from 'pci_' to 'dma_' API
        ...
      e68a7d35
    • Linus Torvalds's avatar
      Merge tag 'tag-chrome-platform-for-v5.16' of... · d4efc0de
      Linus Torvalds authored
      Merge tag 'tag-chrome-platform-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux
      
      Pull chrome platform updates from Benson Leung:
       "cros_ec_typec:
      
         - Clean up use of cros_ec_check_features
      
        cros_ec_*:
      
         - Rename and move cros_ec_pd_command to cros_ec_command, and make
           changes to cros_ec_typec and cros_ec_proto to use the new common
           command, reducing duplication.
      
        sensorhub:
      
         - simplify getting .driver_data in cros_ec_sensors_core and
           cros_ec_sensorhub
      
        misc:
      
         - Maintainership change. Enric Balletbo i Serra has moved on from
           Collabora, so removing him from chrome/platform maintainers. Thanks
           for all of your hard work maintaining this, Enric, and best of luck
           to you in your new role!
      
         - Add Prashant Malani as driver maintainer for cros_ec_typec.c and
           cros_usbpd_notify. He was already principal contributor of these
           drivers"
      
      * tag 'tag-chrome-platform-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
        platform/chrome: cros_ec_proto: Use ec_command for check_features
        platform/chrome: cros_ec_proto: Use EC struct for features
        MAINTAINERS: Chrome: Drop Enric Balletbo i Serra
        platform/chrome: cros_ec_typec: Use cros_ec_command()
        platform/chrome: cros_ec_proto: Add version for ec_command
        platform/chrome: cros_ec_proto: Make data pointers void
        platform/chrome: cros_usbpd_notify: Move ec_command()
        platform/chrome: cros_usbpd_notify: Rename cros_ec_pd_command()
        platform/chrome: cros_ec: Fix spelling mistake "responsed" -> "response"
        platform/chrome: cros_ec_sensorhub: simplify getting .driver_data
        iio: common: cros_ec_sensors: simplify getting .driver_data
        platform/chrome: cros-ec-typec: Cleanup use of check_features
        platform/chrome: cros_ec_proto: Fix check_features ret val
        MAINTAINERS: Add Prashant's maintainership of cros_ec drivers
      d4efc0de
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 89fa0be0
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
      
       - Fix double-evaluation of 'pte' macro argument when using 52-bit PAs
      
       - Fix signedness of some MTE prctl PR_* constants
      
       - Fix kmemleak memory usage by skipping early pgtable allocations
      
       - Fix printing of CPU feature register strings
      
       - Remove redundant -nostdlib linker flag for vDSO binaries
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: pgtable: make __pte_to_phys/__phys_to_pte_val inline functions
        arm64: Track no early_pgtable_alloc() for kmemleak
        arm64: mte: change PR_MTE_TCF_NONE back into an unsigned long
        arm64: vdso: remove -nostdlib compiler flag
        arm64: arm64_ftr_reg->name may not be a human-readable string
      89fa0be0
    • Linus Torvalds's avatar
      Merge tag 'arm-fixes-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 3f55f177
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "This is one set of fixes for the NXP/FSL DPAA2 drivers, addressing a
        few minor issues. I received these just after sending out the last
        v5.15 fixes, and nothing in here seemed urgent enough for a quick
        follow-up"
      
      * tag 'arm-fixes-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
        soc: fsl: dpaa2-console: free buffer before returning from dpaa2_console_read
        soc: fsl: dpio: use the combined functions to protect critical zone
        soc: fsl: dpio: replace smp_processor_id with raw_smp_processor_id
      3f55f177
    • Linus Torvalds's avatar
      Merge tag 'asm-generic-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic · e8f023ca
      Linus Torvalds authored
      Pull asm-generic cleanup from Arnd Bergmann:
       "This is a single cleanup from Peter Collingbourne, removing some dead
        code"
      
      * tag 'asm-generic-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
        arch: remove unused function syscall_set_arguments()
      e8f023ca
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.16b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · bf98ecbb
      Linus Torvalds authored
      Pull xen updates from Juergen Gross:
      
       - a series to speed up the boot of Xen PV guests
      
       - some cleanups in Xen related code
      
       - replacement of license texts with the appropriate SPDX headers and
         fixing of wrong SPDX headers in Xen header files
      
       - a small series making paravirtualized interrupt masking much simpler
         and at the same time removing complaints of objtool
      
       - a fix for Xen ballooning hogging workqueues for too long
      
       - enablement of the Xen pciback driver for Arm
      
       - some further small fixes/enhancements
      
      * tag 'for-linus-5.16b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (22 commits)
        xen/balloon: fix unused-variable warning
        xen/balloon: rename alloc/free_xenballooned_pages
        xen/balloon: add late_initcall_sync() for initial ballooning done
        x86/xen: remove 32-bit awareness from startup_xen
        xen: remove highmem remnants
        xen: allow pv-only hypercalls only with CONFIG_XEN_PV
        x86/xen: remove 32-bit pv leftovers
        xen-pciback: allow compiling on other archs than x86
        x86/xen: switch initial pvops IRQ functions to dummy ones
        x86/xen: remove xen_have_vcpu_info_placement flag
        x86/pvh: add prototype for xen_pvh_init()
        xen: Fix implicit type conversion
        xen: fix wrong SPDX headers of Xen related headers
        xen/pvcalls-back: Remove redundant 'flush_workqueue()' calls
        x86/xen: Remove redundant irq_enter/exit() invocations
        xen-pciback: Fix return in pm_ctrl_init()
        xen/x86: restrict PV Dom0 identity mapping
        xen/x86: there's no highmem anymore in PV mode
        xen/x86: adjust handling of the L3 user vsyscall special page table
        xen/x86: adjust xen_set_fixmap()
        ...
      bf98ecbb
    • Linus Torvalds's avatar
      Merge tag 'libnvdimm-for-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · 4287af35
      Linus Torvalds authored
      Pull libnvdimm update from Dan Williams:
       "A single cleanup that precedes some deeper PMEM/DAX reworks that did
        not settle in time for v5.16:
      
         - Continue the cleanup of the dax api in preparation for a dax-device
           block-device divorce"
      
      * tag 'libnvdimm-for-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        nvdimm/pmem: move dax_attribute_group from dax to pmem
      4287af35
    • Linus Torvalds's avatar
      Merge tag 'linux-watchdog-5.16-rc1' of git://www.linux-watchdog.org/linux-watchdog · 89d714ab
      Linus Torvalds authored
      Pull watchdog updates from Wim Van Sebroeck:
      
       - f71808e_wdt: convert to watchdog framework
      
       - db8500_wdt: Rename driver (was ux500_wdt.c)
      
       - sunxi: Add compatibles for R329 and D1
      
       - mtk: add disable_wdt_extrst support
      
       - several other small fixes and improvements
      
      * tag 'linux-watchdog-5.16-rc1' of git://www.linux-watchdog.org/linux-watchdog: (30 commits)
        watchdog: db8500_wdt: Rename symbols
        watchdog: db8500_wdt: Rename driver
        watchdog: ux500_wdt: Drop platform data
        watchdog: bcm63xx_wdt: fix fallthrough warning
        watchdog: iTCO_wdt: No need to stop the timer in probe
        watchdog: s3c2410: describe driver in KConfig
        watchdog: sp5100_tco: Add support for get_timeleft
        watchdog: mtk: add disable_wdt_extrst support
        dt-bindings: watchdog: mtk-wdt: add disable_wdt_extrst support
        watchdog: rza_wdt: Use semicolons instead of commas
        watchdog: mlx-wdt: Use regmap_write_bits()
        watchdog: rti-wdt: Make use of the helper function devm_platform_ioremap_resource()
        watchdog: iTCO_wdt: Make use of the helper function devm_platform_ioremap_resource()
        watchdog: ar7_wdt: Make use of the helper function devm_platform_ioremap_resource_byname()
        watchdog: sunxi_wdt: Add support for D1
        dt-bindings: watchdog: sunxi: Add compatibles for D1
        ar7: fix kernel builds for compiler test
        dt-bindings: watchdog: sunxi: Add compatibles for R329
        watchdog: meson_gxbb_wdt: add timeout parameter
        watchdog: meson_gxbb_wdt: add nowayout parameter
        ...
      89d714ab
    • Linus Torvalds's avatar
      Merge tag 'rproc-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux · bd485d27
      Linus Torvalds authored
      Pull remoteproc updates from Bjorn Andersson:
       "The remoteproc repo is moved to a new path on git.kernel.org, to allow
        Mathieu push access to the branches.
      
        Support for the Mediatek MT8195 SCP was added, the related DeviceTree
        binding was converted to YAML and MT8192 SCP was documented as well.
      
        Amlogic Meson6, Meson8, Meson8b and Meson8m2 has an ARC core to aid in
        resuming the system after suspend, a new remoteproc driver for booting
        this core is introduced.
      
        A new driver to support the DSP processor found on NXP i.MX8QM,
        i.MX8QXP, i.MX8MP and i.MX8ULP is added.
      
        The Qualcomm modem and TrustZone based remoteproc drivers gains
        support for the modem in SC7280 and MSM8996 gains support for a
        missing power-domain.
      
        Throughout the Qualcomm drivers, the support for informing the
        always-on power coprocessor about the state of each remoteproc is
        reworked to avoid complications related to our use of genpd and the
        system suspend state.
      
        Lastly a number of small fixes are found throughout the drivers and
        framework"
      
      * tag 'rproc-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (39 commits)
        remoteproc: Remove vdev_to_rvdev and vdev_to_rproc from remoteproc API
        remoteproc: omap_remoteproc: simplify getting .driver_data
        remoteproc: qcom_q6v5_mss: Use devm_platform_ioremap_resource_byname() to simplify code
        remoteproc: Fix a memory leak in an error handling path in 'rproc_handle_vdev()'
        remoteproc: Fix spelling mistake "atleast" -> "at least"
        remoteproc: imx_dsp_rproc: mark PM functions as __maybe_unused
        remoteproc: imx_dsp_rproc: Correct the comment style of copyright
        dt-bindings: dsp: fsl: Update binding document for remote proc driver
        remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX
        remoteproc: imx_rproc: Add IMX_RPROC_SCU_API method
        remoteproc: imx_rproc: Move common structure to header file
        rpmsg: char: Remove useless include
        remoteproc: meson-mx-ao-arc: fix a bit test
        remoteproc: mss: q6v5-mss: Add modem support on SC7280
        dt-bindings: remoteproc: qcom: Update Q6V5 Modem PIL binding
        remoteproc: qcom: pas: Add SC7280 Modem support
        dt-bindings: remoteproc: qcom: pas: Add SC7280 MPSS support
        remoteproc: qcom: pas: Use the same init resources for MSM8996 and MSM8998
        MAINTAINERS: Update remoteproc repo url
        dt-bindings: remoteproc: k3-dsp: Cleanup SoC compatible from DT example
        ...
      bd485d27
    • Linus Torvalds's avatar
      Merge tag 'rpmsg-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux · becc1fb4
      Linus Torvalds authored
      Pull rpmsg updates from Bjorn Andersson:
       "For the GLINK implementation this adds support for splitting outgoing
        messages that are too large to fit in the fifo, it introduces the use
        of "read notifications", to avoid polling in the case where the
        outgoing fifo is full and a few bugs are squashed.
      
        The return value of rpmsg_create_ept() for when RPMSG is disabled is
        corrected to return a valid error, the Mediatek rpmsg driver is
        updated to match the DT binding and a couple of cleanups are done in
        the virtio rpmsg driver"
      
      * tag 'rpmsg-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux:
        rpmsg: glink: Send READ_NOTIFY command in FIFO full case
        rpmsg: glink: Remove channel decouple from rpdev release
        rpmsg: glink: Remove the rpmsg dev in close_ack
        rpmsg: glink: Add TX_DATA_CONT command while sending
        rpmsg: virtio_rpmsg_bus: use dev_warn_ratelimited for msg with no recipient
        rpmsg: virtio: Remove unused including <linux/of_device.h>
        rpmsg: Change naming of mediatek rpmsg property
        rpmsg: Fix rpmsg_create_ept return when RPMSG config is not defined
        rpmsg: glink: Replace strncpy() with strscpy_pad()
      becc1fb4
    • Jiri Olsa's avatar
      ftrace/direct: Fix lockup in modify_ftrace_direct_multi · 2e6e9058
      Jiri Olsa authored
      We can't call unregister_ftrace_function under ftrace_lock.
      
      Link: https://lkml.kernel.org/r/20211109114217.1645296-1-jolsa@kernel.org
      
      Fixes: ed292718
      
       ("ftrace/direct: Do not disable when switching direct callers")
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      2e6e9058
    • Steven Rostedt (VMware)'s avatar
      ring-buffer: Protect ring_buffer_reset() from reentrancy · 51d15794
      Steven Rostedt (VMware) authored
      The resetting of the entire ring buffer use to simply go through and reset
      each individual CPU buffer that had its own protection and synchronization.
      But this was very slow, due to performing a synchronization for each CPU.
      The code was reshuffled to do one disabling of all CPU buffers, followed
      by a single RCU synchronization, and then the resetting of each of the CPU
      buffers. But unfortunately, the mutex that prevented multiple occurrences
      of resetting the buffer was not moved to the upper function, and there is
      nothing to protect from it.
      
      Take the ring buffer mutex around the global reset.
      
      Cc: stable@vger.kernel.org
      Fixes: b23d7a5f
      
       ("ring-buffer: speed up buffer resets by avoiding synchronize_rcu for each CPU")
      Reported-by: default avatar"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      51d15794
  3. Nov 10, 2021
    • Dust Li's avatar
      net/smc: fix sk_refcnt underflow on linkdown and fallback · e5d5aadc
      Dust Li authored
      We got the following WARNING when running ab/nginx
      test with RDMA link flapping (up-down-up).
      The reason is when smc_sock fallback and at linkdown
      happens simultaneously, we may got the following situation:
      
      __smc_lgr_terminate()
       --> smc_conn_kill()
          --> smc_close_active_abort()
                 smc_sock->sk_state = SMC_CLOSED
                 sock_put(smc_sock)
      
      smc_sock was set to SMC_CLOSED and sock_put() been called
      when terminate the link group. But later application call
      close() on the socket, then we got:
      
      __smc_release():
          if (smc_sock->fallback)
              smc_sock->sk_state = SMC_CLOSED
              sock_put(smc_sock)
      
      Again we set the smc_sock to CLOSED through it's already
      in CLOSED state, and double put the refcnt, so the following
      warning happens:
      
      refcount_t: underflow; use-after-free.
      WARNING: CPU: 5 PID: 860 at lib/refcount.c:28 refcount_warn_saturate+0x8d/0xf0
      Modules linked in:
      CPU: 5 PID: 860 Comm: nginx Not tainted 5.10.46+ #403
      Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS 8c24b4c 04/01/2014
      RIP: 0010:refcount_warn_saturate+0x8d/0xf0
      Code: 05 5c 1e b5 01 01 e8 52 25 bc ff 0f 0b c3 80 3d 4f 1e b5 01 00 75 ad 48
      
      RSP: 0018:ffffc90000527e50 EFLAGS: 00010286
      RAX: 0000000000000026 RBX: ffff8881300df2c0 RCX: 0000000000000027
      RDX: 0000000000000000 RSI: ffff88813bd58040 RDI: ffff88813bd58048
      RBP: 0000000000000000 R08: 0000000000000003 R09: 0000000000000001
      R10: ffff8881300df2c0 R11: ffffc90000527c78 R12: ffff8881300df340
      R13: ffff8881300df930 R14: ffff88810b3dad80 R15: ffff8881300df4f8
      FS:  00007f739de8fb80(0000) GS:ffff88813bd40000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 000000000a01b008 CR3: 0000000111b64003 CR4: 00000000003706e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       smc_release+0x353/0x3f0
       __sock_release+0x3d/0xb0
       sock_close+0x11/0x20
       __fput+0x93/0x230
       task_work_run+0x65/0xa0
       exit_to_user_mode_prepare+0xf9/0x100
       syscall_exit_to_user_mode+0x27/0x190
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      This patch adds check in __smc_release() to make
      sure we won't do an extra sock_put() and set the
      socket to CLOSED when its already in CLOSED state.
      
      Fixes: 51f1de79
      
       (net/smc: replace sock_put worker by socket refcounting)
      Signed-off-by: default avatarDust Li <dust.li@linux.alibaba.com>
      Reviewed-by: default avatarTony Lu <tonylu@linux.alibaba.com>
      Signed-off-by: default avatarDust Li <dust.li@linux.alibaba.com>
      Acked-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e5d5aadc
    • Dan Carpenter's avatar
      net/mlx5: Lag, fix a potential Oops with mlx5_lag_create_definer() · c7ebe23c
      Dan Carpenter authored
      There is a minus character missing from ERR_PTR(ENOMEM) so if this
      allocation fails it will lead to an Oops in the caller.
      
      Fixes: dc48516e
      
       ("net/mlx5: Lag, add support to create definers for LAG")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c7ebe23c
    • Dan Carpenter's avatar
      gve: fix unmatched u64_stats_update_end() · 721111b1
      Dan Carpenter authored
      The u64_stats_update_end() call is supposed to be inside the curly
      braces so it pairs with the u64_stats_update_begin().
      
      Fixes: 37149e93
      
       ("gve: Implement packet continuation for RX.")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      721111b1
    • Aleksander Jan Bajkowski's avatar
      net: ethernet: lantiq_etop: Fix compilation error · 68eabc34
      Aleksander Jan Bajkowski authored
      This fixes the error detected when compiling the driver.
      
      Fixes: 14d4e308
      
       ("net: lantiq: configure the burst length in ethernet drivers")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarAleksander Jan Bajkowski <olek2@wp.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      68eabc34
    • Petr Machata's avatar
      selftests: forwarding: Fix packet matching in mirroring selftests · af0a5111
      Petr Machata authored
      In commit 6de6e46d ("cls_flower: Fix inability to match GRE/IPIP
      packets"), cls_flower was fixed to match an outer packet of a tunneled
      packet as would be expected, rather than dissecting to the inner packet and
      matching on that.
      
      This fix uncovered several issues in packet matching in mirroring
      selftests:
      
      - in mirror_gre_bridge_1d_vlan.sh and mirror_gre_vlan_bridge_1q.sh, the
        vlan_ethtype match is copied around as "ip", even as some of the tests
        are running over ip6gretap. This is fixed by using an "ipv6" for
        vlan_ethtype in the ip6gretap tests.
      
      - in mirror_gre_changes.sh, a filter to count GRE packets is set up to
        match TTL of 50. This used to trigger in the offloaded datapath, where
        the envelope TTL was matched, but not in the software datapath, which
        considered TTL of the inner packet. Now that both match consistently, all
        the packets were double-counted. This is fixed by marking the filter as
        skip_hw, leaving only the SW datapath component active.
      
      Fixes: 6de6e46d
      
       ("cls_flower: Fix inability to match GRE/IPIP packets")
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      af0a5111
    • Eiichi Tsukata's avatar
      vsock: prevent unnecessary refcnt inc for nonblocking connect · c7cd82b9
      Eiichi Tsukata authored
      Currently vosck_connect() increments sock refcount for nonblocking
      socket each time it's called, which can lead to memory leak if
      it's called multiple times because connect timeout function decrements
      sock refcount only once.
      
      Fixes it by making vsock_connect() return -EALREADY immediately when
      sock state is already SS_CONNECTING.
      
      Fixes: d021c344
      
       ("VSOCK: Introduce VM Sockets")
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Signed-off-by: default avatarEiichi Tsukata <eiichi.tsukata@nutanix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c7cd82b9
    • Marek Behún's avatar
      net: marvell: mvpp2: Fix wrong SerDes reconfiguration order · bb7bbb6e
      Marek Behún authored
      Commit bfe301eb ("net: mvpp2: convert to use
      mac_prepare()/mac_finish()") introduced a bug wherein it leaves the MAC
      RESET register asserted after mac_finish(), due to wrong order of
      function calls.
      
      Before it was:
        .mac_config()
          mvpp22_mode_reconfigure()
            assert reset
          mvpp2_xlg_config()
            deassert reset
      
      Now it is:
        .mac_prepare()
        .mac_config()
          mvpp2_xlg_config()
            deassert reset
        .mac_finish()
          mvpp2_xlg_config()
            assert reset
      
      Obviously this is wrong.
      
      This bug is triggered when phylink tries to change the PHY interface
      mode from a GMAC mode (sgmii, 1000base-x, 2500base-x) to XLG mode
      (10gbase-r, xaui). The XLG mode does not work since reset is left
      asserted. Only after
        ifconfig down && ifconfig up
      is called will the XLG mode work.
      
      Move the call to mvpp22_mode_reconfigure() to .mac_prepare()
      implementation. Since some of the subsequent functions need to know
      whether the interface is being changed, we unfortunately also need to
      pass around the new interface mode before setting port->phy_interface.
      
      Fixes: bfe301eb
      
       ("net: mvpp2: convert to use mac_prepare()/mac_finish()")
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bb7bbb6e
    • Christophe JAILLET's avatar
      net: ethernet: ti: cpsw_ale: Fix access to un-initialized memory · 7a166854
      Christophe JAILLET authored
      It is spurious to allocate a bitmap without initializing it.
      So, better safe than sorry, initialize it to 0 at least to have some known
      values.
      
      While at it, switch to the devm_bitmap_ API which is less verbose.
      
      Fixes: 4b41d343
      
       ("net: ethernet: ti: cpsw: allow untagged traffic on host port")
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7a166854
    • Vladimir Oltean's avatar
      net: stmmac: allow a tc-taprio base-time of zero · f64ab8e4
      Vladimir Oltean authored
      Commit fe28c53e ("net: stmmac: fix taprio configuration when
      base_time is in the past") allowed some base time values in the past,
      but apparently not all, the base-time value of 0 (Jan 1st 1970) is still
      explicitly denied by the driver.
      
      Remove the bogus check.
      
      Fixes: b60189e0
      
       ("net: stmmac: Integrate EST with TAPRIO scheduler API")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f64ab8e4
    • Andrea Righi's avatar
      selftests: net: test_vxlan_under_vrf: fix HV connectivity test · e7e4785f
      Andrea Righi authored
      
      
      It looks like test_vxlan_under_vrf.sh is always failing to verify the
      connectivity test during the ping between the two simulated VMs.
      
      This is due to the fact that veth-hv in each VM should have a distinct
      MAC address.
      
      Fix by setting a unique MAC address on each simulated VM interface.
      
      Without this fix:
      
       $ sudo ./tools/testing/selftests/net/test_vxlan_under_vrf.sh
       Checking HV connectivity                                           [ OK ]
       Check VM connectivity through VXLAN (underlay in the default VRF)  [FAIL]
      
      With this fix applied:
      
       $ sudo ./tools/testing/selftests/net/test_vxlan_under_vrf.sh
       Checking HV connectivity                                           [ OK ]
       Check VM connectivity through VXLAN (underlay in the default VRF)  [ OK ]
       Check VM connectivity through VXLAN (underlay in a VRF)            [FAIL]
      
      NOTE: the connectivity test with the underlay VRF is still failing; it
      seems that ARP requests are blocked at the simulated hypervisor level,
      probably due to some missing ARP forwarding rules. This requires more
      investigation (in the meantime we may consider to set that test as
      expected failure - XFAIL).
      
      Signed-off-by: default avatarAndrea Righi <andrea.righi@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e7e4785f