Skip to content

Commit 1dfe4ba

Browse files
committed
tgupdate: merge t/DO-NOT-MERGE-mptcp-use-kmalloc-on-kasan-build into t/DO-NOT-MERGE-mptcp-enabled-by-default base
2 parents 7e5e005 + 742d88f commit 1dfe4ba

File tree

24 files changed

+108
-68
lines changed

24 files changed

+108
-68
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2877,7 +2877,7 @@ F: drivers/pinctrl/nxp/
28772877

28782878
ARM/NXP S32G/S32R DWMAC ETHERNET DRIVER
28792879
M: Jan Petrous <[email protected]>
2880-
L: NXP S32 Linux Team <[email protected]>
2880+
28812881
S: Maintained
28822882
F: Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml
28832883
F: drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c

drivers/bluetooth/btusb.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,8 @@ static int btusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
21022102
return submit_or_queue_tx_urb(hdev, urb);
21032103

21042104
case HCI_SCODATA_PKT:
2105-
if (hci_conn_num(hdev, SCO_LINK) < 1)
2105+
if (!hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
2106+
hci_conn_num(hdev, SCO_LINK) < 1)
21062107
return -ENODEV;
21072108

21082109
urb = alloc_isoc_urb(hdev, skb);
@@ -2576,7 +2577,8 @@ static int btusb_send_frame_intel(struct hci_dev *hdev, struct sk_buff *skb)
25762577
return submit_or_queue_tx_urb(hdev, urb);
25772578

25782579
case HCI_SCODATA_PKT:
2579-
if (hci_conn_num(hdev, SCO_LINK) < 1)
2580+
if (!hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
2581+
hci_conn_num(hdev, SCO_LINK) < 1)
25802582
return -ENODEV;
25812583

25822584
urb = alloc_isoc_urb(hdev, skb);

