lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLzc7onLZ6c9OJ-8GW8DpoGHFNWagqttZ99hkhRzVpSOg@mail.gmail.com>
Date: Wed, 20 Mar 2024 19:25:48 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Jamal Hadi Salim <jhs@...atatu.com>
Cc: renmingshuai <renmingshuai@...wei.com>, xiyou.wangcong@...il.com, jiri@...nulli.us, 
	davem@...emloft.net, vladbu@...dia.com, netdev@...r.kernel.org, 
	yanan@...wei.com, liaichun@...wei.com, caowangbao@...wei.com, 
	Eric Dumazet <eric.dumazet@...il.com>, Jakub Kicinski <kuba@...nel.org>, 
	Paolo Abeni <pabeni@...hat.com>, Victor Nogueira <victor@...atatu.com>, 
	Pedro Tammela <pctammela@...atatu.com>, Davide Caratti <dcaratti@...hat.com>
Subject: Re: [PATCH] net/sched: Forbid assigning mirred action to a filter
 attached to the egress

On Wed, Mar 20, 2024 at 7:13 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Wed, Mar 20, 2024 at 6:50 PM Jamal Hadi Salim <jhs@...atatu.com> wrote:

> Nope, you just have to complete the patch, moving around
> dev_xmit_recursion_inc() and dev_xmit_recursion_dec()

Untested part would be:

diff --git a/net/core/dev.c b/net/core/dev.c
index 303a6ff46e4e16296e94ed6b726621abe093e567..dbeaf67282e8b6ec164d00d796c9fd8e4fd7c332
100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4259,6 +4259,8 @@ int __dev_queue_xmit(struct sk_buff *skb, struct
net_device *sb_dev)
         */
        rcu_read_lock_bh();

+       dev_xmit_recursion_inc();
+
        skb_update_prio(skb);

        qdisc_pkt_len_init(skb);
@@ -4331,9 +4333,7 @@ int __dev_queue_xmit(struct sk_buff *skb, struct
net_device *sb_dev)
                        HARD_TX_LOCK(dev, txq, cpu);

                        if (!netif_xmit_stopped(txq)) {
-                               dev_xmit_recursion_inc();
                                skb = dev_hard_start_xmit(skb, dev, txq, &rc);
-                               dev_xmit_recursion_dec();
                                if (dev_xmit_complete(rc)) {
                                        HARD_TX_UNLOCK(dev, txq);
                                        goto out;
@@ -4353,12 +4353,14 @@ int __dev_queue_xmit(struct sk_buff *skb,
struct net_device *sb_dev)
        }

        rc = -ENETDOWN;
+       dev_xmit_recursion_dec();
        rcu_read_unlock_bh();

        dev_core_stats_tx_dropped_inc(dev);
        kfree_skb_list(skb);
        return rc;
 out:
+       dev_xmit_recursion_dec();
        rcu_read_unlock_bh();
        return rc;
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