From: Greg KH <gregkh@linuxfoundation.org>
To: jianqi.ren.cn@windriver.com
Cc: stable@vger.kernel.org, patches@lists.linux.dev,
linux-kernel@vger.kernel.org, jhs@mojatatu.com,
xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net,
kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
michal.swiatkowski@linux.intel.com, zhe.he@windriver.com
Subject: Re: [PATCH 6.1.y v2] net/sched: act_mirred: don't override retval if we already lost the skb
Date: Mon, 28 Apr 2025 13:46:03 +0200 [thread overview]
Message-ID: <2025042844-pavestone-fringe-1478@gregkh> (raw)
In-Reply-To: <20250428080103.4158144-1-jianqi.ren.cn@windriver.com>
On Mon, Apr 28, 2025 at 04:01:03PM +0800, jianqi.ren.cn@windriver.com wrote:
> From: Jakub Kicinski <kuba@kernel.org>
>
> [ Upstream commit 166c2c8a6a4dc2e4ceba9e10cfe81c3e469e3210 ]
>
> If we're redirecting the skb, and haven't called tcf_mirred_forward(),
> yet, we need to tell the core to drop the skb by setting the retcode
> to SHOT. If we have called tcf_mirred_forward(), however, the skb
> is out of our hands and returning SHOT will lead to UaF.
>
> Move the retval override to the error path which actually need it.
>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Fixes: e5cf1baf92cb ("act_mirred: use TC_ACT_REINSERT when possible")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> [Minor conflict resolved due to code context change.]
> Signed-off-by: Jianqi Ren <jianqi.ren.cn@windriver.com>
> Signed-off-by: He Zhe <zhe.he@windriver.com>
> ---
> v2: Fix the following issue
> net/sched/act_mirred.c:265:6: error: variable 'is_redirect' is used
> uninitialized whenever 'if' condition is true
> found by the following tuxmake
> (https://lore.kernel.org/stable/CA+G9fYu+FEZ-3ye30Hk2sk1+LFsw7iO5AHueUa9H1Ub=JO-k2g@mail.gmail.com/)
> Verified the build test by cmd(tuxmake --runtime podman --target-arch arm
> --toolchain clang-20 --kconfig allmodconfig LLVM=1 LLVM_IAS=1)
I see 2 "v2" patches here, both different, so I'm dropping both of them
:(
next prev parent reply other threads:[~2025-04-28 11:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 8:01 [PATCH 6.1.y v2] net/sched: act_mirred: don't override retval if we already lost the skb jianqi.ren.cn
2025-04-28 11:46 ` Greg KH [this message]
2025-04-29 2:07 ` Ren, Jianqi (Jacky) (CN)
2025-04-29 5:26 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2025-04-28 7:45 jianqi.ren.cn
2025-04-28 7:52 ` Ren, Jianqi (Jacky) (CN)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2025042844-pavestone-fringe-1478@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--cc=jianqi.ren.cn@windriver.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=patches@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
--cc=zhe.he@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox