Skip to content

Commit 6288c1d

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "One more set of fixes from the networking tree: - add missing input validation in nl80211_del_key(), preventing out-of-bounds access - last minute fix / improvement of a MRP netlink (uAPI) interface introduced in 5.9 (current) release - fix "unresolved symbol" build error under CONFIG_NET w/o CONFIG_INET due to missing tcp_timewait_sock and inet_timewait_sock BTF. - fix 32 bit sub-register bounds tracking in the bpf verifier for OR case - tcp: fix receive window update in tcp_add_backlog() - openvswitch: handle DNAT tuple collision in conntrack-related code - r8169: wait for potential PHY reset to finish after applying a FW file, avoiding unexpected PHY behaviour and failures later on - mscc: fix tail dropping watermarks for Ocelot switches - avoid use-after-free in macsec code after a call to the GRO layer - avoid use-after-free in sctp error paths - add a device id for Cellient MPL200 WWAN card - rxrpc fixes: - fix the xdr encoding of the contents read from an rxrpc key - fix a BUG() for a unsupported encoding type. - fix missing _bh lock annotations. - fix acceptance handling for an incoming call where the incoming call is encrypted. - the server token keyring isn't network namespaced - it belongs to the server, so there's no need. Namespacing it means that request_key() fails to find it. - fix a leak of the server keyring" * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (21 commits) net: usb: qmi_wwan: add Cellient MPL200 card macsec: avoid use-after-free in macsec_handle_frame() r8169: consider that PHY reset may still be in progress after applying firmware openvswitch: handle DNAT tuple collision sctp: fix sctp_auth_init_hmacs() error path bridge: Netlink interface fix. net: wireless: nl80211: fix out-of-bounds access in nl80211_del_key() bpf: Fix scalar32_min_max_or bounds tracking tcp: fix receive window update in tcp_add_backlog() net: usb: rtl8150: set random MAC address when set_ethernet_addr() fails mptcp: more DATA FIN fixes net: mscc: ocelot: warn when encoding an out-of-bounds watermark value net: mscc: ocelot: divide watermark value by 60 when writing to SYS_ATOP net: qrtr: ns: Fix the incorrect usage of rcu_read_lock() rxrpc: Fix server keyring leak rxrpc: The server keyring isn't network-namespaced rxrpc: Fix accept on a connection that need securing rxrpc: Fix some missing _bh annotations on locking conn->state_lock rxrpc: Downgrade the BUG() for unsupported token type in rxrpc_read() rxrpc: Fix rxkad token xdr encoding ...
2 parents 3d006ee + 28802e7 commit 6288c1d

File tree

26 files changed

+212
-350
lines changed

26 files changed

+212
-350
lines changed

