nft_bandwidth: add missing NULL guards to bandwidth_deps/tree_map.h#46
Open
ispyisail wants to merge 1 commit into
Open
nft_bandwidth: add missing NULL guards to bandwidth_deps/tree_map.h#46ispyisail wants to merge 1 commit into
ispyisail wants to merge 1 commit into
Conversation
Bandwidth carries its own private copy of the tree_map code family that package/libericstools/src/tree_map.c also uses. That copy already had NULL-pointer guards added earlier for the same segfault class; this copy was missing them. Adds get_string_map_element_with_hashed_key, get_string_map_keys, and sdbm_string_hash NULL checks to match. Found while investigating a separate kernel 6.12 boot corruption bug in this module; tested in isolation and confirmed NOT the cause of that corruption, but a real defensive gap worth fixing on its own merits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #43 — base branch is
openwrt-2512(the 25.12 bump), notmaster. Merge #43 first; this rebases cleanly onto master afterward.nft_bandwidthcarries its own private copy of the tree_map code family thatpackage/libericstools/src/tree_map.calso uses. That copy already has NULL-pointer guards for a real segfault class fixed elsewhere in the tree; this private copy inbandwidth_deps/tree_map.hwas missing the equivalent guards. Adds NULL checks toget_string_map_element_with_hashed_key,get_string_map_keys, andsdbm_string_hashto match.Not a fix for the kernel-6.12 rootfs corruption bug (already fixed in #43 by correcting the module's netlink attribute count and adding a sockopt-rollback path on registration failure) — tested in isolation and confirmed this change alone does not resolve that issue. This is a separate, real defensive gap worth closing on its own merits: a NULL map or key reaching these functions elsewhere in the module would otherwise dereference unconditionally.