drivers/net/ethernet/cadence/macb.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,6 +1277,8 @@ struct macb {
12771277
struct clk *rx_clk;
12781278
struct clk *tsu_clk;
12791279
struct net_device *dev;
1280+
/* Protects hw_stats and ethtool_stats */
1281+
spinlock_t stats_lock;
12801282
union {
12811283
struct macb_stats macb;
12821284
struct gem_stats gem;

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,10 +1989,12 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
19891989

19901990
if (status & MACB_BIT(ISR_ROVR)) {
19911991
/* We missed at least one packet */
1992+
spin_lock(&bp->stats_lock);
19921993
if (macb_is_gem(bp))
19931994
bp->hw_stats.gem.rx_overruns++;
19941995
else
19951996
bp->hw_stats.macb.rx_overruns++;
1997+
spin_unlock(&bp->stats_lock);
19961998

19971999
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
19982000
queue_writel(queue, ISR, MACB_BIT(ISR_ROVR));
@@ -3112,6 +3114,7 @@ static void gem_get_stats(struct macb *bp, struct rtnl_link_stats64 *nstat)
31123114
{
31133115
struct gem_stats *hwstat = &bp->hw_stats.gem;
31143116

3117+
spin_lock_irq(&bp->stats_lock);
31153118
if (netif_running(bp->dev))
31163119
gem_update_stats(bp);
31173120

@@ -3142,17 +3145,19 @@ static void gem_get_stats(struct macb *bp, struct rtnl_link_stats64 *nstat)
31423145
nstat->tx_aborted_errors = hwstat->tx_excessive_collisions;
31433146
nstat->tx_carrier_errors = hwstat->tx_carrier_sense_errors;
31443147
nstat->tx_fifo_errors = hwstat->tx_underrun;
3148+
spin_unlock_irq(&bp->stats_lock);
31453149
}
31463150

31473151
static void gem_get_ethtool_stats(struct net_device *dev,
31483152
struct ethtool_stats *stats, u64 *data)
31493153
{
3150-
struct macb *bp;
3154+
struct macb *bp = netdev_priv(dev);
31513155

3152-
bp = netdev_priv(dev);
3156+
spin_lock_irq(&bp->stats_lock);
31533157
gem_update_stats(bp);
31543158
memcpy(data, &bp->ethtool_stats, sizeof(u64)
31553159
* (GEM_STATS_LEN + QUEUE_STATS_LEN * MACB_MAX_QUEUES));
3160+
spin_unlock_irq(&bp->stats_lock);
31563161
}
31573162

31583163
static int gem_get_sset_count(struct net_device *dev, int sset)
@@ -3205,6 +3210,7 @@ static void macb_get_stats(struct net_device *dev,
32053210
}
32063211

32073212
/* read stats from hardware */
3213+
spin_lock_irq(&bp->stats_lock);
32083214
macb_update_stats(bp);
32093215

32103216
/* Convert HW stats into netdevice stats */
@@ -3238,6 +3244,7 @@ static void macb_get_stats(struct net_device *dev,
32383244
nstat->tx_carrier_errors = hwstat->tx_carrier_errors;
32393245
nstat->tx_fifo_errors = hwstat->tx_underruns;
32403246
/* Don't know about heartbeat or window errors... */
3247+
spin_unlock_irq(&bp->stats_lock);
32413248
}
32423249

32433250
static void macb_get_pause_stats(struct net_device *dev,
@@ -5263,6 +5270,7 @@ static int macb_probe(struct platform_device *pdev)
52635270
}
52645271
}
52655272
spin_lock_init(&bp->lock);
5273+
spin_lock_init(&bp->stats_lock);
52665274

52675275
/* setup capabilities */
52685276
macb_configure_caps(bp, macb_config);

drivers/net/ipvlan/ipvlan_core.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,20 +416,25 @@ struct ipvl_addr *ipvlan_addr_lookup(struct ipvl_port *port, void *lyr3h,
416416

417417
static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb)
418418
{
419-
const struct iphdr *ip4h = ip_hdr(skb);
420419
struct net_device *dev = skb->dev;
421420
struct net *net = dev_net(dev);
422-
struct rtable *rt;
423421
int err, ret = NET_XMIT_DROP;
422+
const struct iphdr *ip4h;
423+
struct rtable *rt;
424424
struct flowi4 fl4 = {
425425
.flowi4_oif = dev->ifindex,
426-
.flowi4_tos = inet_dscp_to_dsfield(ip4h_dscp(ip4h)),
427426
.flowi4_flags = FLOWI_FLAG_ANYSRC,
428427
.flowi4_mark = skb->mark,
429-
.daddr = ip4h->daddr,
430-
.saddr = ip4h->saddr,
431428
};
432429

430+
if (!pskb_network_may_pull(skb, sizeof(struct iphdr)))
431+
goto err;
432+
433+
ip4h = ip_hdr(skb);
434+
fl4.daddr = ip4h->daddr;
435+
fl4.saddr = ip4h->saddr;
436+
fl4.flowi4_tos = inet_dscp_to_dsfield(ip4h_dscp(ip4h));
437+
433438
rt = ip_route_output_flow(net, &fl4, NULL);
434439
if (IS_ERR(rt))
435440
goto err;
@@ -488,6 +493,12 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
488493
struct net_device *dev = skb->dev;
489494
int err, ret = NET_XMIT_DROP;
490495

496+
if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr))) {
497+
DEV_STATS_INC(dev, tx_errors);
498+
kfree_skb(skb);
499+
return ret;
500+
}
501+
491502
err = ipvlan_route_v6_outbound(dev, skb);
492503
if (unlikely(err)) {
493504
DEV_STATS_INC(dev, tx_errors);

drivers/net/loopback.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,22 @@ static netdev_tx_t blackhole_netdev_xmit(struct sk_buff *skb,
244244
return NETDEV_TX_OK;
245245
}
246246

247+
static int blackhole_neigh_output(struct neighbour *n, struct sk_buff *skb)
248+
{
249+
kfree_skb(skb);
250+
return 0;
251+
}
252+
253+
static int blackhole_neigh_construct(struct net_device *dev,
254+
struct neighbour *n)
255+
{
256+
n->output = blackhole_neigh_output;
257+
return 0;
258+
}
259+
247260
static const struct net_device_ops blackhole_netdev_ops = {
248261
.ndo_start_xmit = blackhole_netdev_xmit,
262+
.ndo_neigh_construct = blackhole_neigh_construct,
249263
};
250264

251265
/* This is a dst-dummy device used specifically for invalidated

fs/afs/server.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ static struct afs_server *afs_install_server(struct afs_cell *cell,
163163
rb_insert_color(&server->uuid_rb, &net->fs_servers);
164164
hlist_add_head_rcu(&server->proc_link, &net->fs_proc);
165165

166+
afs_get_cell(cell, afs_cell_trace_get_server);
167+
166168
added_dup:
167169
write_seqlock(&net->fs_addr_lock);
168170
estate = rcu_dereference_protected(server->endpoint_state,
@@ -442,6 +444,7 @@ static void afs_server_rcu(struct rcu_head *rcu)
442444
atomic_read(&server->active), afs_server_trace_free);
443445
afs_put_endpoint_state(rcu_access_pointer(server->endpoint_state),
444446
afs_estate_trace_put_server);
447+
afs_put_cell(server->cell, afs_cell_trace_put_server);
445448
kfree(server);
446449
}
447450

fs/afs/server_list.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ struct afs_server_list *afs_alloc_server_list(struct afs_volume *volume,
9797
break;
9898
if (j < slist->nr_servers) {
9999
if (slist->servers[j].server == server) {
100-
afs_put_server(volume->cell->net, server,
101-
afs_server_trace_put_slist_isort);
100+
afs_unuse_server(volume->cell->net, server,
101+
afs_server_trace_put_slist_isort);
102102
continue;
103103
}
104104

include/net/sock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,6 +1742,7 @@ static inline bool sock_allow_reclassification(const struct sock *csk)
17421742
struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
17431743
struct proto *prot, int kern);
17441744
void sk_free(struct sock *sk);
1745+
void sk_net_refcnt_upgrade(struct sock *sk);
17451746
void sk_destruct(struct sock *sk);
17461747
struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority);
17471748
void sk_free_unlock_clone(struct sock *sk);

include/trace/events/afs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ enum yfs_cm_operation {
174174
EM(afs_cell_trace_get_queue_dns, "GET q-dns ") \
175175
EM(afs_cell_trace_get_queue_manage, "GET q-mng ") \
176176
EM(afs_cell_trace_get_queue_new, "GET q-new ") \
177+
EM(afs_cell_trace_get_server, "GET server") \
177178
EM(afs_cell_trace_get_vol, "GET vol ") \
178179
EM(afs_cell_trace_insert, "INSERT ") \
179180
EM(afs_cell_trace_manage, "MANAGE ") \
@@ -182,6 +183,7 @@ enum yfs_cm_operation {
182183
EM(afs_cell_trace_put_destroy, "PUT destry") \
183184
EM(afs_cell_trace_put_queue_work, "PUT q-work") \
184185
EM(afs_cell_trace_put_queue_fail, "PUT q-fail") \
186+
EM(afs_cell_trace_put_server, "PUT server") \
185187
EM(afs_cell_trace_put_vol, "PUT vol ") \
186188
EM(afs_cell_trace_see_source, "SEE source") \
187189
EM(afs_cell_trace_see_ws, "SEE ws ") \

0 commit comments

Comments
 (0)