All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Stanislav Fomichev <sdf.kernel@gmail.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Jakub Kicinski <kuba@kernel.org>, Sasha Levin <sashal@kernel.org>,
	donald.hunter@gmail.com, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH AUTOSEL 7.0-6.18] tools/ynl: add missing uapi header deps in Makefile.deps
Date: Wed, 20 May 2026 07:19:14 -0400	[thread overview]
Message-ID: <20260520111944.3424570-42-sashal@kernel.org> (raw)
In-Reply-To: <20260520111944.3424570-1-sashal@kernel.org>

From: Stanislav Fomichev <sdf.kernel@gmail.com>

[ Upstream commit 46e9b0224475abc739612ef72c35b7c90211a0c1 ]

ethtool.h includes linux/typelimits.h which is a relatively new header
not yet shipped in most distro kernel-header packages. Without the
explicit entry, the build silently falls through to -idirafter.

dev_energymodel.h is a new YNL family whose uapi header is not in
system paths at all and was missing a CFLAGS entry entirely.

Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20260508204114.205896-2-sdf@fomichev.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

## Commit
`46e9b0224475` `tools/ynl: add missing uapi header deps in
Makefile.deps`

## Phase Walkthrough
### Phase 1: Commit Message Forensics
Record 1.1: Subsystem `tools/ynl`; action verb `add`; intent is to add
missing YNL uAPI header dependency entries.

Record 1.2: Tags present: `Signed-off-by: Stanislav Fomichev
<sdf@fomichev.me>`, `Link:
https://patch.msgid.link/20260508204114.205896-2-sdf@fomichev.me`,
`Signed-off-by: Jakub Kicinski <kuba@kernel.org>`. No `Fixes:`,
`Reported-by:`, `Tested-by:`, `Reviewed-by`, `Cc: stable`.

Record 1.3: The described problem is incomplete `Makefile.deps`:
`ethtool.h` includes the newer `linux/typelimits.h`, and
`dev_energymodel.h` has a YNL family/spec but no `CFLAGS_dev-
energymodel` entry. Symptom is YNL tools/header dependency build
correctness with distro kernel headers; no crash/security/data-
corruption symptom is described.

Record 1.4: This is a build/tooling correctness fix, not a hidden
runtime bug fix.

### Phase 2: Diff Analysis
Record 2.1: One file changed: `tools/net/ynl/Makefile.deps`, `+3/-1`. No
functions; Makefile variables only. Scope is single-file surgical.

Record 2.2: Before: `ethtool` force-included `ethtool.h`,
`ethtool_netlink.h`, and generated ethtool netlink headers, but not
`typelimits.h`; `dev-energymodel` had no per-family CFLAGS. After:
`typelimits.h` is explicitly force-included before `ethtool.h`, and
`CFLAGS_dev-energymodel` force-includes `dev_energymodel.h`.

Record 2.3: Bug category is build/tooling dependency correctness. It is
not memory safety, locking, refcounting, or runtime logic.

Record 2.4: Fix quality is high: tiny, declarative Makefile-only change.
Regression risk is low for `v7.0.y`; but not suitable unmodified for
older trees lacking `include/uapi/linux/typelimits.h`.

### Phase 3: Git History
Record 3.1: Blame showed the affected `CFLAGS_ethtool` line came from
`46fb3ba95b93`, later ethtool deps from `0bdcfaf84a942`; `get_hdr_inc2`
came from `db6b35cffe59`.

Record 3.2: No `Fixes:` tag, so no target commit to follow.

Record 3.3: Related history includes prior YNL old-header/build fixes:
`db6b35cffe59 tools: ynl: fix build on systems with old kernel headers`,
`0bdcfaf84a942 tools: ynl: add all headers to makefile deps`, and
several YNL family additions.

Record 3.4: Author Stanislav Fomichev has related net/YNL commits; Jakub
Kicinski committed it and is a netdev maintainer.

Record 3.5: Dependency check: `dev_energymodel.h` and `dev-
energymodel.yaml` exist in `v6.19+`; `typelimits.h` and the ethtool
include of it exist in `v7.0+`. The full patch is therefore appropriate
as-is for `v7.0.y`, not for `v6.19.y`.

### Phase 4: Mailing List
Record 4.1: `b4 dig` found the original submission at the provided patch
link. It was `[PATCH net-next 1/2]`.

