* [PATCH v2] HID: core: demote warning to debug level
@ 2026-05-23 10:55 Matteo Croce
2026-06-10 15:44 ` Jiri Kosina
0 siblings, 1 reply; 10+ messages in thread
From: Matteo Croce @ 2026-05-23 10:55 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Lee Jones
Cc: linux-input, linux-kernel, Matteo Croce
From: Matteo Croce <teknoraver@meta.com>
The log level for short messages was changed from debug to warning,
flooding syslog on systems with devices that regularly send
short reports, in my case an UPS:
$ dmesg |grep -c 'Event data for report .* was too short'
35
Demote it back to debug level.
Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
Signed-off-by: Matteo Croce <teknoraver@meta.com>
---
drivers/hid/hid-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 41a79e43c82b..503b9bfa5d37 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -2072,8 +2072,8 @@ int hid_report_raw_event(struct hid_device *hid, enum hid_report_type type, u8 *
rsize = max_buffer_size;
if (bsize < rsize) {
- hid_warn_ratelimited(hid, "Event data for report %d was too short (%d vs %zu)\n",
- report->id, rsize, bsize);
+ hid_dbg_ratelimited(hid, "Event data for report %d was too short (%d vs %zu)\n",
+ report->id, rsize, bsize);
return -EINVAL;
}
--
2.50.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2] HID: core: demote warning to debug level
2026-05-23 10:55 [PATCH v2] HID: core: demote warning to debug level Matteo Croce
@ 2026-06-10 15:44 ` Jiri Kosina
2026-08-24 10:25 ` Lee Jones
0 siblings, 1 reply; 10+ messages in thread
From: Jiri Kosina @ 2026-06-10 15:44 UTC (permalink / raw)
To: Matteo Croce
Cc: Benjamin Tissoires, Lee Jones, linux-input, linux-kernel,
Matteo Croce
On Sat, 23 May 2026, Matteo Croce wrote:
> From: Matteo Croce <teknoraver@meta.com>
>
> The log level for short messages was changed from debug to warning,
> flooding syslog on systems with devices that regularly send
> short reports, in my case an UPS:
>
> $ dmesg |grep -c 'Event data for report .* was too short'
> 35
>
> Demote it back to debug level.
>
> Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
> Signed-off-by: Matteo Croce <teknoraver@meta.com>
Applied, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] HID: core: demote warning to debug level
2026-06-10 15:44 ` Jiri Kosina
@ 2026-08-24 10:25 ` Lee Jones
2026-08-24 13:16 ` Benjamin Tissoires
2026-08-24 18:29 ` Matteo Croce
0 siblings, 2 replies; 10+ messages in thread
From: Lee Jones @ 2026-08-24 10:25 UTC (permalink / raw)
To: Jiri Kosina
Cc: Matteo Croce, Benjamin Tissoires, linux-input, linux-kernel,
Matteo Croce
On Wed, 10 Jun 2026, Jiri Kosina wrote:
> On Sat, 23 May 2026, Matteo Croce wrote:
>
> > From: Matteo Croce <teknoraver@meta.com>
> >
> > The log level for short messages was changed from debug to warning,
> > flooding syslog on systems with devices that regularly send
> > short reports, in my case an UPS:
> >
> > $ dmesg |grep -c 'Event data for report .* was too short'
> > 35
> >
> > Demote it back to debug level.
> >
> > Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
> > Signed-off-by: Matteo Croce <teknoraver@meta.com>
>
> Applied, thanks.
FWIW, I'd like to contest this patch.
The warning is real. It means that the HID report was rejected and as
such something on the system will be now be non-functional. Silencing
the warning is not helpful. It does not fix the issue, and now the user
/ admin has no idea that its even happening.
This warning has caught a bunch of genuine issues related to testing
infrastructure and incorrectly coded firmware that have subsequently
been rectified.
Please don't hide this issue. Fix the root cause instead.
--
Lee Jones
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] HID: core: demote warning to debug level
2026-08-24 10:25 ` Lee Jones
@ 2026-08-24 13:16 ` Benjamin Tissoires
2026-08-24 14:22 ` Lee Jones
2026-08-24 18:29 ` Matteo Croce
1 sibling, 1 reply; 10+ messages in thread
From: Benjamin Tissoires @ 2026-08-24 13:16 UTC (permalink / raw)
To: Lee Jones
Cc: Jiri Kosina, Matteo Croce, linux-input, linux-kernel,
Matteo Croce
On Aug 24 2026, Lee Jones wrote:
> On Wed, 10 Jun 2026, Jiri Kosina wrote:
>
> > On Sat, 23 May 2026, Matteo Croce wrote:
> >
> > > From: Matteo Croce <teknoraver@meta.com>
> > >
> > > The log level for short messages was changed from debug to warning,
> > > flooding syslog on systems with devices that regularly send
> > > short reports, in my case an UPS:
> > >
> > > $ dmesg |grep -c 'Event data for report .* was too short'
> > > 35
> > >
> > > Demote it back to debug level.
> > >
> > > Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
> > > Signed-off-by: Matteo Croce <teknoraver@meta.com>
> >
> > Applied, thanks.
>
> FWIW, I'd like to contest this patch.
>
> The warning is real. It means that the HID report was rejected and as
> such something on the system will be now be non-functional. Silencing
> the warning is not helpful. It does not fix the issue, and now the user
> / admin has no idea that its even happening.
>
> This warning has caught a bunch of genuine issues related to testing
> infrastructure and incorrectly coded firmware that have subsequently
> been rectified.
>
> Please don't hide this issue. Fix the root cause instead.
Please have a look at the actual code in the tree first. That patch was
applied by Jiri, yes, but IIRC it was dropped in a merge commit and is
not included in any trees AFAICT.
Cheers,
Benjamin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] HID: core: demote warning to debug level
2026-08-24 13:16 ` Benjamin Tissoires
@ 2026-08-24 14:22 ` Lee Jones
2026-08-24 15:02 ` Benjamin Tissoires
0 siblings, 1 reply; 10+ messages in thread
From: Lee Jones @ 2026-08-24 14:22 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Jiri Kosina, Matteo Croce, linux-input, linux-kernel,
Matteo Croce
On Mon, 24 Aug 2026, Benjamin Tissoires wrote:
> On Aug 24 2026, Lee Jones wrote:
> > On Wed, 10 Jun 2026, Jiri Kosina wrote:
> >
> > > On Sat, 23 May 2026, Matteo Croce wrote:
> > >
> > > > From: Matteo Croce <teknoraver@meta.com>
> > > >
> > > > The log level for short messages was changed from debug to warning,
> > > > flooding syslog on systems with devices that regularly send
> > > > short reports, in my case an UPS:
> > > >
> > > > $ dmesg |grep -c 'Event data for report .* was too short'
> > > > 35
> > > >
> > > > Demote it back to debug level.
> > > >
> > > > Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
> > > > Signed-off-by: Matteo Croce <teknoraver@meta.com>
> > >
> > > Applied, thanks.
> >
> > FWIW, I'd like to contest this patch.
> >
> > The warning is real. It means that the HID report was rejected and as
> > such something on the system will be now be non-functional. Silencing
> > the warning is not helpful. It does not fix the issue, and now the user
> > / admin has no idea that its even happening.
> >
> > This warning has caught a bunch of genuine issues related to testing
> > infrastructure and incorrectly coded firmware that have subsequently
> > been rectified.
> >
> > Please don't hide this issue. Fix the root cause instead.
>
> Please have a look at the actual code in the tree first. That patch was
> applied by Jiri, yes, but IIRC it was dropped in a merge commit and is
> not included in any trees AFAICT.
Sure, but there was an attempt to have it reapplied [0].
My plea goes out to both submissions.
[0] https://lore.kernel.org/all/aoF-jIn9gk9kJ7Pz@decadent.org.uk/
--
Lee Jones
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] HID: core: demote warning to debug level
2026-08-24 14:22 ` Lee Jones
@ 2026-08-24 15:02 ` Benjamin Tissoires
2026-08-24 20:16 ` Lee Jones
0 siblings, 1 reply; 10+ messages in thread
From: Benjamin Tissoires @ 2026-08-24 15:02 UTC (permalink / raw)
To: Lee Jones
Cc: Jiri Kosina, Matteo Croce, linux-input, linux-kernel,
Matteo Croce
On Aug 24 2026, Lee Jones wrote:
> On Mon, 24 Aug 2026, Benjamin Tissoires wrote:
>
> > On Aug 24 2026, Lee Jones wrote:
> > > On Wed, 10 Jun 2026, Jiri Kosina wrote:
> > >
> > > > On Sat, 23 May 2026, Matteo Croce wrote:
> > > >
> > > > > From: Matteo Croce <teknoraver@meta.com>
> > > > >
> > > > > The log level for short messages was changed from debug to warning,
> > > > > flooding syslog on systems with devices that regularly send
> > > > > short reports, in my case an UPS:
> > > > >
> > > > > $ dmesg |grep -c 'Event data for report .* was too short'
> > > > > 35
> > > > >
> > > > > Demote it back to debug level.
> > > > >
> > > > > Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
> > > > > Signed-off-by: Matteo Croce <teknoraver@meta.com>
> > > >
> > > > Applied, thanks.
> > >
> > > FWIW, I'd like to contest this patch.
> > >
> > > The warning is real. It means that the HID report was rejected and as
> > > such something on the system will be now be non-functional. Silencing
> > > the warning is not helpful. It does not fix the issue, and now the user
> > > / admin has no idea that its even happening.
> > >
> > > This warning has caught a bunch of genuine issues related to testing
> > > infrastructure and incorrectly coded firmware that have subsequently
> > > been rectified.
> > >
> > > Please don't hide this issue. Fix the root cause instead.
> >
> > Please have a look at the actual code in the tree first. That patch was
> > applied by Jiri, yes, but IIRC it was dropped in a merge commit and is
> > not included in any trees AFAICT.
>
> Sure, but there was an attempt to have it reapplied [0].
>
> My plea goes out to both submissions.
>
> [0] https://lore.kernel.org/all/aoF-jIn9gk9kJ7Pz@decadent.org.uk/
It would have been so much easier to reply to the bump instead of the
old original submission. The bump had all the references on the commit
shas where they were included and overwritten, which would have saved me
time.
FWIW, that bump doesn't show up in my public-inbox query, which is why I
did not saw it.
Cheers,
Benjamin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] HID: core: demote warning to debug level
2026-08-24 10:25 ` Lee Jones
2026-08-24 13:16 ` Benjamin Tissoires
@ 2026-08-24 18:29 ` Matteo Croce
2026-08-24 20:18 ` Lee Jones
2026-08-24 20:41 ` Benjamin Tissoires
1 sibling, 2 replies; 10+ messages in thread
From: Matteo Croce @ 2026-08-24 18:29 UTC (permalink / raw)
To: Lee Jones
Cc: Jiri Kosina, Benjamin Tissoires, linux-input, linux-kernel,
Matteo Croce
Il giorno lun 24 ago 2026 alle ore 12:25 Lee Jones <lee@kernel.org> ha scritto:
>
> On Wed, 10 Jun 2026, Jiri Kosina wrote:
>
> > On Sat, 23 May 2026, Matteo Croce wrote:
> >
> > > From: Matteo Croce <teknoraver@meta.com>
> > >
> > > The log level for short messages was changed from debug to warning,
> > > flooding syslog on systems with devices that regularly send
> > > short reports, in my case an UPS:
> > >
> > > $ dmesg |grep -c 'Event data for report .* was too short'
> > > 35
> > >
> > > Demote it back to debug level.
> > >
> > > Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
> > > Signed-off-by: Matteo Croce <teknoraver@meta.com>
> >
> > Applied, thanks.
>
> FWIW, I'd like to contest this patch.
>
> The warning is real. It means that the HID report was rejected and as
> such something on the system will be now be non-functional. Silencing
> the warning is not helpful. It does not fix the issue, and now the user
> / admin has no idea that its even happening.
>
> This warning has caught a bunch of genuine issues related to testing
> infrastructure and incorrectly coded firmware that have subsequently
> been rectified.
>
> Please don't hide this issue. Fix the root cause instead.
>
> --
> Lee Jones
Hi,
the message was debug long before and was promoted to warning during a refactor.
With my patch I just restored the previous priority.
Regards,
--
per aspera ad upstream
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] HID: core: demote warning to debug level
2026-08-24 15:02 ` Benjamin Tissoires
@ 2026-08-24 20:16 ` Lee Jones
0 siblings, 0 replies; 10+ messages in thread
From: Lee Jones @ 2026-08-24 20:16 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Jiri Kosina, Matteo Croce, linux-input, linux-kernel,
Matteo Croce
On Mon, 24 Aug 2026, Benjamin Tissoires wrote:
> On Aug 24 2026, Lee Jones wrote:
> > On Mon, 24 Aug 2026, Benjamin Tissoires wrote:
> >
> > > On Aug 24 2026, Lee Jones wrote:
> > > > On Wed, 10 Jun 2026, Jiri Kosina wrote:
> > > >
> > > > > On Sat, 23 May 2026, Matteo Croce wrote:
> > > > >
> > > > > > From: Matteo Croce <teknoraver@meta.com>
> > > > > >
> > > > > > The log level for short messages was changed from debug to warning,
> > > > > > flooding syslog on systems with devices that regularly send
> > > > > > short reports, in my case an UPS:
> > > > > >
> > > > > > $ dmesg |grep -c 'Event data for report .* was too short'
> > > > > > 35
> > > > > >
> > > > > > Demote it back to debug level.
> > > > > >
> > > > > > Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
> > > > > > Signed-off-by: Matteo Croce <teknoraver@meta.com>
> > > > >
> > > > > Applied, thanks.
> > > >
> > > > FWIW, I'd like to contest this patch.
> > > >
> > > > The warning is real. It means that the HID report was rejected and as
> > > > such something on the system will be now be non-functional. Silencing
> > > > the warning is not helpful. It does not fix the issue, and now the user
> > > > / admin has no idea that its even happening.
> > > >
> > > > This warning has caught a bunch of genuine issues related to testing
> > > > infrastructure and incorrectly coded firmware that have subsequently
> > > > been rectified.
> > > >
> > > > Please don't hide this issue. Fix the root cause instead.
> > >
> > > Please have a look at the actual code in the tree first. That patch was
> > > applied by Jiri, yes, but IIRC it was dropped in a merge commit and is
> > > not included in any trees AFAICT.
> >
> > Sure, but there was an attempt to have it reapplied [0].
> >
> > My plea goes out to both submissions.
> >
> > [0] https://lore.kernel.org/all/aoF-jIn9gk9kJ7Pz@decadent.org.uk/
>
> It would have been so much easier to reply to the bump instead of the
> old original submission. The bump had all the references on the commit
> shas where they were included and overwritten, which would have saved me
> time.
It was 50/50 and I chose the original patch.
The important thing is that the point was made.
Sorry if it took you the extra cycles to work it all out.
> FWIW, that bump doesn't show up in my public-inbox query, which is why I
> did not saw it.
--
Lee Jones
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] HID: core: demote warning to debug level
2026-08-24 18:29 ` Matteo Croce
@ 2026-08-24 20:18 ` Lee Jones
2026-08-24 20:41 ` Benjamin Tissoires
1 sibling, 0 replies; 10+ messages in thread
From: Lee Jones @ 2026-08-24 20:18 UTC (permalink / raw)
To: Matteo Croce
Cc: Jiri Kosina, Benjamin Tissoires, linux-input, linux-kernel,
Matteo Croce
On Mon, 24 Aug 2026, Matteo Croce wrote:
> Il giorno lun 24 ago 2026 alle ore 12:25 Lee Jones <lee@kernel.org> ha scritto:
> >
> > On Wed, 10 Jun 2026, Jiri Kosina wrote:
> >
> > > On Sat, 23 May 2026, Matteo Croce wrote:
> > >
> > > > From: Matteo Croce <teknoraver@meta.com>
> > > >
> > > > The log level for short messages was changed from debug to warning,
> > > > flooding syslog on systems with devices that regularly send
> > > > short reports, in my case an UPS:
> > > >
> > > > $ dmesg |grep -c 'Event data for report .* was too short'
> > > > 35
> > > >
> > > > Demote it back to debug level.
> > > >
> > > > Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
> > > > Signed-off-by: Matteo Croce <teknoraver@meta.com>
> > >
> > > Applied, thanks.
> >
> > FWIW, I'd like to contest this patch.
> >
> > The warning is real. It means that the HID report was rejected and as
> > such something on the system will be now be non-functional. Silencing
> > the warning is not helpful. It does not fix the issue, and now the user
> > / admin has no idea that its even happening.
> >
> > This warning has caught a bunch of genuine issues related to testing
> > infrastructure and incorrectly coded firmware that have subsequently
> > been rectified.
> >
> > Please don't hide this issue. Fix the root cause instead.
> >
> > --
> > Lee Jones
>
> Hi,
>
> the message was debug long before and was promoted to warning during a refactor.
> With my patch I just restored the previous priority.
Sure. I'm not contesting the logic.
My point still stands, however. IMHO this deserves warning status.
--
Lee Jones
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] HID: core: demote warning to debug level
2026-08-24 18:29 ` Matteo Croce
2026-08-24 20:18 ` Lee Jones
@ 2026-08-24 20:41 ` Benjamin Tissoires
1 sibling, 0 replies; 10+ messages in thread
From: Benjamin Tissoires @ 2026-08-24 20:41 UTC (permalink / raw)
To: Matteo Croce
Cc: Lee Jones, Jiri Kosina, linux-input, linux-kernel, Matteo Croce
On Aug 24 2026, Matteo Croce wrote:
> Il giorno lun 24 ago 2026 alle ore 12:25 Lee Jones <lee@kernel.org> ha scritto:
> >
> > On Wed, 10 Jun 2026, Jiri Kosina wrote:
> >
> > > On Sat, 23 May 2026, Matteo Croce wrote:
> > >
> > > > From: Matteo Croce <teknoraver@meta.com>
> > > >
> > > > The log level for short messages was changed from debug to warning,
> > > > flooding syslog on systems with devices that regularly send
> > > > short reports, in my case an UPS:
> > > >
> > > > $ dmesg |grep -c 'Event data for report .* was too short'
> > > > 35
> > > >
> > > > Demote it back to debug level.
> > > >
> > > > Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
> > > > Signed-off-by: Matteo Croce <teknoraver@meta.com>
> > >
> > > Applied, thanks.
> >
> > FWIW, I'd like to contest this patch.
> >
> > The warning is real. It means that the HID report was rejected and as
> > such something on the system will be now be non-functional. Silencing
> > the warning is not helpful. It does not fix the issue, and now the user
> > / admin has no idea that its even happening.
> >
> > This warning has caught a bunch of genuine issues related to testing
> > infrastructure and incorrectly coded firmware that have subsequently
> > been rectified.
> >
> > Please don't hide this issue. Fix the root cause instead.
> >
> > --
> > Lee Jones
>
> Hi,
>
> the message was debug long before and was promoted to warning during a refactor.
> With my patch I just restored the previous priority.
>
Sorry, but no. The new kernel code restored the old behavior: if the
incoming buffer is long enough but the incoming report has a shorter
size, we still have the dbg_hid() call, so it's transparent for users.
The hid_warns are now only emitted when there is an obvious error with
the report *that the kernel can not fix*.
So having this patch would do exactly what Lee said: this would prevent
users to understand why their device doesn't work.
This patch "fixed" a temporary wrong attempt at solving an OOB, the old
behavior is restored, we should not even have this type of arguments.
Cheers,
Benjamin
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-08-24 20:41 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-23 10:55 [PATCH v2] HID: core: demote warning to debug level Matteo Croce
2026-06-10 15:44 ` Jiri Kosina
2026-08-24 10:25 ` Lee Jones
2026-08-24 13:16 ` Benjamin Tissoires
2026-08-24 14:22 ` Lee Jones
2026-08-24 15:02 ` Benjamin Tissoires
2026-08-24 20:16 ` Lee Jones
2026-08-24 18:29 ` Matteo Croce
2026-08-24 20:18 ` Lee Jones
2026-08-24 20:41 ` Benjamin Tissoires
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox