From: Simon Horman <horms@kernel.org>
To: Stefan Wahren <wahrenst@gmx.net>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Dan Carpenter <dan.carpenter@linaro.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH net] net: vertexcom: mse102x: Fix possible double free of TX skb
Date: Thu, 24 Oct 2024 10:49:09 +0100 [thread overview]
Message-ID: <20241024094909.GL402847@kernel.org> (raw)
In-Reply-To: <20241022155242.33729-1-wahrenst@gmx.net>
On Tue, Oct 22, 2024 at 05:52:42PM +0200, Stefan Wahren wrote:
> The scope of the TX skb is wider than just mse102x_tx_frame_spi(),
> so in case the TX skb room needs to be expanded, also its pointer
> needs to be adjusted. Otherwise the already freed skb pointer would
> be freed again in mse102x_tx_work(), which leads to crashes:
>
> Internal error: Oops: 0000000096000004 [#2] PREEMPT SMP
> CPU: 0 PID: 712 Comm: kworker/0:1 Tainted: G D 6.6.23
> Hardware name: chargebyte Charge SOM DC-ONE (DT)
> Workqueue: events mse102x_tx_work [mse102x]
> pstate: 20400009 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : skb_release_data+0xb8/0x1d8
> lr : skb_release_data+0x1ac/0x1d8
> sp : ffff8000819a3cc0
> x29: ffff8000819a3cc0 x28: ffff0000046daa60 x27: ffff0000057f2dc0
> x26: ffff000005386c00 x25: 0000000000000002 x24: 00000000ffffffff
> x23: 0000000000000000 x22: 0000000000000001 x21: ffff0000057f2e50
> x20: 0000000000000006 x19: 0000000000000000 x18: ffff00003fdacfcc
> x17: e69ad452d0c49def x16: 84a005feff870102 x15: 0000000000000000
> x14: 000000000000024a x13: 0000000000000002 x12: 0000000000000000
> x11: 0000000000000400 x10: 0000000000000930 x9 : ffff00003fd913e8
> x8 : fffffc00001bc008
> x7 : 0000000000000000 x6 : 0000000000000008
> x5 : ffff00003fd91340 x4 : 0000000000000000 x3 : 0000000000000009
> x2 : 00000000fffffffe x1 : 0000000000000000 x0 : 0000000000000000
> Call trace:
> skb_release_data+0xb8/0x1d8
> kfree_skb_reason+0x48/0xb0
> mse102x_tx_work+0x164/0x35c [mse102x]
> process_one_work+0x138/0x260
> worker_thread+0x32c/0x438
> kthread+0x118/0x11c
> ret_from_fork+0x10/0x20
> Code: aa1303e0 97fffab6 72001c1f 54000141 (f9400660)
>
> Cc: stable@vger.kernel.org
> Fixes: 2f207cbf0dd4 ("net: vertexcom: Add MSE102x SPI support")
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2024-10-24 9:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 15:52 [PATCH net] net: vertexcom: mse102x: Fix possible double free of TX skb Stefan Wahren
2024-10-24 9:49 ` Simon Horman [this message]
2024-10-29 19:10 ` Jakub Kicinski
2024-10-29 21:15 ` Stefan Wahren
2024-10-29 22:01 ` Jakub Kicinski
2024-10-29 23:06 ` Stefan Wahren
2024-10-30 0:36 ` Jakub Kicinski
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=20241024094909.GL402847@kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=wahrenst@gmx.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.