* [char-misc v2] mei: trace: treat reg parameter as string
@ 2026-01-08 6:57 Alexander Usyskin
2026-01-08 7:40 ` Greg Kroah-Hartman
0 siblings, 1 reply; 8+ messages in thread
From: Alexander Usyskin @ 2026-01-08 6:57 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Reuven Abliyev, Alexander Usyskin, linux-kernel, stable
Use the string wrapper to check sanity of the reg parameters,
store it value independently and prevent internal kernel data leaks.
Trace subsystem refuses to emit event with plain char*,
without the wrapper.
Cc: stable@vger.kernel.org
Fixes: a0a927d06d79 ("mei: me: add io register tracing")
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
V2: reword commit message
add Fixes and stable
drivers/misc/mei/mei-trace.h | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/misc/mei/mei-trace.h b/drivers/misc/mei/mei-trace.h
index 5312edbf5190..24fa321d88bd 100644
--- a/drivers/misc/mei/mei-trace.h
+++ b/drivers/misc/mei/mei-trace.h
@@ -21,18 +21,18 @@ TRACE_EVENT(mei_reg_read,
TP_ARGS(dev, reg, offs, val),
TP_STRUCT__entry(
__string(dev, dev_name(dev))
- __field(const char *, reg)
+ __string(reg, reg)
__field(u32, offs)
__field(u32, val)
),
TP_fast_assign(
__assign_str(dev);
- __entry->reg = reg;
+ __assign_str(reg);
__entry->offs = offs;
__entry->val = val;
),
TP_printk("[%s] read %s:[%#x] = %#x",
- __get_str(dev), __entry->reg, __entry->offs, __entry->val)
+ __get_str(dev), __get_str(reg), __entry->offs, __entry->val)
);
TRACE_EVENT(mei_reg_write,
@@ -40,18 +40,18 @@ TRACE_EVENT(mei_reg_write,
TP_ARGS(dev, reg, offs, val),
TP_STRUCT__entry(
__string(dev, dev_name(dev))
- __field(const char *, reg)
+ __string(reg, reg)
__field(u32, offs)
__field(u32, val)
),
TP_fast_assign(
__assign_str(dev);
- __entry->reg = reg;
+ __assign_str(reg);
__entry->offs = offs;
__entry->val = val;
),
TP_printk("[%s] write %s[%#x] = %#x",
- __get_str(dev), __entry->reg, __entry->offs, __entry->val)
+ __get_str(dev), __get_str(reg), __entry->offs, __entry->val)
);
TRACE_EVENT(mei_pci_cfg_read,
@@ -59,18 +59,18 @@ TRACE_EVENT(mei_pci_cfg_read,
TP_ARGS(dev, reg, offs, val),
TP_STRUCT__entry(
__string(dev, dev_name(dev))
- __field(const char *, reg)
+ __string(reg, reg)
__field(u32, offs)
__field(u32, val)
),
TP_fast_assign(
__assign_str(dev);
- __entry->reg = reg;
+ __assign_str(reg);
__entry->offs = offs;
__entry->val = val;
),
TP_printk("[%s] pci cfg read %s:[%#x] = %#x",
- __get_str(dev), __entry->reg, __entry->offs, __entry->val)
+ __get_str(dev), __get_str(reg), __entry->offs, __entry->val)
);
#endif /* _MEI_TRACE_H_ */
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [char-misc v2] mei: trace: treat reg parameter as string
2026-01-08 6:57 [char-misc v2] mei: trace: treat reg parameter as string Alexander Usyskin
@ 2026-01-08 7:40 ` Greg Kroah-Hartman
2026-01-08 7:42 ` Usyskin, Alexander
0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2026-01-08 7:40 UTC (permalink / raw)
To: Alexander Usyskin; +Cc: Reuven Abliyev, linux-kernel, stable
On Thu, Jan 08, 2026 at 08:57:02AM +0200, Alexander Usyskin wrote:
> Use the string wrapper to check sanity of the reg parameters,
> store it value independently and prevent internal kernel data leaks.
> Trace subsystem refuses to emit event with plain char*,
> without the wrapper.
>
> Cc: stable@vger.kernel.org
Does this really fix a bug? If not, there's no need for cc: stable or:
> Fixes: a0a927d06d79 ("mei: me: add io register tracing")
That line as well.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread* RE: [char-misc v2] mei: trace: treat reg parameter as string
2026-01-08 7:40 ` Greg Kroah-Hartman
@ 2026-01-08 7:42 ` Usyskin, Alexander
2026-01-08 7:55 ` Greg Kroah-Hartman
0 siblings, 1 reply; 8+ messages in thread
From: Usyskin, Alexander @ 2026-01-08 7:42 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Abliyev, Reuven, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
> Subject: Re: [char-misc v2] mei: trace: treat reg parameter as string
>
> On Thu, Jan 08, 2026 at 08:57:02AM +0200, Alexander Usyskin wrote:
> > Use the string wrapper to check sanity of the reg parameters,
> > store it value independently and prevent internal kernel data leaks.
> > Trace subsystem refuses to emit event with plain char*,
> > without the wrapper.
> >
> > Cc: stable@vger.kernel.org
>
> Does this really fix a bug? If not, there's no need for cc: stable or:
>
> > Fixes: a0a927d06d79 ("mei: me: add io register tracing")
>
> That line as well.
>
> thanks,
>
> greg k-h
Without this patch the events are not emitted at all, they are dropped
by trace security checker.
- -
Thanks,
Sasha
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [char-misc v2] mei: trace: treat reg parameter as string
2026-01-08 7:42 ` Usyskin, Alexander
@ 2026-01-08 7:55 ` Greg Kroah-Hartman
2026-01-08 7:59 ` Usyskin, Alexander
0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2026-01-08 7:55 UTC (permalink / raw)
To: Usyskin, Alexander
Cc: Abliyev, Reuven, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
On Thu, Jan 08, 2026 at 07:42:22AM +0000, Usyskin, Alexander wrote:
> > Subject: Re: [char-misc v2] mei: trace: treat reg parameter as string
> >
> > On Thu, Jan 08, 2026 at 08:57:02AM +0200, Alexander Usyskin wrote:
> > > Use the string wrapper to check sanity of the reg parameters,
> > > store it value independently and prevent internal kernel data leaks.
> > > Trace subsystem refuses to emit event with plain char*,
> > > without the wrapper.
> > >
> > > Cc: stable@vger.kernel.org
> >
> > Does this really fix a bug? If not, there's no need for cc: stable or:
> >
> > > Fixes: a0a927d06d79 ("mei: me: add io register tracing")
> >
> > That line as well.
> >
> > thanks,
> >
> > greg k-h
>
> Without this patch the events are not emitted at all, they are dropped
> by trace security checker.
Ah, again, that was not obvious at all from the changelog. Perhaps
reword it a bit? How has this ever worked?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread* RE: [char-misc v2] mei: trace: treat reg parameter as string
2026-01-08 7:55 ` Greg Kroah-Hartman
@ 2026-01-08 7:59 ` Usyskin, Alexander
2026-01-08 8:17 ` Greg Kroah-Hartman
0 siblings, 1 reply; 8+ messages in thread
From: Usyskin, Alexander @ 2026-01-08 7:59 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Abliyev, Reuven, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
> Subject: Re: [char-misc v2] mei: trace: treat reg parameter as string
>
> On Thu, Jan 08, 2026 at 07:42:22AM +0000, Usyskin, Alexander wrote:
> > > Subject: Re: [char-misc v2] mei: trace: treat reg parameter as string
> > >
> > > On Thu, Jan 08, 2026 at 08:57:02AM +0200, Alexander Usyskin wrote:
> > > > Use the string wrapper to check sanity of the reg parameters,
> > > > store it value independently and prevent internal kernel data leaks.
> > > > Trace subsystem refuses to emit event with plain char*,
> > > > without the wrapper.
> > > >
> > > > Cc: stable@vger.kernel.org
> > >
> > > Does this really fix a bug? If not, there's no need for cc: stable or:
> > >
> > > > Fixes: a0a927d06d79 ("mei: me: add io register tracing")
> > >
> > > That line as well.
> > >
> > > thanks,
> > >
> > > greg k-h
> >
> > Without this patch the events are not emitted at all, they are dropped
> > by trace security checker.
>
> Ah, again, that was not obvious at all from the changelog. Perhaps
> reword it a bit? How has this ever worked?
>
This security hardening was introduced way after the initial commit
and the breakage went unnoticed for some time, unfortunately.
- -
Thanks,
Sasha
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [char-misc v2] mei: trace: treat reg parameter as string
2026-01-08 7:59 ` Usyskin, Alexander
@ 2026-01-08 8:17 ` Greg Kroah-Hartman
2026-01-08 8:18 ` Greg Kroah-Hartman
0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2026-01-08 8:17 UTC (permalink / raw)
To: Usyskin, Alexander
Cc: Abliyev, Reuven, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
On Thu, Jan 08, 2026 at 07:59:08AM +0000, Usyskin, Alexander wrote:
> > Subject: Re: [char-misc v2] mei: trace: treat reg parameter as string
> >
> > On Thu, Jan 08, 2026 at 07:42:22AM +0000, Usyskin, Alexander wrote:
> > > > Subject: Re: [char-misc v2] mei: trace: treat reg parameter as string
> > > >
> > > > On Thu, Jan 08, 2026 at 08:57:02AM +0200, Alexander Usyskin wrote:
> > > > > Use the string wrapper to check sanity of the reg parameters,
> > > > > store it value independently and prevent internal kernel data leaks.
> > > > > Trace subsystem refuses to emit event with plain char*,
> > > > > without the wrapper.
> > > > >
> > > > > Cc: stable@vger.kernel.org
> > > >
> > > > Does this really fix a bug? If not, there's no need for cc: stable or:
> > > >
> > > > > Fixes: a0a927d06d79 ("mei: me: add io register tracing")
> > > >
> > > > That line as well.
> > > >
> > > > thanks,
> > > >
> > > > greg k-h
> > >
> > > Without this patch the events are not emitted at all, they are dropped
> > > by trace security checker.
> >
> > Ah, again, that was not obvious at all from the changelog. Perhaps
> > reword it a bit? How has this ever worked?
> >
>
> This security hardening was introduced way after the initial commit
> and the breakage went unnoticed for some time, unfortunately.
So then the "Fixes:" tag is not correct :(
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [char-misc v2] mei: trace: treat reg parameter as string
2026-01-08 8:17 ` Greg Kroah-Hartman
@ 2026-01-08 8:18 ` Greg Kroah-Hartman
2026-01-08 12:35 ` Usyskin, Alexander
0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2026-01-08 8:18 UTC (permalink / raw)
To: Usyskin, Alexander
Cc: Abliyev, Reuven, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
On Thu, Jan 08, 2026 at 09:17:12AM +0100, Greg Kroah-Hartman wrote:
> On Thu, Jan 08, 2026 at 07:59:08AM +0000, Usyskin, Alexander wrote:
> > > Subject: Re: [char-misc v2] mei: trace: treat reg parameter as string
> > >
> > > On Thu, Jan 08, 2026 at 07:42:22AM +0000, Usyskin, Alexander wrote:
> > > > > Subject: Re: [char-misc v2] mei: trace: treat reg parameter as string
> > > > >
> > > > > On Thu, Jan 08, 2026 at 08:57:02AM +0200, Alexander Usyskin wrote:
> > > > > > Use the string wrapper to check sanity of the reg parameters,
> > > > > > store it value independently and prevent internal kernel data leaks.
> > > > > > Trace subsystem refuses to emit event with plain char*,
> > > > > > without the wrapper.
> > > > > >
> > > > > > Cc: stable@vger.kernel.org
> > > > >
> > > > > Does this really fix a bug? If not, there's no need for cc: stable or:
> > > > >
> > > > > > Fixes: a0a927d06d79 ("mei: me: add io register tracing")
> > > > >
> > > > > That line as well.
> > > > >
> > > > > thanks,
> > > > >
> > > > > greg k-h
> > > >
> > > > Without this patch the events are not emitted at all, they are dropped
> > > > by trace security checker.
> > >
> > > Ah, again, that was not obvious at all from the changelog. Perhaps
> > > reword it a bit? How has this ever worked?
> > >
> >
> > This security hardening was introduced way after the initial commit
> > and the breakage went unnoticed for some time, unfortunately.
>
> So then the "Fixes:" tag is not correct :(
Wait, no, it is, but you need to say why this is now needed, and was not
a problem back then. And is this really ok to backport all the way to
that commit id, or should it just be relegated to the one where the
"hardening" feature was added?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread* RE: [char-misc v2] mei: trace: treat reg parameter as string
2026-01-08 8:18 ` Greg Kroah-Hartman
@ 2026-01-08 12:35 ` Usyskin, Alexander
0 siblings, 0 replies; 8+ messages in thread
From: Usyskin, Alexander @ 2026-01-08 12:35 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Abliyev, Reuven, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
> Subject: Re: [char-misc v2] mei: trace: treat reg parameter as string
>
> On Thu, Jan 08, 2026 at 09:17:12AM +0100, Greg Kroah-Hartman wrote:
> > On Thu, Jan 08, 2026 at 07:59:08AM +0000, Usyskin, Alexander wrote:
> > > > Subject: Re: [char-misc v2] mei: trace: treat reg parameter as string
> > > >
> > > > On Thu, Jan 08, 2026 at 07:42:22AM +0000, Usyskin, Alexander wrote:
> > > > > > Subject: Re: [char-misc v2] mei: trace: treat reg parameter as string
> > > > > >
> > > > > > On Thu, Jan 08, 2026 at 08:57:02AM +0200, Alexander Usyskin wrote:
> > > > > > > Use the string wrapper to check sanity of the reg parameters,
> > > > > > > store it value independently and prevent internal kernel data leaks.
> > > > > > > Trace subsystem refuses to emit event with plain char*,
> > > > > > > without the wrapper.
> > > > > > >
> > > > > > > Cc: stable@vger.kernel.org
> > > > > >
> > > > > > Does this really fix a bug? If not, there's no need for cc: stable or:
> > > > > >
> > > > > > > Fixes: a0a927d06d79 ("mei: me: add io register tracing")
> > > > > >
> > > > > > That line as well.
> > > > > >
> > > > > > thanks,
> > > > > >
> > > > > > greg k-h
> > > > >
> > > > > Without this patch the events are not emitted at all, they are dropped
> > > > > by trace security checker.
> > > >
> > > > Ah, again, that was not obvious at all from the changelog. Perhaps
> > > > reword it a bit? How has this ever worked?
> > > >
> > >
> > > This security hardening was introduced way after the initial commit
> > > and the breakage went unnoticed for some time, unfortunately.
> >
> > So then the "Fixes:" tag is not correct :(
>
> Wait, no, it is, but you need to say why this is now needed, and was not
> a problem back then. And is this really ok to backport all the way to
> that commit id, or should it just be relegated to the one where the
> "hardening" feature was added?
>
Sure, will add this info to the commit message.
The __string accessors and friends were available when original commit was merged.
Original commit uses such functions for another field.
Thus, I suppose, it is ok to backport all the way to that commit id.
- -
Thanks,
Sasha
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-01-08 12:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08 6:57 [char-misc v2] mei: trace: treat reg parameter as string Alexander Usyskin
2026-01-08 7:40 ` Greg Kroah-Hartman
2026-01-08 7:42 ` Usyskin, Alexander
2026-01-08 7:55 ` Greg Kroah-Hartman
2026-01-08 7:59 ` Usyskin, Alexander
2026-01-08 8:17 ` Greg Kroah-Hartman
2026-01-08 8:18 ` Greg Kroah-Hartman
2026-01-08 12:35 ` Usyskin, Alexander
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox