Skip to content

Commit

Permalink
Merge tag 'net-6.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/netdev/net

Pull networking fixes from Jakub Kicinski:
 "Including fixes from bluetooth and netfilter.

  Current release - regressions:

   - dsa: sja1105: fix reception from VLAN-unaware bridges

   - Revert "net: stmmac: set PP_FLAG_DMA_SYNC_DEV only if XDP is
     enabled"

   - eth: fec: don't save PTP state if PTP is unsupported

  Current release - new code bugs:

   - smc: fix lack of icsk_syn_mss with IPPROTO_SMC, prevent null-deref

   - eth: airoha: update Tx CPU DMA ring idx at the end of xmit loop

   - phy: aquantia: AQR115c fix up PMA capabilities

  Previous releases - regressions:

   - tcp: 3 fixes for retrans_stamp and undo logic

  Previous releases - always broken:

   - net: do not delay dst_entries_add() in dst_release()

   - netfilter: restrict xtables extensions to families that are safe,
     syzbot found a way to combine ebtables with extensions that are
     never used by userspace tools

   - sctp: ensure sk_state is set to CLOSED if hashing fails in
     sctp_listen_start

   - mptcp: handle consistently DSS corruption, and prevent corruption
     due to large pmtu xmit"

* tag 'net-6.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (87 commits)
  MAINTAINERS: Add headers and mailing list to UDP section
  MAINTAINERS: consistently exclude wireless files from NETWORKING [GENERAL]
  slip: make slhc_remember() more robust against malicious packets
  net/smc: fix lacks of icsk_syn_mss with IPPROTO_SMC
  ppp: fix ppp_async_encode() illegal access
  docs: netdev: document guidance on cleanup patches
  phonet: Handle error of rtnl_register_module().
  mpls: Handle error of rtnl_register_module().
  mctp: Handle error of rtnl_register_module().
  bridge: Handle error of rtnl_register_module().
  vxlan: Handle error of rtnl_register_module().
  rtnetlink: Add bulk registration helpers for rtnetlink message handlers.
  net: do not delay dst_entries_add() in dst_release()
  mptcp: pm: do not remove closing subflows
  mptcp: fallback when MPTCP opts are dropped after 1st data
  tcp: fix mptcp DSS corruption due to large pmtu xmit
  mptcp: handle consistently DSS corruption
  net: netconsole: fix wrong warning
  net: dsa: refuse cross-chip mirroring operations
  net: fec: don't save PTP state if PTP is unsupported
  ...
  • Loading branch information
torvalds committed Oct 10, 2024
2 parents 0edab8d + 7b43ba6 commit 1d227fc
Show file tree
Hide file tree
Showing 115 changed files with 1,339 additions and 488 deletions.
20 changes: 10 additions & 10 deletions Documentation/networking/tcp_ao.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ segments between trusted peers. It adds a new TCP header option with
a Message Authentication Code (MAC). MACs are produced from the content
of a TCP segment using a hashing function with a password known to both peers.
The intent of TCP-AO is to deprecate TCP-MD5 providing better security,
key rotation and support for variety of hashing algorithms.
key rotation and support for a variety of hashing algorithms.

1. Introduction
===============
Expand Down Expand Up @@ -164,9 +164,9 @@ A: It should not, no action needs to be performed [7.5.2.e]::
is not available, no action is required (RNextKeyID of a received
segment needs to match the MKT’s SendID).

Q: How current_key is set and when does it change? It is a user-triggered
change, or is it by a request from the remote peer? Is it set by the user
explicitly, or by a matching rule?
Q: How is current_key set, and when does it change? Is it a user-triggered
change, or is it triggered by a request from the remote peer? Is it set by the
user explicitly, or by a matching rule?

A: current_key is set by RNextKeyID [6.1]::

Expand Down Expand Up @@ -233,8 +233,8 @@ always have one current_key [3.3]::

Q: Can a non-TCP-AO connection become a TCP-AO-enabled one?

A: No: for already established non-TCP-AO connection it would be impossible
to switch using TCP-AO as the traffic key generation requires the initial
A: No: for an already established non-TCP-AO connection it would be impossible
to switch to using TCP-AO, as the traffic key generation requires the initial
sequence numbers. Paraphrasing, starting using TCP-AO would require
re-establishing the TCP connection.

Expand Down Expand Up @@ -292,7 +292,7 @@ no transparency is really needed and modern BGP daemons already have

Linux provides a set of ``setsockopt()s`` and ``getsockopt()s`` that let
userspace manage TCP-AO on a per-socket basis. In order to add/delete MKTs
``TCP_AO_ADD_KEY`` and ``TCP_AO_DEL_KEY`` TCP socket options must be used
``TCP_AO_ADD_KEY`` and ``TCP_AO_DEL_KEY`` TCP socket options must be used.
It is not allowed to add a key on an established non-TCP-AO connection
as well as to remove the last key from TCP-AO connection.

