From: sashiko-bot@kernel.org
To: "Arnd Bergmann" <arnd@kernel.org>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH 2/3] [v4, net-next] net: ethernet: ti-cpsw: fix linking built-in code to modules
Date: Wed, 22 Apr 2026 02:25:30 +0000 [thread overview]
Message-ID: <20260422022530.C1664C2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260402184726.3746487-2-arnd@kernel.org>
Sashiko AI review found 4 potential issue(s):
- [Critical] Shared global function pointer `cpsw_slave_index` causes use-after-free and out-of-bounds access across modules.
- [High] Shared global mutable array `ale_controls` causes hardware state corruption across different devices.
- [High] Userspace ABI breakage due to silent module rename of `ti_davinci_emac.ko` to `davinci_emac.ko`.
- [Low] Swapped EXPORT_SYMBOL_GPL macros for `cpsw_hwtstamp_set` and `cpsw_hwtstamp_get` under `!CONFIG_TI_CPTS`.
--
Note: The format of this review is altered to provide a free-form summary
of findings due to quoting/recitation restrictions.
commit bddbb0ecb5a5bfa6e8eb526f950b6ccd9620d793
Author: Arnd Bergmann <arnd@arndb.de>
net: ethernet: ti-cpsw: fix linking built-in code to modules
This commit changes the build system to create separate standalone modules
for shared CPSW driver components. It aims to resolve Kbuild warnings about
objects being linked into multiple modules by exporting symbols and creating
shared modules like ti-cpsw-common.ko, ti-cpsw-priv.ko, and ti-cpsw-ale.ko.
Link: https://lore.kernel.org/lkml/20240417084400.3034104-1-arnd@kernel.org/
Looking at the extraction of cpsw_priv.c into the shared ti-cpsw-priv.ko
module, does this introduce a use-after-free regression on the global
cpsw_slave_index function pointer?
This pointer is now shared system-wide across multiple drivers. If both
the older and newer cpsw drivers initialize and overwrite this global
pointer with their own module-specific functions, will unloading the
last loaded module leave a dangling pointer?
If the remaining driver attempts to access it, could it lead to a panic
or an out-of-bounds array access on cpsw->slaves?
Similarly, in the new ti-cpsw-ale.ko module, can the shared ale_controls
global array cause state corruption across different devices?
The ale_controls array is mutated at runtime during cpsw_ale_create()
based on device-specific parameters. Since it is no longer isolated per
driver, if a device like the am65-cpsw-nuss probes and mutates the global
array offsets, do subsequent standard CPSW devices end up using these
incorrect offsets?
In the drivers/net/ethernet/ti/Makefile, does changing the module target
from ti_davinci_emac.o to davinci_emac.o cause a userspace ABI regression?
Because the object name changed, Kbuild will now produce davinci_emac.ko
instead of the historic ti_davinci_emac.ko. Could this break modprobe
configurations or initramfs scripts that expect the old module name?
Finally, in cpsw_priv.c under the !CONFIG_TI_CPTS block, this isn't a bug,
but are the export macros swapped?
The EXPORT_SYMBOL_GPL(cpsw_hwtstamp_set) macro is placed directly after
the cpsw_hwtstamp_get() stub, and EXPORT_SYMBOL_GPL(cpsw_hwtstamp_get)
is placed after the cpsw_hwtstamp_set() stub.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260402184726.3746487-1-arnd@kernel.org?part=2
prev parent reply other threads:[~2026-04-22 2:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260402184726.3746487-1-arnd@kernel.org>
2026-04-02 18:46 ` [PATCH 2/3] [v4, net-next] net: ethernet: ti-cpsw: fix linking built-in code to modules Arnd Bergmann
2026-04-22 2:25 ` sashiko-bot [this message]
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=20260422022530.C1664C2BCB0@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=arnd@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=sashiko@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox