Skip to content
  1. Mar 29, 2022
    • Magnus Karlsson's avatar
      xsk: Do not write NULL in SW ring at allocation failure · a95a4d9b
      Magnus Karlsson authored
      For the case when xp_alloc_batch() is used but the batched allocation
      cannot be used, there is a slow path that uses the non-batched
      xp_alloc(). When it fails to allocate an entry, it returns NULL. The
      current code wrote this NULL into the entry of the provided results
      array (pointer to the driver SW ring usually) and returned. This might
      not be what the driver expects and to make things simpler, just write
      successfully allocated xdp_buffs into the SW ring,. The driver might
      have information in there that is still important after an allocation
      failure.
      
      Note that at this point in time, there are no drivers using
      xp_alloc_batch() that could trigger this slow path. But one might get
      added.
      
      Fixes: 47e4075d
      
       ("xsk: Batched buffer allocation for the pool")
      Signed-off-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20220328142123.170157-2-maciej.fijalkowski@intel.com
      a95a4d9b
    • Alexei Starovoitov's avatar
      Merge branch 'kprobes: rethook: x86: Replace kretprobe trampoline with rethook' · 7df482e6
      Alexei Starovoitov authored
      
      
      Masami Hiramatsu says:
      
      ====================
      Here are the 3rd version for generic kretprobe and kretprobe on x86 for
      replacing the kretprobe trampoline with rethook. The previous version
      is here[1]
      
      [1] https://lore.kernel.org/all/164821817332.2373735.12048266953420821089.stgit@devnote2/T/#u
      
      This version fixed typo and build issues for bpf-next and CONFIG_RETHOOK=y
      error. I also add temporary mitigation lines for ANNOTATE_NOENDBR macro
      issue for bpf-next tree [2/4].
      
      This will be removed after merging kernel IBT series.
      
      Background:
      
      This rethook came from Jiri's request of multiple kprobe for bpf[2].
      He tried to solve an issue that starting bpf with multiple kprobe will
      take a long time because bpf-kprobe will wait for RCU grace period for
      sync rcu events.
      
      Jiri wanted to attach a single bpf handler to multiple kprobes and
      he tried to introduce multiple-probe interface to kprobe. So I asked
      him to use ftrace and kretprobe-like hook if it is only for the
      function entry and exit, instead of adding ad-hoc interface
      to kprobes.
      For this purpose, I introduced the fprobe (kprobe like interface for
      ftrace) with the rethook (this is a generic return hook feature for
      fprobe exit handler)[3].
      
      [2] https://lore.kernel.org/all/20220104080943.113249-1-jolsa@kernel.org/T/#u
      [3] https://lore.kernel.org/all/164191321766.806991.7930388561276940676.stgit@devnote2/T/#u
      
      The rethook is basically same as the kretprobe trampoline. I just made
      it decoupled from kprobes. Eventually, the all arch dependent kretprobe
      trampolines will be replaced with the rethook trampoline instead of
      cloning and set HAVE_RETHOOK=y.
      When I port the rethook for all arch which supports kretprobe, the
      legacy kretprobe specific code (which is for CONFIG_KRETPROBE_ON_RETHOOK=n)
      will be removed eventually.
      ====================
      
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      7df482e6
    • Masami Hiramatsu's avatar
      x86,kprobes: Fix optprobe trampoline to generate complete pt_regs · 45c23bf4
      Masami Hiramatsu authored
      
      
      Currently the optprobe trampoline template code ganerate an
      almost complete pt_regs on-stack, everything except regs->ss.
      The 'regs->ss' points to the top of stack, which is not a
      valid segment decriptor.
      
      As same as the rethook does, complete the job by also pushing ss.
      
      Suggested-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/164826166027.2455864.14759128090648961900.stgit@devnote2
      45c23bf4
    • Peter Zijlstra's avatar
      x86,rethook: Fix arch_rethook_trampoline() to generate a complete pt_regs · 0ef6f5c0
      Peter Zijlstra authored
      
      
      Currently arch_rethook_trampoline() generates an almost complete
      pt_regs on-stack, everything except regs->ss that is, that currently
      points to the fake return address, which is not a valid segment
      descriptor.
      
      Since interpretation of regs->[sb]p should be done in the context of
      regs->ss, and we have code actually doing that (see
      arch/x86/lib/insn-eval.c for instance), complete the job by also
      pushing ss.
      
      This ensures that anybody who does do look at regs->ss doesn't
      mysteriously malfunction, avoiding much future pain.
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Reviewed-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Link: https://lore.kernel.org/bpf/164826164851.2455864.17272661073069737350.stgit@devnote2
      0ef6f5c0
    • Masami Hiramatsu's avatar
      x86,rethook,kprobes: Replace kretprobe with rethook on x86 · f3a112c0
      Masami Hiramatsu authored
      
      
      Replaces the kretprobe code with rethook on x86. With this patch,
      kretprobe on x86 uses the rethook instead of kretprobe specific
      trampoline code.
      
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Tested-by: default avatarJiri Olsa <jolsa@kernel.org>
      Link: https://lore.kernel.org/bpf/164826163692.2455864.13745421016848209527.stgit@devnote2
      f3a112c0
    • Masami Hiramatsu's avatar
      kprobes: Use rethook for kretprobe if possible · 73f9b911
      Masami Hiramatsu authored
      
      
      Use rethook for kretprobe function return hooking if the arch sets
      CONFIG_HAVE_RETHOOK=y. In this case, CONFIG_KRETPROBE_ON_RETHOOK is
      set to 'y' automatically, and the kretprobe internal data fields
      switches to use rethook. If not, it continues to use kretprobe
      specific function return hooks.
      
      Suggested-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/164826162556.2455864.12255833167233452047.stgit@devnote2
      73f9b911
    • Jiri Olsa's avatar
      bpftool: Fix generated code in codegen_asserts · ef8a257b
      Jiri Olsa authored
      Arnaldo reported perf compilation fail with:
      
        $ make -k BUILD_BPF_SKEL=1 CORESIGHT=1 PYTHON=python3
        ...
        In file included from util/bpf_counter.c:28:
        /tmp/build/perf//util/bpf_skel/bperf_leader.skel.h: In function ‘bperf_leader_bpf__assert’:
        /tmp/build/perf//util/bpf_skel/bperf_leader.skel.h:351:51: error: unused parameter ‘s’ [-Werror=unused-parameter]
          351 | bperf_leader_bpf__assert(struct bperf_leader_bpf *s)
              |                          ~~~~~~~~~~~~~~~~~~~~~~~~~^
        cc1: all warnings being treated as errors
      
      If there's nothing to generate in the new assert function,
      we will get unused 's' warn/error, adding 'unused' attribute to it.
      
      Fixes: 08d4dba6
      
       ("bpftool: Bpf skeletons assert type sizes")
      Reported-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Link: https://lore.kernel.org/bpf/20220328083703.2880079-1-jolsa@kernel.org
      ef8a257b
    • Andrii Nakryiko's avatar
      selftests/bpf: fix selftest after random: Urandom_read tracepoint removal · 99dea2c6
      Andrii Nakryiko authored
      14c17463
      
       ("random: remove unused tracepoints") removed all the
      tracepoints from drivers/char/random.c, one of which,
      random:urandom_read, was used by stacktrace_build_id selftest to trigger
      stack trace capture.
      
      Fix breakage by switching to kprobing urandom_read() function.
      
      Suggested-by: default avatarYonghong Song <yhs@fb.com>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarYonghong Song <yhs@fb.com>
      Link: https://lore.kernel.org/bpf/20220325225643.2606-1-andrii@kernel.org
      99dea2c6
    • Yuntao Wang's avatar
      bpf: Fix maximum permitted number of arguments check · c29a4920
      Yuntao Wang authored
      
      
      Since the m->arg_size array can hold up to MAX_BPF_FUNC_ARGS argument
      sizes, it's ok that nargs is equal to MAX_BPF_FUNC_ARGS.
      
      Signed-off-by: default avatarYuntao Wang <ytcoode@gmail.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Link: https://lore.kernel.org/bpf/20220324164238.1274915-1-ytcoode@gmail.com
      c29a4920
    • Geliang Tang's avatar
      bpf: Sync comments for bpf_get_stack · 98870605
      Geliang Tang authored
      Commit ee2a0988 missed updating the comments for helper bpf_get_stack
      in tools/include/uapi/linux/bpf.h. Sync it.
      
      Fixes: ee2a0988
      
       ("bpf: Adjust BPF stack helper functions to accommodate skip > 0")
      Signed-off-by: default avatarGeliang Tang <geliang.tang@suse.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Link: https://lore.kernel.org/bpf/ce54617746b7ed5e9ba3b844e55e74cb8a60e0b5.1648110794.git.geliang.tang@suse.com
      98870605
    • Alexei Starovoitov's avatar
      Merge branch 'fprobe: Fixes for Sparse and Smatch warnings' · 76db1784
      Alexei Starovoitov authored
      
      
      Masami Hiramatsu says:
      
      ====================
      
      Hi,
      
      These fprobe patches are for fixing the warnings by Smatch and sparse.
      This is arch independent part of the fixes.
      
      Thank you,
      ---
      ====================
      
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      76db1784
    • Masami Hiramatsu's avatar
      fprobe: Fix sparse warning for acccessing __rcu ftrace_hash · 261608f3
      Masami Hiramatsu authored
      
      
      Since ftrace_ops::local_hash::filter_hash field is an __rcu pointer,
      we have to use rcu_access_pointer() to access it.
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/164802093635.1732982.4938094876018890866.stgit@devnote2
      261608f3
    • Masami Hiramatsu's avatar
      fprobe: Fix smatch type mismatch warning · 9052e4e8
      Masami Hiramatsu authored
      
      
      Fix the type mismatching warning of 'rethook_node vs fprobe_rethook_node'
      found by Smatch.
      
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/164802092611.1732982.12268174743437084619.stgit@devnote2
      9052e4e8
    • Milan Landaverde's avatar
      bpf/bpftool: Add unprivileged_bpf_disabled check against value of 2 · 8c1b2119
      Milan Landaverde authored
      
      
      In [1], we added a kconfig knob that can set
      /proc/sys/kernel/unprivileged_bpf_disabled to 2
      
      We now check against this value in bpftool feature probe
      
      [1] https://lore.kernel.org/bpf/74ec548079189e4e4dffaeb42b8987bb3c852eee.1620765074.git.daniel@iogearbox.net
      
      Signed-off-by: default avatarMilan Landaverde <milan@mdaverde.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarQuentin Monnet <quentin@isovalent.com>
      Acked-by: default avatarKP Singh <kpsingh@kernel.org>
      Link: https://lore.kernel.org/bpf/20220322145012.1315376-1-milan@mdaverde.com
      8c1b2119
    • Linus Torvalds's avatar
      Merge tag 'net-5.18-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · d717e4ca
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from netfilter.
      
        Current release - regressions:
      
         - llc: only change llc->dev when bind() succeeds, fix null-deref
      
        Current release - new code bugs:
      
         - smc: fix a memory leak in smc_sysctl_net_exit()
      
         - dsa: realtek: make interface drivers depend on OF
      
        Previous releases - regressions:
      
         - sched: act_ct: fix ref leak when switching zones
      
        Previous releases - always broken:
      
         - netfilter: egress: report interface as outgoing
      
         - vsock/virtio: enable VQs early on probe and finish the setup before
           using them
      
        Misc:
      
         - memcg: enable accounting for nft objects"
      
      * tag 'net-5.18-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (39 commits)
        Revert "selftests: net: Add tls config dependency for tls selftests"
        net/smc: Send out the remaining data in sndbuf before close
        net: move net_unlink_todo() out of the header
        net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator
        net: bnxt_ptp: fix compilation error
        selftests: net: Add tls config dependency for tls selftests
        memcg: enable accounting for nft objects
        net/sched: act_ct: fix ref leak when switching zones
        net/smc: fix a memory leak in smc_sysctl_net_exit()
        selftests: tls: skip cmsg_to_pipe tests with TLS=n
        octeontx2-af: initialize action variable
        net: sparx5: switchdev: fix possible NULL pointer dereference
        net/x25: Fix null-ptr-deref caused by x25_disconnect
        qlcnic: dcb: default to returning -EOPNOTSUPP
        net: sparx5: depends on PTP_1588_CLOCK_OPTIONAL
        net: hns3: fix phy can not link up when autoneg off and reset
        net: hns3: add NULL pointer check for hns3_set/get_ringparam()
        net: hns3: add netdev reset check for hns3_set_tunable()
        net: hns3: clean residual vf config after disable sriov
        net: hns3: add max order judgement for tx spare buffer
        ...
      d717e4ca
    • Jakub Kicinski's avatar
      Revert "selftests: net: Add tls config dependency for tls selftests" · 20695e9a
      Jakub Kicinski authored
      This reverts commit d9142e1c.
      
      The test is supposed to run cleanly with TLS is disabled,
      to test compatibility with TCP behavior. I can't repro
      the failure [1], the problem should be debugged rather
      than papered over.
      
      Link: https://lore.kernel.org/all/20220325161203.7000698c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/ [1]
      Fixes: d9142e1c
      
       ("selftests: net: Add tls config dependency for tls selftests")
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Link: https://lore.kernel.org/r/20220328212904.2685395-1-kuba@kernel.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      20695e9a
    • Wen Gu's avatar
      net/smc: Send out the remaining data in sndbuf before close · 906b3d64
      Wen Gu authored
      
      
      The current autocork algorithms will delay the data transmission
      in BH context to smc_release_cb() when sock_lock is hold by user.
      
      So there is a possibility that when connection is being actively
      closed (sock_lock is hold by user now), some corked data still
      remains in sndbuf, waiting to be sent by smc_release_cb(). This
      will cause:
      
      - smc_close_stream_wait(), which is called under the sock_lock,
        has a high probability of timeout because data transmission is
        delayed until sock_lock is released.
      
      - Unexpected data sends may happen after connction closed and use
        the rtoken which has been deleted by remote peer through
        LLC_DELETE_RKEY messages.
      
      So this patch will try to send out the remaining corked data in
      sndbuf before active close process, to ensure data integrity and
      avoid unexpected data transmission after close.
      
      Reported-by: default avatarGuangguan Wang <guangguan.wang@linux.alibaba.com>
      Fixes: 6b88af83
      
       ("net/smc: don't send in the BH context if sock_owned_by_user")
      Signed-off-by: default avatarWen Gu <guwen@linux.alibaba.com>
      Acked-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Link: https://lore.kernel.org/r/1648447836-111521-1-git-send-email-guwen@linux.alibaba.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      906b3d64
    • Linus Torvalds's avatar
      Merge tag 'kgdb-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux · cffb2b72
      Linus Torvalds authored
      Pull kgdb update from Daniel Thompson:
       "Only a single patch this cycle. Fix an obvious mistake with the kdb
        memory accessors.
      
        It was a stupid mistake (to/from backwards) but it has been there for
        a long time since many architectures tolerated it with surprisingly
        good grace"
      
      * tag 'kgdb-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux:
        kdb: Fix the putarea helper function
      cffb2b72
    • Linus Torvalds's avatar
      Merge tag 'hexagon-5.18-0' of git://git.kernel.org/pub/scm/linux/kernel/git/bcain/linux · 023f3fef
      Linus Torvalds authored
      Pull hexagon update from Brian Cain:
       "Maintainer email update"
      
      * tag 'hexagon-5.18-0' of git://git.kernel.org/pub/scm/linux/kernel/git/bcain/linux:
        MAINTAINERS: update hexagon maintainer email, tree
      023f3fef
    • Linus Torvalds's avatar
      Merge tag 'microblaze-v5.18' of git://git.monstr.eu/linux-2.6-microblaze · b83d85a5
      Linus Torvalds authored
      Pull microblaze updates from Michal Simek:
      
       - Small fixups
      
       - Remove unused pci_phys_mem_access_prot()
      
      * tag 'microblaze-v5.18' of git://git.monstr.eu/linux-2.6-microblaze:
        microblaze/PCI: Remove pci_phys_mem_access_prot() dead code
        microblaze: add const to of_device_id
        microblaze: fix typo in a comment
      b83d85a5
    • Johannes Berg's avatar
      net: move net_unlink_todo() out of the header · f32404ae
      Johannes Berg authored
      
      
      There's no reason for this to be in netdevice.h, it's all
      just used in dev.c. Also make it no longer inline and let
      the compiler decide to do that by itself.
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Link: https://lore.kernel.org/r/20220325225023.f49b9056fe1c.I6b901a2df00000837a9bd251a8dd259bd23f5ded@changeid
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f32404ae
    • Xiaomeng Tong's avatar
      net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator · 6da69b1d
      Xiaomeng Tong authored
      The bug is here:
      	return rule;
      
      The list iterator value 'rule' will *always* be set and non-NULL
      by list_for_each_entry(), so it is incorrect to assume that the
      iterator value will be NULL if the list is empty or no element
      is found.
      
      To fix the bug, return 'rule' when found, otherwise return NULL.
      
      Fixes: ae7a5aff
      
       ("net: dsa: bcm_sf2: Keep copy of inserted rules")
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarXiaomeng Tong <xiam0nd.tong@gmail.com>
      Link: https://lore.kernel.org/r/20220328032431.22538-1-xiam0nd.tong@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6da69b1d
    • Linus Torvalds's avatar
      Merge tag 'livepatching-for-5.18' of... · d111c9f0
      Linus Torvalds authored
      Merge tag 'livepatching-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching
      
      Pull livepatching updates from Petr Mladek:
      
       - Forced transitions block only to-be-removed livepatches [Chengming]
      
       - Detect when ftrace handler could not be disabled in self-tests [David]
      
       - Calm down warning from a static analyzer [Tom]
      
      * tag 'livepatching-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching:
        livepatch: Reorder to use before freeing a pointer
        livepatch: Don't block removal of patches that are safe to unload
        livepatch: Skip livepatch tests if ftrace cannot be configured
      d111c9f0
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.18-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · a701f370
      Linus Torvalds authored
      Pull xen updates from Juergen Gross:
      
       - A bunch of minor cleanups
      
       - A fix for kexec in Xen dom0 when executed on a high cpu number
      
       - A fix for resuming after suspend of a Xen guest with assigned PCI
         devices
      
       - A fix for a crash due to not disabled preemption when resuming as Xen
         dom0
      
      * tag 'for-linus-5.18-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen: fix is_xen_pmu()
        xen: don't hang when resuming PCI device
        arch:x86:xen: Remove unnecessary assignment in xen_apic_read()
        xen/grant-table: remove readonly parameter from functions
        xen/grant-table: remove gnttab_*transfer*() functions
        drivers/xen: use helper macro __ATTR_RW
        x86/xen: Fix kerneldoc warning
        xen: delay xen_hvm_init_time_ops() if kdump is boot on vcpu>=32
        xen: use time_is_before_eq_jiffies() instead of open coding it
      a701f370
    • Brian Cain's avatar
      MAINTAINERS: update hexagon maintainer email, tree · b0cf9b4b
      Brian Cain authored
      
      
      Some email infrastructure changes required this switch.
      
      Signed-off-by: default avatarBrian Cain <bcain@quicinc.com>
      b0cf9b4b
    • Damien Le Moal's avatar
      net: bnxt_ptp: fix compilation error · dcf50006
      Damien Le Moal authored
      The Broadcom bnxt_ptp driver does not compile with GCC 11.2.2 when
      CONFIG_WERROR is enabled. The following error is generated:
      
      drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c: In function ‘bnxt_ptp_enable’:
      drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c:400:43: error: array
      subscript 255 is above array bounds of ‘struct pps_pin[4]’
      [-Werror=array-bounds]
        400 |  ptp->pps_info.pins[pin_id].event = BNXT_PPS_EVENT_EXTERNAL;
            |  ~~~~~~~~~~~~~~~~~~^~~~~~~~
      In file included from drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c:20:
      drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h:75:24: note: while
      referencing ‘pins’
         75 |         struct pps_pin pins[BNXT_MAX_TSIO_PINS];
            |                        ^~~~
      cc1: all warnings being treated as errors
      
      This is due to the function ptp_find_pin() returning a pin ID of -1 when
      a valid pin is not found and this error never being checked.
      Change the TSIO_PIN_VALID() function to also check that a pin ID is not
      negative and use this macro in bnxt_ptp_enable() to check the result of
      the calls to ptp_find_pin() to return an error early for invalid pins.
      This fixes the compilation error.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 9e518f25
      
       ("bnxt_en: 1PPS functions to configure TSIO pins")
      Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
      Reviewed-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Link: https://lore.kernel.org/r/20220328062708.207079-1-damien.lemoal@opensource.wdc.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      dcf50006
    • Linus Torvalds's avatar
      Merge tag 'tty-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 72030621
      Linus Torvalds authored
      Pull tty/serial driver updates from Greg KH:
       "Here are the big set of tty and serial driver changes for 5.18-rc1.
      
        Nothing major, some more good cleanups from Jiri and 2 new serial
        drivers. Highlights include:
      
         - termbits cleanups
      
         - export symbol cleanups and other core cleanups from Jiri Slaby
      
         - new sunplus and mvebu uart drivers (amazing that people are still
           creating new uarts...)
      
         - samsung serial driver cleanups
      
         - ldisc 29 is now "reserved" for experimental/development line
           disciplines
      
         - lots of other tiny fixes and cleanups to serial drivers and
           bindings
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'tty-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (104 commits)
        vt_ioctl: fix potential spectre v1 in VT_DISALLOCATE
        serial: 8250: fix XOFF/XON sending when DMA is used
        tty: serial: samsung: Add ARTPEC-8 support
        dt-bindings: serial: samsung: Add ARTPEC-8 UART
        serial: sc16is7xx: Clear RS485 bits in the shutdown
        tty: serial: samsung: simplify getting OF match data
        tty: serial: samsung: constify variables and pointers
        tty: serial: samsung: constify s3c24xx_serial_drv_data members
        tty: serial: samsung: constify UART name
        tty: serial: samsung: constify s3c24xx_serial_drv_data
        tty: serial: samsung: reduce number of casts
        tty: serial: samsung: embed s3c2410_uartcfg in parent structure
        tty: serial: samsung: embed s3c24xx_uart_info in parent structure
        serial: 8250_tegra: mark acpi_device_id as unused with !ACPI
        tty: serial: bcm63xx: use more precise Kconfig symbol
        serial: SERIAL_SUNPLUS should depend on ARCH_SUNPLUS
        tty: serial: jsm: fix two assignments in if conditions
        tty: serial: jsm: remove redundant assignments to variable linestatus
        serial: 8250_mtk: make two read-only arrays static const
        serial: samsung_tty: do not unlock port->lock for uart_write_wakeup()
        ...
      72030621
    • Linus Torvalds's avatar
      Merge tag 'staging-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · dfdc1de6
      Linus Torvalds authored
      Pull staging driver updates from Greg KH:
       "Here is the big set of staging driver updates for 5.18-rc1.
      
        Loads of tiny cleanups for almost all staging drivers in here, nothing
        major at all. Highlights include:
      
         - remove the ashmem Android driver. It is long-dead and if there are
           any legacy userspace applications still using it, the Android
           kernel images will maintain it, the community shouldn't care about
           it anymore
      
         - wfx wifi driver major cleanups. Should be ready to merge out of
           staging soon, and will coordinate with the wifi maintainers after
           -rc1 is out
      
         - major cleanups and unwinding of the layers of the r8188eu driver.
           It's amazing just how many unneeded layers of abstraction is in
           there, just when we think it's done, another is found...
      
         - lots of tiny coding style cleanups in many other staging drivers.
      
        All have been in linux-next for a while with no reported problems"
      
      * tag 'staging-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (455 commits)
        staging: r8188eu: remove unnecessary memset in r8188eu
        staging: greybus: introduce pwm_ops::apply
        staging: rts5208: Resolve checkpatch.pl issues.
        staging: sm750fb: fix naming style
        staging: fbtft: Consider type of init sequence values in fbtft_init_display()
        staging: fbtft: Constify buf parameter in fbtft_dbg_hex()
        staging: mmal-vchiq: clear redundant item named bulk_scratch
        mips: dts: ralink: add MT7621 SoC
        staging: r8188eu: remove some unused local ieee80211 macros
        staging: r8188eu: make rtl8188e_process_phy_info static
        staging: r8188eu: remove unused function prototype
        staging: r8188eu: remove three unused receive defines
        staging: r8188eu: remove unnecessary initializations
        staging: rtl8192e: Fix spelling mistake "RESQUEST" -> "REQUEST"
        MAINTAINERS: remove the obsolete file entry for staging in ANDROID DRIVERS
        staging: r8188eu: proper error handling in rtw_init_drv_sw
        staging: r8188eu: call _cancel_timer_ex from _rtw_free_recv_priv
        staging: vt6656: Removed unused variable vt3342_vnt_threshold
        staging: vt6656: Removed unused variable bb_vga_0
        staging: remove ashmem
        ...
      dfdc1de6
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.18-rc1' of... · 266d17a8
      Linus Torvalds authored
      Merge tag 'driver-core-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core updates from Greg KH:
       "Here is the set of driver core changes for 5.18-rc1.
      
        Not much here, primarily it was a bunch of cleanups and small updates:
      
         - kobj_type cleanups for default_groups
      
         - documentation updates
      
         - firmware loader minor changes
      
         - component common helper added and take advantage of it in many
           drivers (the largest part of this pull request).
      
        All of these have been in linux-next for a while with no reported
        problems"
      
      * tag 'driver-core-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (54 commits)
        Documentation: update stable review cycle documentation
        drivers/base/dd.c : Remove the initial value of the global variable
        Documentation: update stable tree link
        Documentation: add link to stable release candidate tree
        devres: fix typos in comments
        Documentation: add note block surrounding security patch note
        samples/kobject: Use sysfs_emit instead of sprintf
        base: soc: Make soc_device_match() simpler and easier to read
        driver core: dd: fix return value of __setup handler
        driver core: Refactor sysfs and drv/bus remove hooks
        driver core: Refactor multiple copies of device cleanup
        scripts: get_abi.pl: Fix typo in help message
        kernfs: fix typos in comments
        kernfs: remove unneeded #if 0 guard
        ALSA: hda/realtek: Make use of the helper component_compare_dev_name
        video: omapfb: dss: Make use of the helper component_compare_dev
        power: supply: ab8500: Make use of the helper component_compare_dev
        ASoC: codecs: wcd938x: Make use of the helper component_compare/release_of
        iommu/mediatek: Make use of the helper component_compare/release_of
        drm: of: Make use of the helper component_release_of
        ...
      266d17a8
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 02e2af20
      Linus Torvalds authored
      Pull char/misc and other driver updates from Greg KH:
       "Here is the big set of char/misc and other small driver subsystem
        updates for 5.18-rc1.
      
        Included in here are merges from driver subsystems which contain:
      
         - iio driver updates and new drivers
      
         - fsi driver updates
      
         - fpga driver updates
      
         - habanalabs driver updates and support for new hardware
      
         - soundwire driver updates and new drivers
      
         - phy driver updates and new drivers
      
         - coresight driver updates
      
         - icc driver updates
      
        Individual changes include:
      
         - mei driver updates
      
         - interconnect driver updates
      
         - new PECI driver subsystem added
      
         - vmci driver updates
      
         - lots of tiny misc/char driver updates
      
        All of these have been in linux-next for a while with no reported
        problems"
      
      * tag 'char-misc-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (556 commits)
        firmware: google: Properly state IOMEM dependency
        kgdbts: fix return value of __setup handler
        firmware: sysfb: fix platform-device leak in error path
        firmware: stratix10-svc: add missing callback parameter on RSU
        arm64: dts: qcom: add non-secure domain property to fastrpc nodes
        misc: fastrpc: Add dma handle implementation
        misc: fastrpc: Add fdlist implementation
        misc: fastrpc: Add helper function to get list and page
        misc: fastrpc: Add support to secure memory map
        dt-bindings: misc: add fastrpc domain vmid property
        misc: fastrpc: check before loading process to the DSP
        misc: fastrpc: add secure domain support
        dt-bindings: misc: add property to support non-secure DSP
        misc: fastrpc: Add support to get DSP capabilities
        misc: fastrpc: add support for FASTRPC_IOCTL_MEM_MAP/UNMAP
        misc: fastrpc: separate fastrpc device from channel context
        dt-bindings: nvmem: brcm,nvram: add basic NVMEM cells
        dt-bindings: nvmem: make "reg" property optional
        nvmem: brcm_nvram: parse NVRAM content into NVMEM cells
        nvmem: dt-bindings: Fix the error of dt-bindings check
        ...
      02e2af20
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · ff61bc81
      Linus Torvalds authored
      Pull pin control updates from Linus Walleij:
       "No core changes this time. Just new driver code and improvements!
      
        New drivers:
      
         - New driver for the Broadcom BCM4908 SoC.
      
         - New subdriver for Tesla FSD (Full Self Driving) SoC, a derivative
           of the Samsung Exynos pin control driver.
      
         - New driver for the Amlogic Meson S4 SoC.
      
         - New driver for the Sunplus SP7021 SoC.
      
         - New driver for the Microsemi Ocelot family ServalT SoC.
      
         - New subdriver for Intel Alder Lake-M SoC.
      
         - New subdriver for Intel Ice Lake-N SoC, including PCH support.
      
         - New subdriver for Renesas R8A779F0 SoC.
      
         - New subdriver for Mediatek MT8186 SoC.
      
         - New subdriver for NXP Freescale i.MX93 SoC.
      
         - New driver for Nuvoton WPCM450 SoC.
      
         - New driver for Qualcomm SC8280XP SoC.
      
        Improvements:
      
         - Wakeup support on Samsung Exynos850 and ExynosAutov9.
      
         - Serious and voluminous maintenance cleanup and refactoring in the
           Renesas drivers. Mainly sharing similar data between the different
           SoC subdrivers.
      
         - Qualcomm SM8450 EGPIO support.
      
         - Drive strength support on the Mediatek MT8195.
      
         - Add some missing groups and functions to the Ralink RT2880"
      
      * tag 'pinctrl-v5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (188 commits)
        pinctrl: mediatek: common-v1: fix semicolon.cocci warnings
        pinctrl: nuvoton: wpcm450: Fix build error without OF
        pinctrl: qcom-pmic-gpio: Add support for pm8450
        dt-bindings: pinctrl: aspeed: Update gfx node in example
        dt-bindings: pinctrl: rt2880: add missing pin groups and functions
        pinctrl: ingenic: Fix regmap on X series SoCs
        pinctrl: nuvoton: Fix return value check in wpcm450_gpio_register()
        pinctrl: nuvoton: wpcm450: off by one in wpcm450_gpio_register()
        pinctrl: nuvoton: wpcm450: select GENERIC_PINCTRL_GROUPS
        pinctrl: nuvoton: Fix sparse warning
        pinctrl: mediatek: mt8186: Account for probe refactoring
        pinctrl: mediatek: common-v1: Commonize spec_ies_smt_set callback
        pinctrl: mediatek: common-v1: Commonize spec_pupd callback
        pinctrl: mediatek: common-v1: Use common probe function
        pinctrl: mediatek: common-v1: Add common probe function
        pinctrl: mediatek: paris: Unify probe function by using OF match data
        pinctrl/rockchip: Add missing of_node_put() in rockchip_pinctrl_probe
        pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe
        pinctrl: berlin: fix error return code of berlin_pinctrl_build_state()
        pinctrl: qcom: Introduce sc8280xp TLMM driver
        ...
      ff61bc81
    • Linus Torvalds's avatar
      Reinstate some of "swiotlb: rework "fix info leak with DMA_FROM_DEVICE"" · 901c7280
      Linus Torvalds authored
      Halil Pasic points out [1] that the full revert of that commit (revert
      in bddac7c1), and that a partial revert that only reverts the
      problematic case, but still keeps some of the cleanups is probably
      better.  
      
      And that partial revert [2] had already been verified by Oleksandr
      Natalenko to also fix the issue, I had just missed that in the long
      discussion.
      
      So let's reinstate the cleanups from commit aa6f8dcb
      
       ("swiotlb:
      rework "fix info leak with DMA_FROM_DEVICE""), and effectively only
      revert the part that caused problems.
      
      Link: https://lore.kernel.org/all/20220328013731.017ae3e3.pasic@linux.ibm.com/ [1]
      Link: https://lore.kernel.org/all/20220324055732.GB12078@lst.de/ [2]
      Link: https://lore.kernel.org/all/4386660.LvFx2qVVIh@natalenko.name/ [3]
      Suggested-by: default avatarHalil Pasic <pasic@linux.ibm.com>
      Tested-by: default avatarOleksandr Natalenko <oleksandr@natalenko.name>
      Cc: Christoph Hellwig" <hch@lst.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      901c7280
    • Naresh Kamboju's avatar
      selftests: net: Add tls config dependency for tls selftests · d9142e1c
      Naresh Kamboju authored
      
      
      selftest net tls test cases need TLS=m without this the test hangs.
      Enabling config TLS solves this problem and runs to complete.
        - CONFIG_TLS=m
      
      Reported-by: default avatarLinux Kernel Functional Testing <lkft@linaro.org>
      Signed-off-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d9142e1c
  2. Mar 28, 2022