Skip to contentSkip to conversation

tracing/net_sched: NULL pointer dereference in perf_trace_qdisc_reset()

PATCH In review Yunseong Kim 3 participants 5 messages Jul 2, 2024 – Jul 4, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tracing/net_sched: NULL pointer dereference in perf_trace_qdisc_reset()

Support backports for stable version. There are two places where null deref could happen before
commit 2c92ca849fcc ("tracing/treewide: Remove second parameter of __assign_str()")

I've checked +v6.1.82 +v6.6.22 +v6.7.10, +v6.8, +6.9, this version need to be applied, So, I applied the patch, tested it again, and confirmed working fine.

---
 include/trace/events/qdisc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/trace/events/qdisc.h +2 -2
index 1f4258308b96..061fd4960303 100644
@@ -81,14 +81,14 @@ TRACE_EVENT(qdisc_reset,
 	TP_ARGS(q),
 
 	TP_STRUCT__entry(
-		__string(	dev,		qdisc_dev(q)->name	)
+		__string(	dev,		qdisc_dev(q) ? qdisc_dev(q)->name : "(null)"	)
 		__string(	kind,		q->ops->id		)
 		__field(	u32,		parent			)
 		__field(	u32,		handle			)
 	),
 
 	TP_fast_assign(
-		__assign_str(dev, qdisc_dev(q)->name);
+		__assign_str(dev, qdisc_dev(q) ? qdisc_dev(q)->name : "(null)");
 		__assign_str(kind, q->ops->id);
 		__entry->parent = q->parent;
 		__entry->handle = q->handle;
Signature · 1 line
2.45.2
maintainer
#1 lore raw
Quoted 8 lines · On Wed, 3 Jul 2024 03:01:47 +0900 Yunseong Kim wrote:

Support backports for stable version. There are two places where null deref could happen before
commit 2c92ca849fcc ("tracing/treewide: Remove second parameter of __assign_str()")

I've checked +v6.1.82 +v6.6.22 +v6.7.10, +v6.8, +6.9, this version need to be applied, So, I applied the patch, tested it again, and confirmed working fine.

You're missing the customary "[ Upstream commit <upstream commit> ]" line, not sure Greg will pick this up.

#2 lore raw
Quoted 6 lines · Jakub Kicinski
Quoted 5 lines · On Wed, 3 Jul 2024 03:01:47 +0900 Yunseong Kim wrote:

Support backports for stable version. There are two places where null deref could happen before
commit 2c92ca849fcc ("tracing/treewide: Remove second parameter of __assign_str()")

Quoted 7 lines
Quoted 3 lines

I've checked +v6.1.82 +v6.6.22 +v6.7.10, +v6.8, +6.9, this version need to be applied, So, I applied the patch, tested it again, and confirmed working fine.

You're missing the customary "[ Upstream commit <upstream commit> ]" line, not sure Greg will pick this up.

Yeah, I missed this, needs to be very obvious what is happening here. I'll replace the version in the queues with this one now, thanks.

greg k-h

#3 lore raw

Hi Greg, Hi Jakub

Quoted 11 lines · Greg Kroah-Hartman
Quoted 10 lines · Jakub Kicinski
Quoted 8 lines · On Wed, 3 Jul 2024 03:01:47 +0900 Yunseong Kim wrote:

Support backports for stable version. There are two places where null deref could happen before
commit 2c92ca849fcc ("tracing/treewide: Remove second parameter of __assign_str()")

I've checked +v6.1.82 +v6.6.22 +v6.7.10, +v6.8, +6.9, this version need to be applied, So, I applied the patch, tested it again, and confirmed working fine.

Quoted 8 lines
Quoted 3 lines

You're missing the customary "[ Upstream commit <upstream commit> ]" line, not sure Greg will pick this up.

Yeah, I missed this, needs to be very obvious what is happening here. I'll replace the version in the queues with this one now, thanks.

greg k-h

Thank you for your hard work.

This fix need to be applied versions in +v5.10.213, +v5.15.152, +v6.1.82 +v6.6.22, +v6.7.10, +v6.8, +6.9

Warm regards,

Yunseong Kim

#4 lore raw
Quoted 21 lines · Yunseong Kim

Hi Greg, Hi Jakub

Quoted 18 lines · Greg Kroah-Hartman
Quoted 6 lines · Jakub Kicinski
Quoted 5 lines · On Wed, 3 Jul 2024 03:01:47 +0900 Yunseong Kim wrote:

Support backports for stable version. There are two places where null deref could happen before
commit 2c92ca849fcc ("tracing/treewide: Remove second parameter of __assign_str()")

Quoted 7 lines
Quoted 3 lines

I've checked +v6.1.82 +v6.6.22 +v6.7.10, +v6.8, +6.9, this version need to be applied, So, I applied the patch, tested it again, and confirmed working fine.

You're missing the customary "[ Upstream commit <upstream commit> ]" line, not sure Greg will pick this up.

Yeah, I missed this, needs to be very obvious what is happening here. I'll replace the version in the queues with this one now, thanks.

Quoted 9 lines
Quoted 1 line

greg k-h

Thank you for your hard work.

This fix need to be applied versions in +v5.10.213, +v5.15.152, +v6.1.82 +v6.6.22, +v6.7.10, +v6.8, +6.9

Already done.