Expand Down Expand Up @@ -361,7 +361,7 @@ not implemented.
4. ``setsockopt()`` vs ``accept()`` race
========================================

In contrast with TCP-MD5 established connection which has just one key,
In contrast with an established TCP-MD5 connection which has just one key,
TCP-AO connections may have many keys, which means that accepted connections
on a listen socket may have any amount of keys as well. As copying all those
keys on a first properly signed SYN would make the request socket bigger, that
Expand All @@ -374,15 +374,15 @@ keys from sockets that were already established, but not yet ``accept()``'ed,
hanging in the accept queue.

The reverse is valid as well: if userspace adds a new key for a peer on
a listener socket, the established sockets in accept queue won't
a listener socket, the established sockets in the accept queue won't
have the new keys.

At this moment, the resolution for the two races:
``setsockopt(TCP_AO_ADD_KEY)`` vs ``accept()``
and ``setsockopt(TCP_AO_DEL_KEY)`` vs ``accept()`` is delegated to userspace.
This means that it's expected that userspace would check the MKTs on the socket
that was returned by ``accept()`` to verify that any key rotation that
happened on listen socket is reflected on the newly established connection.
happened on the listen socket is reflected on the newly established connection.

This is a similar "do-nothing" approach to TCP-MD5 from the kernel side and
may be changed later by introducing new flags to ``tcp_ao_add``
Expand Down
17 changes: 17 additions & 0 deletions Documentation/process/maintainer-netdev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ just do it. As a result, a sequence of smaller series gets merged quicker and
with better review coverage. Re-posting large series also increases the mailing
list traffic.

.. _rcs:

Local variable ordering ("reverse xmas tree", "RCS")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -391,6 +393,21 @@ APIs and helpers, especially scoped iterators. However, direct use of
``__free()`` within networking core and drivers is discouraged.
Similar guidance applies to declaring variables mid-function.

Clean-up patches
~~~~~~~~~~~~~~~~

Netdev discourages patches which perform simple clean-ups, which are not in
the context of other work. For example:

* Addressing ``checkpatch.pl`` warnings
* Addressing :ref:`Local variable ordering<rcs>` issues
* Conversions to device-managed APIs (``devm_`` helpers)

This is because it is felt that the churn that such changes produce comes
at a greater cost than the value of such clean-ups.

Conversely, spelling and grammar fixes are not discouraged.

Resending after review
~~~~~~~~~~~~~~~~~~~~~~

Expand Down
19 changes: 17 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -10270,7 +10270,7 @@ F: Documentation/devicetree/bindings/arm/hisilicon/low-pin-count.yaml
F: drivers/bus/hisi_lpc.c

HISILICON NETWORK SUBSYSTEM 3 DRIVER (HNS3)
M: Yisen Zhuang <yisen.zhuang@huawei.com>
M: Jian Shen <shenjian15@huawei.com>
M: Salil Mehta <[email protected]>
M: Jijie Shao <[email protected]>
L: [email protected]
Expand All @@ -10279,7 +10279,7 @@ W: http://www.hisilicon.com
F: drivers/net/ethernet/hisilicon/hns3/

HISILICON NETWORK SUBSYSTEM DRIVER
M: Yisen Zhuang <yisen.zhuang@huawei.com>
M: Jian Shen <shenjian15@huawei.com>
M: Salil Mehta <[email protected]>
L: [email protected]
S: Maintained
Expand Down Expand Up @@ -16201,8 +16201,19 @@ F: lib/random32.c
F: net/
F: tools/net/
F: tools/testing/selftests/net/
X: Documentation/networking/mac80211-injection.rst
X: Documentation/networking/mac80211_hwsim/
X: Documentation/networking/regulatory.rst
X: include/net/cfg80211.h
X: include/net/ieee80211_radiotap.h
X: include/net/iw_handler.h
X: include/net/mac80211.h
X: include/net/wext.h
X: net/9p/
X: net/bluetooth/
X: net/mac80211/
X: net/rfkill/
X: net/wireless/

NETWORKING [IPSEC]
M: Steffen Klassert <[email protected]>
Expand Down Expand Up @@ -24177,8 +24188,12 @@ F: drivers/usb/host/xhci*

USER DATAGRAM PROTOCOL (UDP)
M: Willem de Bruijn <[email protected]>
L: [email protected]
S: Maintained
F: include/linux/udp.h
F: include/net/udp.h
F: include/trace/events/udp.h
F: include/uapi/linux/udp.h
F: net/ipv4/udp.c
F: net/ipv6/udp.c

