Skip to content
  1. Jan 22, 2022
    • Kees Cook's avatar
      mptcp: Use struct_group() to avoid cross-field memset() · 63ec72bd
      Kees Cook authored
      
      
      In preparation for FORTIFY_SOURCE performing compile-time and run-time
      field bounds checking for memcpy(), memmove(), and memset(), avoid
      intentionally writing across neighboring fields.
      
      Use struct_group() to capture the fields to be reset, so that memset()
      can be appropriately bounds-checked by the compiler.
      
      Cc: Matthieu Baerts <matthieu.baerts@tessares.net>
      Cc: mptcp@lists.linux.dev
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Link: https://lore.kernel.org/r/20220121073935.1154263-1-keescook@chromium.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      63ec72bd
    • David Howells's avatar
      rxrpc: Adjust retransmission backoff · 2c13c05c
      David Howells authored
      Improve retransmission backoff by only backing off when we retransmit data
      packets rather than when we set the lost ack timer.
      
      To this end:
      
       (1) In rxrpc_resend(), use rxrpc_get_rto_backoff() when setting the
           retransmission timer and only tell it that we are retransmitting if we
           actually have things to retransmit.
      
           Note that it's possible for the retransmission algorithm to race with
           the processing of a received ACK, so we may see no packets needing
           retransmission.
      
       (2) In rxrpc_send_data_packet(), don't bump the backoff when setting the
           ack_lost_at timer, as it may then get bumped twice.
      
      With this, when looking at one particular packet, the retransmission
      intervals were seen to be 1.5ms, 2ms, 3ms, 5ms, 9ms, 17ms, 33ms, 71ms,
      136ms, 264ms, 544ms, 1.088s, 2.1s, 4.2s and 8.3s.
      
      Fixes: c410bf01
      
       ("rxrpc: Fix the excessive initial retransmission timeout")
      Suggested-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Tested-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      Link: https://lore.kernel.org/r/164138117069.2023386.17446904856843997127.stgit@warthog.procyon.org.uk/
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2c13c05c
  2. Jan 21, 2022
  3. Jan 20, 2022
    • David S. Miller's avatar
      Merge branch 'stmmac-fixes' · 57afdc0a
      David S. Miller authored
      
      
      Yuji Ishikawa says:
      
      ====================
      net: stmmac: dwmac-visconti: Fix bit definitions and clock configuration for RMII mode
      
      This series is a fix for RMII/MII operation mode of the dwmac-visconti driver.
      It is composed of two parts:
      
      * 1/2: fix constant definitions for cleared bits in ETHER_CLK_SEL register
      * 2/2: fix configuration of ETHER_CLK_SEL register for running in RMII operation mode.
      
        net: stmmac: dwmac-visconti: Fix bit definitions for ETHER_CLK_SEL
          v1 -> v2:
            - added Fixes tag to commit message
      
        net: stmmac: dwmac-visconti: Fix clock configuration for RMII mode
          v1 -> v2:
            - added Fixes tag to commit message
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      57afdc0a
    • Yuji Ishikawa's avatar
      net: stmmac: dwmac-visconti: Fix clock configuration for RMII mode · 0959bc4b
      Yuji Ishikawa authored
      Bit pattern of the ETHER_CLOCK_SEL register for RMII/MII mode should be fixed.
      Also, some control bits should be modified with a specific sequence.
      
      Fixes: b38dd98f
      
       ("net: stmmac: Add Toshiba Visconti SoCs glue driver")
      Signed-off-by: default avatarYuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
      Reviewed-by: default avatarNobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0959bc4b
    • Yuji Ishikawa's avatar
      net: stmmac: dwmac-visconti: Fix bit definitions for ETHER_CLK_SEL · 1ba1a4a9
      Yuji Ishikawa authored
      just 0 should be used to represent cleared bits
      
      * ETHER_CLK_SEL_DIV_SEL_20
      * ETHER_CLK_SEL_TX_CLK_EXT_SEL_IN
      * ETHER_CLK_SEL_RX_CLK_EXT_SEL_IN
      * ETHER_CLK_SEL_TX_CLK_O_TX_I
      * ETHER_CLK_SEL_RMII_CLK_SEL_IN
      
      Fixes: b38dd98f
      
       ("net: stmmac: Add Toshiba Visconti SoCs glue driver")
      Signed-off-by: default avatarYuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
      Reviewed-by: default avatarNobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ba1a4a9
    • Ido Schimmel's avatar
      ipv6_tunnel: Rate limit warning messages · 6cee105e
      Ido Schimmel authored
      The warning messages can be invoked from the data path for every packet
      transmitted through an ip6gre netdev, leading to high CPU utilization.
      
      Fix that by rate limiting the messages.
      
      Fixes: 09c6bbf0
      
       ("[IPV6]: Do mandatory IPv6 tunnel endpoint checks in realtime")
      Reported-by: default avatarMaksym Yaremchuk <maksymy@nvidia.com>
      Tested-by: default avatarMaksym Yaremchuk <maksymy@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6cee105e
    • Moshe Tal's avatar
      ethtool: Fix link extended state for big endian · e2f08207
      Moshe Tal authored
      The link extended sub-states are assigned as enum that is an integer
      size but read from a union as u8, this is working for small values on
      little endian systems but for big endian this always give 0. Fix the
      variable in the union to match the enum size.
      
      Fixes: ecc31c60
      
       ("ethtool: Add link extended state")
      Signed-off-by: default avatarMoshe Tal <moshet@nvidia.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Tested-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarGal Pressman <gal@nvidia.com>
      Reviewed-by: default avatarAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e2f08207
    • Robert Hancock's avatar
      net: phy: broadcom: hook up soft_reset for BCM54616S · d15c7e87
      Robert Hancock authored
      A problem was encountered with the Bel-Fuse 1GBT-SFP05 SFP module (which
      is a 1 Gbps copper module operating in SGMII mode with an internal
      BCM54616S PHY device) using the Xilinx AXI Ethernet MAC core, where the
      module would work properly on the initial insertion or boot of the
      device, but after the device was rebooted, the link would either only
      come up at 100 Mbps speeds or go up and down erratically.
      
      I found no meaningful changes in the PHY configuration registers between
      the working and non-working boots, but the status registers seemed to
      have a lot of error indications set on the SERDES side of the device on
      the non-working boot. I suspect the problem is that whatever happens on
      the SGMII link when the device is rebooted and the FPGA logic gets
      reloaded ends up putting the module's onboard PHY into a bad state.
      
      Since commit 6e2d85ec ("net: phy: Stop with excessive soft reset")
      the genphy_soft_reset call is not made automatically by the PHY core
      unless the callback is explicitly specified in the driver structure. For
      most of these Broadcom devices, there is probably a hardware reset that
      gets asserted to reset the PHY during boot, however for SFP modules
      (where the BCM54616S is commonly found) no such reset line exists, so if
      the board keeps the SFP cage powered up across a reboot, it will end up
      with no reset occurring during reboots.
      
      Hook up the genphy_soft_reset callback for BCM54616S to ensure that a
      PHY reset is performed before the device is initialized. This appears to
      fix the issue with erratic operation after a reboot with this SFP
      module.
      
      Fixes: 6e2d85ec
      
       ("net: phy: Stop with excessive soft reset")
      Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d15c7e87
    • Victor Nogueira's avatar
      net: sched: Clarify error message when qdisc kind is unknown · 973bf8fd
      Victor Nogueira authored
      
      
      When adding a tc rule with a qdisc kind that is not supported or not
      compiled into the kernel, the kernel emits the following error: "Error:
      Specified qdisc not found.". Found via tdc testing when ETS qdisc was not
      compiled in and it was not obvious right away what the message meant
      without looking at the kernel code.
      
      Change the error message to be more explicit and say the qdisc kind is
      unknown.
      
      Signed-off-by: default avatarVictor Nogueira <victor@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      973bf8fd
    • Congyu Liu's avatar
      net: fix information leakage in /proc/net/ptype · 47934e06
      Congyu Liu authored
      In one net namespace, after creating a packet socket without binding
      it to a device, users in other net namespaces can observe the new
      `packet_type` added by this packet socket by reading `/proc/net/ptype`
      file. This is minor information leakage as packet socket is
      namespace aware.
      
      Add a net pointer in `packet_type` to keep the net namespace of
      of corresponding packet socket. In `ptype_seq_show`, this net pointer
      must be checked when it is not NULL.
      
      Fixes: 2feb27db
      
       ("[NETNS]: Minor information leak via /proc/net/ptype file.")
      Signed-off-by: default avatarCongyu Liu <liu3101@purdue.edu>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      47934e06
    • Linus Torvalds's avatar
      Merge tag 'net-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · fa2e1ba3
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from netfilter, bpf.
      
        Quite a handful of old regression fixes but most of those are
        pre-5.16.
      
        Current release - regressions:
      
         - fix memory leaks in the skb free deferral scheme if upper layer
           protocols are used, i.e. in-kernel TCP readers like TLS
      
        Current release - new code bugs:
      
         - nf_tables: fix NULL check typo in _clone() functions
      
         - change the default to y for Vertexcom vendor Kconfig
      
         - a couple of fixes to incorrect uses of ref tracking
      
         - two fixes for constifying netdev->dev_addr
      
        Previous releases - regressions:
      
         - bpf:
            - various verifier fixes mainly around register offset handling
              when passed to helper functions
            - fix mount source displayed for bpffs (none -> bpffs)
      
         - bonding:
            - fix extraction of ports for connection hash calculation
            - fix bond_xmit_broadcast return value when some devices are down
      
         - phy: marvell: add Marvell specific PHY loopback
      
         - sch_api: don't skip qdisc attach on ingress, prevent ref leak
      
         - htb: restore minimal packet size handling in rate control
      
         - sfp: fix high power modules without diagnostic monitoring
      
         - mscc: ocelot:
            - don't let phylink re-enable TX PAUSE on the NPI port
            - don't dereference NULL pointers with shared tc filters
      
         - smsc95xx: correct reset handling for LAN9514
      
         - cpsw: avoid alignment faults by taking NET_IP_ALIGN into account
      
         - phy: micrel: use kszphy_suspend/_resume for irq aware devices,
           avoid races with the interrupt
      
        Previous releases - always broken:
      
         - xdp: check prog type before updating BPF link
      
         - smc: resolve various races around abnormal connection termination
      
         - sit: allow encapsulated IPv6 traffic to be delivered locally
      
         - axienet: fix init/reset handling, add missing barriers, read the
           right status words, stop queues correctly
      
         - add missing dev_put() in sock_timestamping_bind_phc()
      
        Misc:
      
         - ipv4: prevent accidentally passing RTO_ONLINK to
           ip_route_output_key_hash() by sanitizing flags
      
         - ipv4: avoid quadratic behavior in netns dismantle
      
         - stmmac: dwmac-oxnas: add support for OX810SE
      
         - fsl: xgmac_mdio: add workaround for erratum A-009885"
      
      * tag 'net-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (92 commits)
        ipv4: add net_hash_mix() dispersion to fib_info_laddrhash keys
        ipv4: avoid quadratic behavior in netns dismantle
        net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module
        powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses
        dt-bindings: net: Document fsl,erratum-a009885
        net/fsl: xgmac_mdio: Add workaround for erratum A-009885
        net: mscc: ocelot: fix using match before it is set
        net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices
        net: cpsw: avoid alignment faults by taking NET_IP_ALIGN into account
        nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind()
        net: axienet: increase default TX ring size to 128
        net: axienet: fix for TX busy handling
        net: axienet: fix number of TX ring slots for available check
        net: axienet: Fix TX ring slot available check
        net: axienet: limit minimum TX ring size
        net: axienet: add missing memory barriers
        net: axienet: reset core on initialization prior to MDIO access
        net: axienet: Wait for PhyRstCmplt after core reset
        net: axienet: increase reset timeout
        bpf, selftests: Add ringbuf memory type confusion test
        ...
      fa2e1ba3
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · f4484d13
      Linus Torvalds authored
      Merge more updates from Andrew Morton:
       "55 patches.
      
        Subsystems affected by this patch series: percpu, procfs, sysctl,
        misc, core-kernel, get_maintainer, lib, checkpatch, binfmt, nilfs2,
        hfs, fat, adfs, panic, delayacct, kconfig, kcov, and ubsan"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (55 commits)
        lib: remove redundant assignment to variable ret
        ubsan: remove CONFIG_UBSAN_OBJECT_SIZE
        kcov: fix generic Kconfig dependencies if ARCH_WANTS_NO_INSTR
        lib/Kconfig.debug: make TEST_KMOD depend on PAGE_SIZE_LESS_THAN_256KB
        btrfs: use generic Kconfig option for 256kB page size limit
        arch/Kconfig: split PAGE_SIZE_LESS_THAN_256KB from PAGE_SIZE_LESS_THAN_64KB
        configs: introduce debug.config for CI-like setup
        delayacct: track delays from memory compact
        Documentation/accounting/delay-accounting.rst: add thrashing page cache and direct compact
        delayacct: cleanup flags in struct task_delay_info and functions use it
        delayacct: fix incomplete disable operation when switch enable to disable
        delayacct: support swapin delay accounting for swapping without blkio
        panic: remove oops_id
        panic: use error_report_end tracepoint on warnings
        fs/adfs: remove unneeded variable make code cleaner
        FAT: use io_schedule_timeout() instead of congestion_wait()
        hfsplus: use struct_group_attr() for memcpy() region
        nilfs2: remove redundant pointer sbufs
        fs/binfmt_elf: use PT_LOAD p_align values for static PIE
        const_structs.checkpatch: add frequently used ops structs
        ...
      f4484d13
    • Colin Ian King's avatar
      lib: remove redundant assignment to variable ret · b1e78ef3
      Colin Ian King authored
      
      
      The variable ret is being assigned a value that is never read.  If the
      for-loop is entered then ret is immediately re-assigned a new value.  If
      the for-loop is not executed ret is never read.  The assignment is
      redundant and can be removed.
      
      Link: https://lkml.kernel.org/r/20211230134557.83633-1-colin.i.king@gmail.com
      Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
      Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b1e78ef3
    • Kees Cook's avatar
      ubsan: remove CONFIG_UBSAN_OBJECT_SIZE · 69d0db01
      Kees Cook authored
      
      
      The object-size sanitizer is redundant to -Warray-bounds, and
      inappropriately performs its checks at run-time when all information
      needed for the evaluation is available at compile-time, making it quite
      difficult to use:
      
        https://bugzilla.kernel.org/show_bug.cgi?id=214861
      
      With -Warray-bounds almost enabled globally, it doesn't make sense to
      keep this around.
      
      Link: https://lkml.kernel.org/r/20211203235346.110809-1-keescook@chromium.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarMarco Elver <elver@google.com>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Michal Marek <michal.lkml@markovi.net>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      69d0db01