From: sashiko-bot@kernel.org
To: "Ciprian Regus" <ciprian.regus@analog.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH net-next v5 07/13] net: ethernet: oa_tc6: Add read_mms/write_mms register access functions
Date: Wed, 08 Jul 2026 22:34:55 +0000 [thread overview]
Message-ID: <20260708223455.B26731F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260708-adin1140-driver-v5-7-4aca7b51a58b@analog.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing SKB tailroom validation before skb_put() allows oversized frames to cause a kernel panic (DoS).
--
--- Patch [7]: [PATCH net-next v5 07/13] net: ethernet: oa_tc6: Add read_mms/write_mms register access functions ---
commit 1657b3f7ce65c20a46c5f26047b7e9b1c93b5265
Author: Ciprian Regus <ciprian.regus@analog.com>
net: ethernet: oa_tc6: Add read_mms/write_mms register access functions
The Open Alliance TC6 standard defines multiple memory maps for the
MAC-PHY's register space. Define register access functions that allow the
caller to specify the MMS.
> diff --git a/drivers/net/ethernet/oa_tc6.c b/drivers/net/ethernet/oa_tc6.c
> index 3c19233fb38f8..955148d3cefc4 100644
> --- a/drivers/net/ethernet/oa_tc6.c
> +++ b/drivers/net/ethernet/oa_tc6.c
> @@ -62,6 +62,8 @@
> #define STATUS0_RESETC_POLL_DELAY 1000
> #define STATUS0_RESETC_POLL_TIMEOUT 1000000
>
> +#define OA_TC6_REG_MMS_MASK GENMASK(19, 16)
> +
[Severity: High]
This isn't a bug introduced by this patch, but is it possible for oversized
frames to cause a kernel panic due to a missing SKB tailroom check?
Looking at oa_tc6_update_rx_skb() in this file, it unconditionally calls
skb_put():
drivers/net/ethernet/oa_tc6.c:oa_tc6_update_rx_skb() {
...
memcpy(skb_put(tc6->rx_skb, length), payload, length);
}
This is fed by continuous chunks of an ongoing frame:
drivers/net/ethernet/oa_tc6.c:oa_tc6_prcs_ongoing_rx_frame() {
...
oa_tc6_update_rx_skb(tc6, payload, OA_TC6_CHUNK_PAYLOAD_SIZE);
}
If an oversized frame is received, or if the MAC-PHY streams continuous chunks
without asserting the end_valid flag, the driver reassembles the frame by
repeatedly calling oa_tc6_prcs_ongoing_rx_frame() and oa_tc6_update_rx_skb().
Since the SKB is allocated with a fixed size, and skb_put() is called
unconditionally without verifying skb_tailroom(), won't this overflow the
bounds and cause a panic via skb_over_panic()?
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260708-adin1140-driver-v5-0-4aca7b51a58b@analog.com?part=7
next prev parent reply other threads:[~2026-07-08 22:34 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 22:33 [PATCH net-next v5 00/13] net: Add ADIN1140 support Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-07 22:33 ` [PATCH net-next v5 01/13] dt-bindings: net: Add ADIN1140 Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-07 22:33 ` [PATCH net-next v5 02/13] net: ethernet: oa_tc6: Handle the OA TC6 SPI protected mode Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-08 22:34 ` sashiko-bot
2026-07-07 22:33 ` [PATCH net-next v5 03/13] net: ethernet: oa_tc6: add OA_TC6_BROKEN_PHY quirk flag Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-08 22:34 ` sashiko-bot
2026-07-07 22:33 ` [PATCH net-next v5 04/13] net: ethernet: oa_tc6: Export the C45 access functions Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-08 22:34 ` sashiko-bot
2026-07-07 22:33 ` [PATCH net-next v5 05/13] net: ethernet: oa_tc6: Export standard defined registers Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-08 22:34 ` sashiko-bot
2026-07-07 22:33 ` [PATCH net-next v5 06/13] net: ethernet: oa_tc6: Add the OA_TC6_ prefix to standard registers Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-07 22:33 ` [PATCH net-next v5 07/13] net: ethernet: oa_tc6: Add read_mms/write_mms register access functions Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-08 17:23 ` Selvamani Rajagopal
2026-07-08 22:34 ` sashiko-bot [this message]
2026-07-07 22:33 ` [PATCH net-next v5 08/13] net: ethernet: oa_tc6: Use the read_mms/write_mms functions for C45 Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-08 22:34 ` sashiko-bot
2026-07-07 22:33 ` [PATCH net-next v5 09/13] net: ethernet: oa_tc6: Add new register address defines Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-07 22:33 ` [PATCH net-next v5 10/13] net: phy: add generic helpers for direct C45 MMD access Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-09 2:29 ` Selvamani Rajagopal
2026-07-07 22:33 ` [PATCH net-next v5 11/13] net: phy: microchip-t1s: use generic C45 MMD access helpers Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-07 22:33 ` [PATCH net-next v5 12/13] net: phy: Add support for the ADIN1140 PHY Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-08 22:34 ` sashiko-bot
2026-07-07 22:33 ` [PATCH net-next v5 13/13] net: ethernet: adi: Add a driver for the ADIN1140 MACPHY Ciprian Regus via B4 Relay
2026-07-07 22:33 ` Ciprian Regus
2026-07-08 22:34 ` sashiko-bot
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=20260708223455.B26731F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ciprian.regus@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.