Expand Down
20 changes: 18 additions & 2 deletions drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -4038,23 +4038,37 @@ static void btusb_disconnect(struct usb_interface *intf)
static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
{
struct btusb_data *data = usb_get_intfdata(intf);
int err;

BT_DBG("intf %p", intf);

/* Don't suspend if there are connections */
if (hci_conn_count(data->hdev))
/* Don't auto-suspend if there are connections; external suspend calls
* shall never fail.
*/
if (PMSG_IS_AUTO(message) && hci_conn_count(data->hdev))
return -EBUSY;

if (data->suspend_count++)
return 0;

/* Notify Host stack to suspend; this has to be done before stopping
* the traffic since the hci_suspend_dev itself may generate some
* traffic.
*/
err = hci_suspend_dev(data->hdev);
if (err) {
data->suspend_count--;
return err;
}

spin_lock_irq(&data->txlock);
if (!(PMSG_IS_AUTO(message) && data->tx_in_flight)) {
set_bit(BTUSB_SUSPENDING, &data->flags);
spin_unlock_irq(&data->txlock);
} else {
spin_unlock_irq(&data->txlock);
data->suspend_count--;
hci_resume_dev(data->hdev);
return -EBUSY;
}

Expand Down Expand Up @@ -4175,6 +4189,8 @@ static int btusb_resume(struct usb_interface *intf)
spin_unlock_irq(&data->txlock);
schedule_work(&data->work);

hci_resume_dev(data->hdev);

return 0;

failed:
Expand Down
17 changes: 13 additions & 4 deletions drivers/net/dsa/b53/b53_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/phylink.h>
#include <linux/etherdevice.h>
#include <linux/if_bridge.h>
#include <linux/if_vlan.h>
#include <net/dsa.h>

#include "b53_regs.h"
Expand Down Expand Up @@ -224,6 +225,9 @@ static const struct b53_mib_desc b53_mibs_58xx[] = {

#define B53_MIBS_58XX_SIZE ARRAY_SIZE(b53_mibs_58xx)

#define B53_MAX_MTU_25 (1536 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN)
#define B53_MAX_MTU (9720 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN)

static int b53_do_vlan_op(struct b53_device *dev, u8 op)
{
unsigned int i;
Expand Down Expand Up @@ -2254,20 +2258,25 @@ static int b53_change_mtu(struct dsa_switch *ds, int port, int mtu)
bool allow_10_100;

if (is5325(dev) || is5365(dev))
return -EOPNOTSUPP;
return 0;

if (!dsa_is_cpu_port(ds, port))
return 0;

enable_jumbo = (mtu >= JMS_MIN_SIZE);
allow_10_100 = (dev->chip_id == BCM583XX_DEVICE_ID);
enable_jumbo = (mtu > ETH_DATA_LEN);
allow_10_100 = !is63xx(dev);

return b53_set_jumbo(dev, enable_jumbo, allow_10_100);
}

static int b53_get_max_mtu(struct dsa_switch *ds, int port)
{
return JMS_MAX_SIZE;
struct b53_device *dev = ds->priv;

if (is5325(dev) || is5365(dev))
return B53_MAX_MTU_25;

return B53_MAX_MTU;
}

static const struct phylink_mac_ops b53_phylink_mac_ops = {
Expand Down
29 changes: 29 additions & 0 deletions drivers/net/dsa/lan9303-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <linux/module.h>
#include <linux/gpio/consumer.h>
#include <linux/regmap.h>
#include <linux/iopoll.h>
#include <linux/mutex.h>
#include <linux/mii.h>
#include <linux/of.h>
Expand Down Expand Up @@ -839,6 +840,8 @@ static void lan9303_handle_reset(struct lan9303 *chip)
if (!chip->reset_gpio)
return;

gpiod_set_value_cansleep(chip->reset_gpio, 1);

if (chip->reset_duration != 0)
msleep(chip->reset_duration);

Expand All @@ -864,8 +867,34 @@ static int lan9303_disable_processing(struct lan9303 *chip)
static int lan9303_check_device(struct lan9303 *chip)
{
int ret;
int err;
u32 reg;

/* In I2C-managed configurations this polling loop will clash with
* switch's reading of EEPROM right after reset and this behaviour is
* not configurable. While lan9303_read() already has quite long retry
* timeout, seems not all cases are being detected as arbitration error.
*
* According to datasheet, EEPROM loader has 30ms timeout (in case of
* missing EEPROM).
*
* Loading of the largest supported EEPROM is expected to take at least
* 5.9s.
*/
err = read_poll_timeout(lan9303_read, ret,
!ret && reg & LAN9303_HW_CFG_READY,
20000, 6000000, false,
chip->regmap, LAN9303_HW_CFG, &reg);
if (ret) {
dev_err(chip->dev, "failed to read HW_CFG reg: %pe\n",
ERR_PTR(ret));
return ret;
}
if (err) {
dev_err(chip->dev, "HW_CFG not ready: 0x%08x\n", reg);
return err;
}

ret = lan9303_read(chip->regmap, LAN9303_CHIP_REV, &reg);
if (ret) {
dev_err(chip->dev, "failed to read chip revision register: %d\n",
Expand Down
1 change: 0 additions & 1 deletion drivers/net/dsa/sja1105/sja1105_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3158,7 +3158,6 @@ static int sja1105_setup(struct dsa_switch *ds)
* TPID is ETH_P_SJA1105, and the VLAN ID is the port pvid.
*/
ds->vlan_filtering_is_global = true;
ds->untag_bridge_pvid = true;
ds->fdb_isolation = true;
ds->max_num_bridges = DSA_TAG_8021Q_MAX_NUM_BRIDGES;

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/adi/adin1110.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ static int adin1110_read_fifo(struct adin1110_port_priv *port_priv)
* from the ADIN1110 frame header.
*/
if (frame_size < ADIN1110_FRAME_HEADER_LEN + ADIN1110_FEC_LEN)
return ret;
return -EINVAL;

round_len = adin1110_round_len(frame_size);
if (round_len < 0)
return ret;
return -EINVAL;

frame_size_no_fcs = frame_size - ADIN1110_FRAME_HEADER_LEN - ADIN1110_FEC_LEN;
memset(priv->data, 0, ADIN1110_RD_HEADER_LEN);
Expand Down
7 changes: 3 additions & 4 deletions drivers/net/ethernet/amd/mvme147.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ static struct net_device * __init mvme147lance_probe(void)
macaddr[3] = address&0xff;
eth_hw_addr_set(dev, macaddr);

printk("%s: MVME147 at 0x%08lx, irq %d, Hardware Address %pM\n",
dev->name, dev->base_addr, MVME147_LANCE_IRQ,
dev->dev_addr);

lp = netdev_priv(dev);
lp->ram = __get_dma_pages(GFP_ATOMIC, 3); /* 32K */
if (!lp->ram) {
Expand Down Expand Up @@ -138,6 +134,9 @@ static struct net_device * __init mvme147lance_probe(void)
return ERR_PTR(err);
}

netdev_info(dev, "MVME147 at 0x%08lx, irq %d, Hardware Address %pM\n",
dev->base_addr, MVME147_LANCE_IRQ, dev->dev_addr);

return dev;
}

Expand Down
7 changes: 6 additions & 1 deletion drivers/net/ethernet/faraday/ftgmac100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1906,7 +1906,12 @@ static int ftgmac100_probe(struct platform_device *pdev)
goto err_phy_connect;
}

phydev = fixed_phy_register(PHY_POLL, &ncsi_phy_status, NULL);
phydev = fixed_phy_register(PHY_POLL, &ncsi_phy_status, np);
if (IS_ERR(phydev)) {
dev_err(&pdev->dev, "failed to register fixed PHY device\n");
err = PTR_ERR(phydev);
goto err_phy_connect;
}
err = phy_connect_direct(netdev, phydev, ftgmac100_adjust_link,
PHY_INTERFACE_MODE_MII);
if (err) {
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/ethernet/freescale/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,8 @@ fec_restart(struct net_device *ndev)
u32 rcntl = OPT_FRAME_SIZE | 0x04;
u32 ecntl = FEC_ECR_ETHEREN;

fec_ptp_save_state(fep);
if (fep->bufdesc_ex)
fec_ptp_save_state(fep);

/* Whack a reset. We should wait for this.
* For i.MX6SX SOC, enet use AXI bus, we use disable MAC
Expand Down Expand Up @@ -1340,7 +1341,8 @@ fec_stop(struct net_device *ndev)
netdev_err(ndev, "Graceful transmit stop did not complete!\n");
}

fec_ptp_save_state(fep);
if (fep->bufdesc_ex)
fec_ptp_save_state(fep);

/* Whack a reset. We should wait for this.
* For i.MX6SX SOC, enet use AXI bus, we use disable MAC
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/ethernet/ibm/emac/mal.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ static int mal_probe(struct platform_device *ofdev)
printk(KERN_ERR "%pOF: Support for 405EZ not enabled!\n",
ofdev->dev.of_node);
err = -ENODEV;
goto fail;
goto fail_unmap;
#endif
}

Expand Down Expand Up @@ -742,6 +742,8 @@ static void mal_remove(struct platform_device *ofdev)

free_netdev(mal->dummy_dev);

dcr_unmap(mal->dcr_host, 0x100);

dma_free_coherent(&ofdev->dev,
sizeof(struct mal_descriptor) *
(NUM_TX_BUFF * mal->num_tx_chans +
Expand Down
Loading

0 comments on commit 1d227fc

Please sign in to comment.