1. 19 Feb, 2024 1 commit
    • Jiri Pirko's avatar
      tools: ynl: don't access uninitialized attr_space variable · d0bcc15c
      Jiri Pirko authored
      If message contains unknown attribute and user passes
      "--process-unknown" command line option, _decode() gets called with space
      arg set to None. In that case, attr_space variable is not initialized
      used which leads to following trace:
      
      Traceback (most recent call last):
        File "./tools/net/ynl/cli.py", line 77, in <module>
          main()
        File "./tools/net/ynl/cli.py", line 68, in main
          reply = ynl.dump(args.dump, attrs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "tools/net/ynl/lib/ynl.py", line 909, in dump
          return self._op(method, vals, [], dump=True)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "tools/net/ynl/lib/ynl.py", line 894, in _op
          rsp_msg = self._decode(decoded.raw_attrs, op.attr_set.name)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "tools/net/ynl/lib/ynl.py", line 639, in _decode
          self._rsp_add(rsp, attr_name, None, self._decode_unknown(attr))
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "tools/net/ynl/lib/ynl.py", line 569, in _decode_unknown
          return self._decode(NlAttrs(attr.raw), None)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "tools/net/ynl/lib/ynl.py", line 630, in _decode
          search_attrs = SpaceAttrs(attr_space, rsp, outer_attrs)
                                    ^^^^^^^^^^
      UnboundLocalError: cannot access local variable 'attr_space' where it is not associated with a value
      
      Fix this by moving search_attrs assignment under the if statement
      above it to make sure attr_space is initialized.
      
      Fixes: bf8b8323 ("tools/net/ynl: Support sub-messages in nested attribute spaces")
      Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0bcc15c
  2. 18 Feb, 2024 3 commits
  3. 17 Feb, 2024 6 commits
  4. 16 Feb, 2024 27 commits
  5. 15 Feb, 2024 3 commits
    • Linus Torvalds's avatar
      Merge tag 'net-6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 4f5e5092
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from can, wireless and netfilter.
      
        Current release - regressions:
      
         - af_unix: fix task hung while purging oob_skb in GC
      
         - pds_core: do not try to run health-thread in VF path
      
        Current release - new code bugs:
      
         - sched: act_mirred: don't zero blockid when net device is being
           deleted
      
        Previous releases - regressions:
      
         - netfilter:
            - nat: restore default DNAT behavior
            - nf_tables: fix bidirectional offload, broken when unidirectional
              offload support was added
      
         - openvswitch: limit the number of recursions from action sets
      
         - eth: i40e: do not allow untrusted VF to remove administratively set
           MAC address
      
        Previous releases - always broken:
      
         - tls: fix races and bugs in use of async crypto
      
         - mptcp: prevent data races on some of the main socket fields, fix
           races in fastopen handling
      
         - dpll: fix possible deadlock during netlink dump operation
      
         - dsa: lan966x: fix crash when adding interface under a lag when some
           of the ports are disabled
      
         - can: j1939: prevent deadlock by changing j1939_socks_lock to rwlock
      
        Misc:
      
         - a handful of fixes and reliability improvements for selftests
      
         - fix sysfs documentation missing net/ in paths
      
         - finish the work of squashing the missing MODULE_DESCRIPTION()
           warnings in networking"
      
      * tag 'net-6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (92 commits)
        net: fill in MODULE_DESCRIPTION()s for missing arcnet
        net: fill in MODULE_DESCRIPTION()s for mdio_devres
        net: fill in MODULE_DESCRIPTION()s for ppp
        net: fill in MODULE_DESCRIPTION()s for fddik/skfp
        net: fill in MODULE_DESCRIPTION()s for plip
        net: fill in MODULE_DESCRIPTION()s for ieee802154/fakelb
        net: fill in MODULE_DESCRIPTION()s for xen-netback
        net: ravb: Count packets instead of descriptors in GbEth RX path
        pppoe: Fix memory leak in pppoe_sendmsg()
        net: sctp: fix skb leak in sctp_inq_free()
        net: bcmasp: Handle RX buffer allocation failure
        net-timestamp: make sk_tskey more predictable in error path
        selftests: tls: increase the wait in poll_partial_rec_async
        ice: Add check for lport extraction to LAG init
        netfilter: nf_tables: fix bidirectional offload regression
        netfilter: nat: restore default DNAT behavior
        netfilter: nft_set_pipapo: fix missing : in kdoc
        igc: Remove temporary workaround
        igb: Fix string truncation warnings in igb_set_fw_version
        can: netlink: Fix TDCO calculation using the old data bittiming
        ...
      4f5e5092
    • Linus Torvalds's avatar
      Merge tag 'for-linus-6.8a-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · cc9c4f0b
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
       "Fixes and simple cleanups:
      
         - use a proper flexible array instead of a one-element array in order
           to avoid array-bounds sanitizer errors
      
         - add NULL pointer checks after allocating memory
      
         - use memdup_array_user() instead of open-coding it
      
         - fix a rare race condition in Xen event channel allocation code
      
         - make struct bus_type instances const
      
         - make kerneldoc inline comments match reality"
      
      * tag 'for-linus-6.8a-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/events: close evtchn after mapping cleanup
        xen/gntalloc: Replace UAPI 1-element array
        xen: balloon: make balloon_subsys const
        xen: pcpu: make xen_pcpu_subsys const
        xen/privcmd: Use memdup_array_user() in alloc_ioreq()
        x86/xen: Add some null pointer checking to smp.c
        xen/xenbus: document will_handle argument for xenbus_watch_path()
      cc9c4f0b
    • Linus Torvalds's avatar
      update workarounds for gcc "asm goto" issue · 68fb3ca0
      Linus Torvalds authored
      In commit 4356e9f8 ("work around gcc bugs with 'asm goto' with
      outputs") I did the gcc workaround unconditionally, because the cause of
      the bad code generation wasn't entirely clear.
      
      In the meantime, Jakub Jelinek debugged the issue, and has come up with
      a fix in gcc [2], which also got backported to the still maintained
      branches of gcc-11, gcc-12 and gcc-13.
      
      Note that while the fix technically wasn't in the original gcc-14
      branch, Jakub says:
      
       "while it is true that no GCC 14 snapshots until today (or whenever the
        fix will be committed) have the fix, for GCC trunk it is up to the
        distros to use the latest snapshot if they use it at all and would
        allow better testing of the kernel code without the workaround, so
        that if there are other issues they won't be discovered years later.
        Most userland code doesn't actually use asm goto with outputs..."
      
      so we will consider gcc-14 to be fixed - if somebody is using gcc
      snapshots of the gcc-14 before the fix, they should upgrade.
      
      Note that while the bug goes back to gcc-11, in practice other gcc
      changes seem to have effectively hidden it since gcc-12.1 as per a
      bisect by Jakub.  So even a gcc-14 snapshot without the fix likely
      doesn't show actual problems.
      
      Also, make the default 'asm_goto_output()' macro mark the asm as
      volatile by hand, because of an unrelated gcc issue [1] where it doesn't
      match the documented behavior ("asm goto is always volatile").
      
      Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103979 [1]
      Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921 [2]
      Link: https://lore.kernel.org/all/20240208220604.140859-1-seanjc@google.com/Requested-by: default avatarJakub Jelinek <jakub@redhat.com>
      Cc: Uros Bizjak <ubizjak@gmail.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Andrew Pinski <quic_apinski@quicinc.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      68fb3ca0