Skip to content

Commit 67c53c4

Browse files
committed
Merge: net-core: stable backport from upstream for 9.7 phase 2
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6741 JIRA: https://issues.redhat.com/browse/RHEL-87474 A bunch of stable backport from upstream addressing misc issues Signed-off-by: Paolo Abeni <pabeni@redhat.com> Approved-by: Antoine Tenart <atenart@redhat.com> Approved-by: Florian Westphal <fwestpha@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Augusto Caringi <acaringi@redhat.com>
2 parents b524858 + ef874de commit 67c53c4

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

net/core/gro.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb)
619619
skb->pkt_type = PACKET_HOST;
620620

621621
skb->encapsulation = 0;
622+
skb->ip_summed = CHECKSUM_NONE;
622623
skb_shinfo(skb)->gso_type = 0;
623624
if (unlikely(skb->slow_gro)) {
624625
skb_orphan(skb);

net/core/neighbour.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3469,10 +3469,12 @@ static const struct seq_operations neigh_stat_seq_ops = {
34693469
static void __neigh_notify(struct neighbour *n, int type, int flags,
34703470
u32 pid)
34713471
{
3472-
struct net *net = dev_net(n->dev);
34733472
struct sk_buff *skb;
34743473
int err = -ENOBUFS;
3474+
struct net *net;
34753475

3476+
rcu_read_lock();
3477+
net = dev_net(n->dev);
34763478
skb = nlmsg_new(neigh_nlmsg_size(), GFP_ATOMIC);
34773479
if (skb == NULL)
34783480
goto errout;
@@ -3485,10 +3487,12 @@ static void __neigh_notify(struct neighbour *n, int type, int flags,
34853487
goto errout;
34863488
}
34873489
rtnl_notify(skb, net, 0, RTNLGRP_NEIGH, NULL, GFP_ATOMIC);
3488-
return;
3490+
goto out;
34893491
errout:
34903492
if (err < 0)
34913493
rtnl_set_sk_err(net, RTNLGRP_NEIGH, err);
3494+
out:
3495+
rcu_read_unlock();
34923496
}
34933497

34943498
void neigh_app_ns(struct neighbour *n)

net/core/netpoll.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ static int netpoll_owner_active(struct net_device *dev)
309309
static netdev_tx_t __netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
310310
{
311311
netdev_tx_t status = NETDEV_TX_BUSY;
312+
netdev_tx_t ret = NET_XMIT_DROP;
312313
struct net_device *dev;
313314
unsigned long tries;
314315
/* It is up to the caller to keep npinfo alive. */
@@ -317,11 +318,12 @@ static netdev_tx_t __netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
317318
lockdep_assert_irqs_disabled();
318319

319320
dev = np->dev;
321+
rcu_read_lock();
320322
npinfo = rcu_dereference_bh(dev->npinfo);
321323

322324
if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) {
323325
dev_kfree_skb_irq(skb);
324-
return NET_XMIT_DROP;
326+
goto out;
325327
}
326328

327329
/* don't get messages out of order, and no recursion */
@@ -360,7 +362,10 @@ static netdev_tx_t __netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
360362
skb_queue_tail(&npinfo->txq, skb);
361363
schedule_delayed_work(&npinfo->tx_work,0);
362364
}
363-
return NETDEV_TX_OK;
365+
ret = NETDEV_TX_OK;
366+
out:
367+
rcu_read_unlock();
368+
return ret;
364369
}
365370

366371
netdev_tx_t netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)

0 commit comments

Comments
 (0)