Skip to content

Commit f9ac71b

Browse files
elpjmberg-intel
authored andcommitted
mac80211: fix vif name tracing
If sdata doesn't have a valid dev (e.g. in case of monitor vif), the vif_name field was initialized with (a length of) some short string, but later was set to a different, potentially larger one. This resulted in out-of-bounds write, which usually appeared as garbage in the trace log. Simply trace sdata->name, as it should always have the correct name for both cases. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 4a817aa commit f9ac71b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/mac80211/trace.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
#define VIF_ENTRY __field(enum nl80211_iftype, vif_type) __field(void *, sdata) \
2323
__field(bool, p2p) \
24-
__string(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
24+
__string(vif_name, sdata->name)
2525
#define VIF_ASSIGN __entry->vif_type = sdata->vif.type; __entry->sdata = sdata; \
2626
__entry->p2p = sdata->vif.p2p; \
27-
__assign_str(vif_name, sdata->dev ? sdata->dev->name : sdata->name)
27+
__assign_str(vif_name, sdata->name)
2828
#define VIF_PR_FMT " vif:%s(%d%s)"
2929
#define VIF_PR_ARG __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
3030

0 commit comments

Comments
 (0)