Record 4.2: `b4 dig -w` showed netdev maintainers/lists were included:
`netdev`, `davem`, `edumazet`, `kuba`, `pabeni`, Donald Hunter, Simon
Horman, and `linux-kernel`.

Record 4.3: No separate bug report, syzbot report, or user crash report
was found. WebFetch of the patch URL was blocked by Anubis, but `b4`
retrieved the lore thread.

Record 4.4: It was part of a 2-patch series. Patch 1 was applied to
`netdev/net.git`; patch 2, the check-deps target, was not applied.
Jakub’s concern was about patch 2 being better as a NIPA check, not
about patch 1.

Record 4.5: No stable-specific discussion or stable nomination found.

### Phase 5: Code Semantic Analysis
Record 5.1: No C functions modified; key Makefile variables are
`CFLAGS_ethtool` and new `CFLAGS_dev-energymodel`.

Record 5.2: `tools/net/ynl/generated/Makefile` uses `$(CFLAGS_$*)` when
compiling `%-user.o`; dry-run confirmed `ethtool-user.o` and `dev-
energymodel-user.o` are affected.

Record 5.3: The YNL generator uses each spec’s `uapi-header`; `dev-
energymodel.yaml` declares `uapi-header: linux/dev_energymodel.h`.

Record 5.4: This is reachable through building generated YNL userspace
protocol objects, not through runtime kernel execution or syscalls.

Record 5.5: Similar pattern exists throughout `Makefile.deps`: YNL
families have explicit `CFLAGS_<family>` entries to force the in-tree
uAPI header and avoid stale/missing system headers.

### Phase 6: Stable Tree Analysis
Record 6.1: `v7.0`/`v7.0.9` contain both prerequisites:
`dev_energymodel.h`, `dev-energymodel.yaml`, `typelimits.h`, and
`ethtool.h` including `typelimits.h`. Older checked tags before `v6.19`
do not contain the dev-energymodel pieces; `v6.19` lacks `typelimits.h`.

Record 6.2: Patch applies cleanly to current `7.0.y` workspace. Backport
difficulty for `v7.0.y`: clean. For `v6.19.y`: needs adjustment or
should not take the `typelimits` hunk.

Record 6.3: No equivalent related fix was found already in
`stable/linux-7.0.y`.

### Phase 7: Subsystem Context
Record 7.1: Subsystem is `tools/net/ynl`, userspace tooling for netlink
YAML-generated helpers. Criticality is peripheral to kernel runtime but
relevant to building kernel tools.

Record 7.2: Subsystem is active; recent history shows several generated
YNL family and Makefile dependency changes.

### Phase 8: Impact And Risk
Record 8.1: Affected users are developers/distributions/build systems
building `tools/net/ynl/generated`, especially with distro kernel-header
packages that lack newer headers.

Record 8.2: Trigger is building generated YNL objects for `ethtool` or
`dev-energymodel`. No unprivileged runtime trigger.

Record 8.3: Failure mode is build/tooling header dependency
inconsistency, not kernel crash or data corruption. Severity: medium as
a tools build fix.

Record 8.4: Benefit is moderate for `v7.0.y` build correctness; risk is
very low because this is a tiny Makefile-only dependency addition. Risk
rises only if applied blindly to older trees missing `typelimits.h`.

### Phase 9: Final Synthesis
Evidence for backporting: small contained build fix; applies cleanly to
`v7.0.y`; fixes incomplete YNL uAPI dependency declarations; netdev
maintainer applied patch 1; no runtime behavior or API change.

Evidence against: no crash/security/data-corruption issue; no stable
nomination; not appropriate unmodified for all older stable trees.

Stable rules: obviously correct yes; fixes a real build/tooling
dependency issue yes; important enough under build-fix exception for
`v7.0.y` yes; small/contained yes; no new API/feature yes; applies to
`v7.0.y` yes.

## Verification
- [Phase 1] `git show 46e9b0224475` verified subject, body, tags,
  author, committer, and `+3/-1` diff.
- [Phase 2] Diff verified only `tools/net/ynl/Makefile.deps` changes.
- [Phase 3] `git blame` and `git log` verified changed-line history and
  related YNL dependency fixes.
- [Phase 4] `b4 dig`, `b4 dig -a`, `b4 dig -w`, and saved mbox verified
  original lore thread, recipients, one revision, and patch 1
  application.
- [Phase 5] `rg`, `git grep`, `ReadFile`, and `make -n` verified how
  `CFLAGS_$*` reaches generated object builds.