drivers/net/dsa/ocelot/felix_vsc9959.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,8 @@ static int vsc9959_prevalidate_phy_mode(struct ocelot *ocelot, int port,
11711171
*/
11721172
static u16 vsc9959_wm_enc(u16 value)
11731173
{
1174+
WARN_ON(value >= 16 * BIT(8));
1175+
11741176
if (value >= BIT(8))
11751177
return BIT(8) | (value / 16);
11761178

drivers/net/dsa/ocelot/seville_vsc9953.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,8 @@ static int vsc9953_prevalidate_phy_mode(struct ocelot *ocelot, int port,
911911
*/
912912
static u16 vsc9953_wm_enc(u16 value)
913913
{
914+
WARN_ON(value >= 16 * BIT(9));
915+
914916
if (value >= BIT(9))
915917
return BIT(9) | (value / 16);
916918

drivers/net/ethernet/mscc/ocelot.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ void ocelot_port_set_maxlen(struct ocelot *ocelot, int port, size_t sdu)
12531253
struct ocelot_port *ocelot_port = ocelot->ports[port];
12541254
int maxlen = sdu + ETH_HLEN + ETH_FCS_LEN;
12551255
int pause_start, pause_stop;
1256-
int atop_wm;
1256+
int atop, atop_tot;
12571257

12581258
if (port == ocelot->npi) {
12591259
maxlen += OCELOT_TAG_LEN;
@@ -1274,12 +1274,12 @@ void ocelot_port_set_maxlen(struct ocelot *ocelot, int port, size_t sdu)
12741274
ocelot_fields_write(ocelot, port, SYS_PAUSE_CFG_PAUSE_STOP,
12751275
pause_stop);
12761276

1277-
/* Tail dropping watermark */
1278-
atop_wm = (ocelot->shared_queue_sz - 9 * maxlen) /
1277+
/* Tail dropping watermarks */
1278+
atop_tot = (ocelot->shared_queue_sz - 9 * maxlen) /
12791279
OCELOT_BUFFER_CELL_SZ;
1280-
ocelot_write_rix(ocelot, ocelot->ops->wm_enc(9 * maxlen),
1281-
SYS_ATOP, port);
1282-
ocelot_write(ocelot, ocelot->ops->wm_enc(atop_wm), SYS_ATOP_TOT_CFG);
1280+
atop = (9 * maxlen) / OCELOT_BUFFER_CELL_SZ;
1281+
ocelot_write_rix(ocelot, ocelot->ops->wm_enc(atop), SYS_ATOP, port);
1282+
ocelot_write(ocelot, ocelot->ops->wm_enc(atop_tot), SYS_ATOP_TOT_CFG);
12831283
}
12841284
EXPORT_SYMBOL(ocelot_port_set_maxlen);
12851285

drivers/net/ethernet/mscc/ocelot_vsc7514.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,8 @@ static int ocelot_reset(struct ocelot *ocelot)
745745
*/
746746
static u16 ocelot_wm_enc(u16 value)
747747
{
748+
WARN_ON(value >= 16 * BIT(8));
749+
748750
if (value >= BIT(8))
749751
return BIT(8) | (value / 16);
750752

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,11 +2058,18 @@ static void rtl_release_firmware(struct rtl8169_private *tp)
20582058

20592059
void r8169_apply_firmware(struct rtl8169_private *tp)
20602060
{
2061+
int val;
2062+
20612063
/* TODO: release firmware if rtl_fw_write_firmware signals failure. */
20622064
if (tp->rtl_fw) {
20632065
rtl_fw_write_firmware(tp, tp->rtl_fw);
20642066
/* At least one firmware doesn't reset tp->ocp_base. */
20652067
tp->ocp_base = OCP_STD_PHY_BASE;
2068+
2069+
/* PHY soft reset may still be in progress */
2070+
phy_read_poll_timeout(tp->phydev, MII_BMCR, val,
2071+
!(val & BMCR_RESET),
2072+
50000, 600000, true);
20662073
}
20672074
}
20682075

drivers/net/macsec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,7 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
10771077
struct macsec_rx_sa *rx_sa;
10781078
struct macsec_rxh_data *rxd;
10791079
struct macsec_dev *macsec;
1080+
unsigned int len;
10801081
sci_t sci;
10811082
u32 hdr_pn;
10821083
bool cbit;
@@ -1232,9 +1233,10 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
12321233
macsec_rxsc_put(rx_sc);
12331234

12341235
skb_orphan(skb);
1236+
len = skb->len;
12351237
ret = gro_cells_receive(&macsec->gro_cells, skb);
12361238
if (ret == NET_RX_SUCCESS)
1237-
count_rx(dev, skb->len);
1239+
count_rx(dev, len);
12381240
else
12391241
macsec->secy.netdev->stats.rx_dropped++;
12401242

drivers/net/usb/qmi_wwan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,7 @@ static const struct usb_device_id products[] = {
13751375
{QMI_QUIRK_SET_DTR(0x2cb7, 0x0104, 4)}, /* Fibocom NL678 series */
13761376
{QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */
13771377
{QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/
1378+
{QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
13781379

13791380
/* 4. Gobi 1000 devices */
13801381
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */

drivers/net/usb/rtl8150.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,20 @@ static int write_mii_word(rtl8150_t * dev, u8 phy, __u8 indx, u16 reg)
274274
return 1;
275275
}
276276

277-
static inline void set_ethernet_addr(rtl8150_t * dev)
277+
static void set_ethernet_addr(rtl8150_t *dev)
278278
{
279-
u8 node_id[6];
279+
u8 node_id[ETH_ALEN];
280+
int ret;
281+
282+
ret = get_registers(dev, IDR, sizeof(node_id), node_id);
280283

281-
get_registers(dev, IDR, sizeof(node_id), node_id);
282-
memcpy(dev->netdev->dev_addr, node_id, sizeof(node_id));
284+
if (ret == sizeof(node_id)) {
285+
ether_addr_copy(dev->netdev->dev_addr, node_id);
286+
} else {
287+
eth_hw_addr_random(dev->netdev);
288+
netdev_notice(dev->netdev, "Assigned a random MAC address: %pM\n",
289+
dev->netdev->dev_addr);
290+
}
283291
}
284292

285293
static int rtl8150_set_mac_address(struct net_device *netdev, void *p)

include/uapi/linux/rxrpc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ enum rxrpc_cmsg_type {
5151
RXRPC_BUSY = 6, /* -r: server busy received [terminal] */
5252
RXRPC_LOCAL_ERROR = 7, /* -r: local error generated [terminal] */
5353
RXRPC_NEW_CALL = 8, /* -r: [Service] new incoming call notification */
54-
RXRPC_ACCEPT = 9, /* s-: [Service] accept request */
5554
RXRPC_EXCLUSIVE_CALL = 10, /* s-: Call should be on exclusive connection */
5655
RXRPC_UPGRADE_SERVICE = 11, /* s-: Request service upgrade for client call */
5756
RXRPC_TX_LENGTH = 12, /* s-: Total length of Tx data */
5857
RXRPC_SET_CALL_TIMEOUT = 13, /* s-: Set one or more call timeouts */
58+
RXRPC_CHARGE_ACCEPT = 14, /* s-: Charge the accept pool with a user call ID */
5959
RXRPC__SUPPORTED
6060
};
6161

kernel/bpf/verifier.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5667,8 +5667,8 @@ static void scalar32_min_max_or(struct bpf_reg_state *dst_reg,
56675667
bool src_known = tnum_subreg_is_const(src_reg->var_off);
56685668
bool dst_known = tnum_subreg_is_const(dst_reg->var_off);
56695669
struct tnum var32_off = tnum_subreg(dst_reg->var_off);
5670-
s32 smin_val = src_reg->smin_value;
5671-
u32 umin_val = src_reg->umin_value;
5670+
s32 smin_val = src_reg->s32_min_value;
5671+
u32 umin_val = src_reg->u32_min_value;
56725672

56735673
/* Assuming scalar64_min_max_or will be called so it is safe
56745674
* to skip updating register for known case.
@@ -5691,8 +5691,8 @@ static void scalar32_min_max_or(struct bpf_reg_state *dst_reg,
56915691
/* ORing two positives gives a positive, so safe to
56925692
* cast result into s64.
56935693
*/
5694-
dst_reg->s32_min_value = dst_reg->umin_value;
5695-
dst_reg->s32_max_value = dst_reg->umax_value;
5694+
dst_reg->s32_min_value = dst_reg->u32_min_value;
5695+
dst_reg->s32_max_value = dst_reg->u32_max_value;
56965696
}
56975697
}
56985698

0 commit comments

Comments
 (0)