- [Phase 6] Tag/ref checks verified affected code in `v7.0.y`; `git
  apply --check` verified clean application to current tree.
- [Phase 8] No runtime reachability was found; impact is limited to
  tools build/header dependency behavior.

Backport this to `v7.0.y`; avoid applying it unmodified to older stable
trees that lack `typelimits.h`.

**YES**

 tools/net/ynl/Makefile.deps | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/net/ynl/Makefile.deps b/tools/net/ynl/Makefile.deps
index 08205f9fc5257..cc53b2f21c444 100644
--- a/tools/net/ynl/Makefile.deps
+++ b/tools/net/ynl/Makefile.deps
@@ -15,9 +15,11 @@ UAPI_PATH:=../../../../include/uapi/
 get_hdr_inc=-D$(1) -include $(UAPI_PATH)/linux/$(2)
 get_hdr_inc2=-D$(1) -D$(2) -include $(UAPI_PATH)/linux/$(3)
 
+CFLAGS_dev-energymodel:=$(call get_hdr_inc,_LINUX_DEV_ENERGYMODEL_H,dev_energymodel.h)
 CFLAGS_devlink:=$(call get_hdr_inc,_LINUX_DEVLINK_H_,devlink.h)
 CFLAGS_dpll:=$(call get_hdr_inc,_LINUX_DPLL_H,dpll.h)
-CFLAGS_ethtool:=$(call get_hdr_inc,_LINUX_ETHTOOL_H,ethtool.h) \
+CFLAGS_ethtool:=$(call get_hdr_inc,_LINUX_TYPELIMITS_H,typelimits.h) \
+	$(call get_hdr_inc,_LINUX_ETHTOOL_H,ethtool.h) \
 	$(call get_hdr_inc,_LINUX_ETHTOOL_NETLINK_H_,ethtool_netlink.h) \
 	$(call get_hdr_inc,_LINUX_ETHTOOL_NETLINK_GENERATED_H,ethtool_netlink_generated.h)
 CFLAGS_handshake:=$(call get_hdr_inc,_LINUX_HANDSHAKE_H,handshake.h)
-- 
2.53.0


  parent reply	other threads:[~2026-05-20 11:20 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 11:18 [PATCH AUTOSEL 7.0-6.12] HID: logitech-hidpp: Add support for newer Bluetooth keyboards Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0] drm/amdgpu: remove deadlocks from amdgpu_userq_pre_reset Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-5.10] ALSA: sparc/dbri: add missing fallthrough Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-6.6] docs: cgroup-v1: Update charge-commit section Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-5.10] drm/panel: feiyang-fy07024di26a30d: return display-on error Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-6.6] ALSA: usb-audio: Add iface reset and delay quirk for TTGK Technology USB-C Audio Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-5.10] selftests/cgroup: Fix cg_read_strcmp() empty string comparison Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-6.1] smb: client: Zero-pad short GSS session keys per MS-SMB2 Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-5.10] HID: magicmouse: Prevent out-of-bounds (OOB) read during DOUBLE_REPORT_ID Sasha Levin
2026-05-20 11:41   ` sashiko-bot
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0] smb: client: avoid integer overflow in SMB2 READ length check Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-5.10] libceph: Fix unnecessarily high ceph_decode_need() for uniform bucket Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-6.6] ALSA: hda/realtek: fix mic boost on Framework PTL Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-6.6] io_uring: hold uring_lock when walking link chain in io_wq_free_work() Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-5.15] wifi: nl80211: re-check wiphy netns in nl80211_prepare_wdev_dump() continuation Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-6.12] KVM: arm64: nv: Consider the DS bit when translating TCR_EL2 Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0] docs: hwmon: sy7636a: fix temperature sysfs attribute name Sasha Levin
2026-05-20 11:24   ` sashiko-bot
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0] ALSA: hda/realtek: ALC269 fixup for Lenovo Yoga Pro 7 15ASH111 audio Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-6.6] ipv6: Implement limits on extension header parsing Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-6.12] net: usb: cdc_ncm: add Apple Mac USB-C direct networking quirk Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-5.15] net: usb: r8152: add TRENDnet TUC-ET2G v2.0 Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-5.10] i2c: dev: prevent integer overflow in I2C_TIMEOUT ioctl Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-5.10] powerpc/vmx: avoid KASAN instrumentation in enter_vmx_ops() for kexec Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-6.18] ALSA: usb-audio: add min_mute quirk for Razer Nommo V2 X Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-5.10] wifi: libertas: fix integer underflow in process_cmdrequest() Sasha Levin
2026-05-20 20:41   ` James Cameron
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-5.10] HID: mcp2221: fix OOB write in mcp2221_raw_event() Sasha Levin
2026-05-20 11:56   ` sashiko-bot
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0] io_uring/wait: honour caller's time namespace for IORING_ENTER_ABS_TIMER Sasha Levin
2026-05-20 11:40   ` Jens Axboe
2026-05-23 14:23     ` Jens Axboe
2026-05-23 14:45       ` Sasha Levin
2026-05-23 14:55         ` Jens Axboe
2026-05-23 15:06           ` Sasha Levin
2026-05-20 11:18 ` [PATCH AUTOSEL 7.0-5.10] wifi: nl80211: require CAP_NET_ADMIN over the target netns in SET_WIPHY_NETNS Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-5.10] HID: elan: Add support for ELAN SB974D touchpad Sasha Levin
2026-05-20 12:24   ` sashiko-bot
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.12] media: qcom: camss: avoid format string warning Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.12] HID: i2c-hid: add reset quirk for BLTP7853 touchpad Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.12] ALSA: hda/realtek: Limit mic boost on Positivo DN50E Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.12] Documentation: kvm: update links in the references section of AMD Memory Encryption Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-5.10] scsi: scsi_dh_alua: Increase default ALUA timeout to maximum spec value Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.1] HID: google: hammer: stop hardware on devres action failure Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.18] ALSA: doc: cs35l56: Update path to HDA driver source Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.18] Bluetooth: hci_uart: Fix NULL deref in recv callbacks when priv is uninitialized Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0] ALSA: hda/realtek: Add mute LED fixup for HP Pavilion 15-cs1xxx Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.12] btrfs: fix check_chunk_block_group_mappings() to iterate all chunk maps Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-5.15] ALSA: usb-audio: Add quirk flags for AlphaTheta EUPHONIA Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-5.10] powerpc/g5: Enable all windfarms by default Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.18] ALSA: hda/realtek: Add codec SSID quirk for Lenovo Yoga Pro 9 16IMH9 Sasha Levin
2026-05-20 11:19 ` Sasha Levin [this message]
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-5.10] fbdev: ipu-v3: clean up kernel-doc warnings Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.6] ASoC: amd: yc: Add DMI quirk for MSI Bravo 15 C7VE Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.1] powerpc/pasemi: Drop redundant res assignment Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-5.10] cgroup/cpuset: move PF_EXITING check before __GFP_HARDWALL in cpuset_current_node_allowed() Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.18] drm/amd/ras: Fix CPER ring debugfs read overflow Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-5.15] scsi: smartpqi: Silence a recursive lock warning Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0] io_uring: defer linked-timeout chain splice out of hrtimer context Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.18] io_uring: validate user-controlled cq.head in io_cqe_cache_refill() Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.12] platform/x86: asus-nb-wmi: add DMI quirk for ASUS Zenbook Duo UX8407AA Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.18] powerpc/pseries/htmdump: Free the global buffers in htmdump module exit Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.6] HID: sony: add missing size validation for SMK-Link remotes Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-5.15] HID: ft260: validate i2c input report length Sasha Levin
2026-05-20 11:57   ` sashiko-bot
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0] io_uring: hold uring_lock across io_kill_timeouts() in cancel path Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0] platform/x86: hp-wmi: Add support for Victus 16-r0xxx (8BC2) Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-5.10] i2c: acpi: Add ELAN0678 to i2c_acpi_force_100khz_device_ids Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.18] KVM: VMX: introduce module parameter to disable CET Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.18] iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19 Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-5.10] ALSA: usb-audio: add clock quirk for Motu 1248 Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.18] workqueue: Release PENDING in __queue_work() drain/destroy reject path Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0] ASoC: sdw_utils: avoid the SDCA companion function not supported failure Sasha Levin
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0] Documentation: security-bugs: do not systematically Cc the security team Sasha Levin
2026-05-20 13:07   ` Jonathan Corbet
2026-05-20 11:19 ` [PATCH AUTOSEL 7.0-6.12] io_uring/fdinfo: translate SqThread PID through caller's pid_ns Sasha Levin

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=20260520111944.3424570-42-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=patches@lists.linux.dev \
    --cc=sdf.kernel@gmail.com \
    --cc=sdf@fomichev.me \
    --cc=stable@vger.kernel.org \
    /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.