public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure
@ 2026-02-27 10:09 Lee Jones
  2026-03-03  9:35 ` Günther Noack
  2026-03-16 15:59 ` (subset) " Benjamin Tissoires
  0 siblings, 2 replies; 6+ messages in thread
From: Lee Jones @ 2026-02-27 10:09 UTC (permalink / raw)
  To: lee, Filipe Laíns, Bastien Nocera, Jiri Kosina,
	Benjamin Tissoires, linux-input, linux-kernel

Presently, if the force feedback initialisation fails when probing the
Logitech G920 Driving Force Racing Wheel for Xbox One, an error number
will be returned and propagated before the userspace infrastructure
(sysfs and /dev/input) has been torn down.  If userspace ignores the
errors and continues to use its references to these dangling entities, a
UAF will promptly follow.

We have 2 options; continue to return the error, but ensure that all of
the infrastructure is torn down accordingly or continue to treat this
condition as a warning by emitting the message but returning success.
It is thought that the original author's intention was to emit the
warning but keep the device functional, less the force feedback feature,
so let's go with that.

Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/hid/hid-logitech-hidpp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index e871f1729d4b..eee9ab6a2fc4 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -4487,10 +4487,12 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		if (!ret)
 			ret = hidpp_ff_init(hidpp, &data);
 
-		if (ret)
+		if (ret) {
 			hid_warn(hidpp->hid_dev,
 		     "Unable to initialize force feedback support, errno %d\n",
 				 ret);
+			ret = 0;
+		}
 	}
 
 	/*
-- 
2.53.0.473.g4a7958ca14-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure
  2026-02-27 10:09 [PATCH 1/1] HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure Lee Jones
@ 2026-03-03  9:35 ` Günther Noack
  2026-03-16 15:11   ` Lee Jones
  2026-03-16 15:59 ` (subset) " Benjamin Tissoires
  1 sibling, 1 reply; 6+ messages in thread
From: Günther Noack @ 2026-03-03  9:35 UTC (permalink / raw)
  To: Lee Jones
  Cc: Filipe Laíns, Bastien Nocera, Jiri Kosina,
	Benjamin Tissoires, linux-input, linux-kernel

On Fri, Feb 27, 2026 at 10:09:38AM +0000, Lee Jones wrote:
> Presently, if the force feedback initialisation fails when probing the
> Logitech G920 Driving Force Racing Wheel for Xbox One, an error number
> will be returned and propagated before the userspace infrastructure
> (sysfs and /dev/input) has been torn down.  If userspace ignores the
> errors and continues to use its references to these dangling entities, a
> UAF will promptly follow.
> 
> We have 2 options; continue to return the error, but ensure that all of
> the infrastructure is torn down accordingly or continue to treat this
> condition as a warning by emitting the message but returning success.
> It is thought that the original author's intention was to emit the
> warning but keep the device functional, less the force feedback feature,
> so let's go with that.
> 
> Signed-off-by: Lee Jones <lee@kernel.org>
> ---
>  drivers/hid/hid-logitech-hidpp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
> index e871f1729d4b..eee9ab6a2fc4 100644
> --- a/drivers/hid/hid-logitech-hidpp.c
> +++ b/drivers/hid/hid-logitech-hidpp.c
> @@ -4487,10 +4487,12 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
>  		if (!ret)
>  			ret = hidpp_ff_init(hidpp, &data);
>  
> -		if (ret)
> +		if (ret) {
>  			hid_warn(hidpp->hid_dev,
>  		     "Unable to initialize force feedback support, errno %d\n",
>  				 ret);
> +			ret = 0;
> +		}
>  	}
>  
>  	/*
> -- 
> 2.53.0.473.g4a7958ca14-goog
> 

Reviewed-by: Günther Noack <gnoack@google.com>

Thanks for the patch!
—Günther

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure
  2026-03-03  9:35 ` Günther Noack
@ 2026-03-16 15:11   ` Lee Jones
  2026-03-16 15:30     ` Benjamin Tissoires
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Jones @ 2026-03-16 15:11 UTC (permalink / raw)
  To: Günther Noack
  Cc: Filipe Laíns, Bastien Nocera, Jiri Kosina,
	Benjamin Tissoires, linux-input, linux-kernel

On Tue, 03 Mar 2026, Günther Noack wrote:

> On Fri, Feb 27, 2026 at 10:09:38AM +0000, Lee Jones wrote:
> > Presently, if the force feedback initialisation fails when probing the
> > Logitech G920 Driving Force Racing Wheel for Xbox One, an error number
> > will be returned and propagated before the userspace infrastructure
> > (sysfs and /dev/input) has been torn down.  If userspace ignores the
> > errors and continues to use its references to these dangling entities, a
> > UAF will promptly follow.
> > 
> > We have 2 options; continue to return the error, but ensure that all of
> > the infrastructure is torn down accordingly or continue to treat this
> > condition as a warning by emitting the message but returning success.
> > It is thought that the original author's intention was to emit the
> > warning but keep the device functional, less the force feedback feature,
> > so let's go with that.
> > 
> > Signed-off-by: Lee Jones <lee@kernel.org>
> > ---
> >  drivers/hid/hid-logitech-hidpp.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
> > index e871f1729d4b..eee9ab6a2fc4 100644
> > --- a/drivers/hid/hid-logitech-hidpp.c
> > +++ b/drivers/hid/hid-logitech-hidpp.c
> > @@ -4487,10 +4487,12 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
> >  		if (!ret)
> >  			ret = hidpp_ff_init(hidpp, &data);
> >  
> > -		if (ret)
> > +		if (ret) {
> >  			hid_warn(hidpp->hid_dev,
> >  		     "Unable to initialize force feedback support, errno %d\n",
> >  				 ret);
> > +			ret = 0;
> > +		}
> >  	}
> >  
> >  	/*
> > -- 
> > 2.53.0.473.g4a7958ca14-goog
> > 
> 
> Reviewed-by: Günther Noack <gnoack@google.com>

What are the subsystem preferences in terms of pokes or [RESENDS], please?

I'm happy to submit a [RESEND] if that's required to get this back into view.

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure
  2026-03-16 15:11   ` Lee Jones
@ 2026-03-16 15:30     ` Benjamin Tissoires
  2026-03-17  9:17       ` Lee Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Tissoires @ 2026-03-16 15:30 UTC (permalink / raw)
  To: Lee Jones
  Cc: Günther Noack, Filipe Laíns, Bastien Nocera,
	Jiri Kosina, linux-input, linux-kernel

On Mar 16 2026, Lee Jones wrote:
> On Tue, 03 Mar 2026, Günther Noack wrote:
> 
> > On Fri, Feb 27, 2026 at 10:09:38AM +0000, Lee Jones wrote:
> > > Presently, if the force feedback initialisation fails when probing the
> > > Logitech G920 Driving Force Racing Wheel for Xbox One, an error number
> > > will be returned and propagated before the userspace infrastructure
> > > (sysfs and /dev/input) has been torn down.  If userspace ignores the
> > > errors and continues to use its references to these dangling entities, a
> > > UAF will promptly follow.
> > > 
> > > We have 2 options; continue to return the error, but ensure that all of
> > > the infrastructure is torn down accordingly or continue to treat this
> > > condition as a warning by emitting the message but returning success.
> > > It is thought that the original author's intention was to emit the
> > > warning but keep the device functional, less the force feedback feature,
> > > so let's go with that.
> > > 
> > > Signed-off-by: Lee Jones <lee@kernel.org>
> > > ---
> > >  drivers/hid/hid-logitech-hidpp.c | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
> > > index e871f1729d4b..eee9ab6a2fc4 100644
> > > --- a/drivers/hid/hid-logitech-hidpp.c
> > > +++ b/drivers/hid/hid-logitech-hidpp.c
> > > @@ -4487,10 +4487,12 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
> > >  		if (!ret)
> > >  			ret = hidpp_ff_init(hidpp, &data);
> > >  
> > > -		if (ret)
> > > +		if (ret) {
> > >  			hid_warn(hidpp->hid_dev,
> > >  		     "Unable to initialize force feedback support, errno %d\n",
> > >  				 ret);
> > > +			ret = 0;
> > > +		}
> > >  	}
> > >  
> > >  	/*
> > > -- 
> > > 2.53.0.473.g4a7958ca14-goog
> > > 
> > 
> > Reviewed-by: Günther Noack <gnoack@google.com>
> 
> What are the subsystem preferences in terms of pokes or [RESENDS], please?

Just send a gently ping like this on the thread, this will make it pop
up in our mailboxes :)

> 
> I'm happy to submit a [RESEND] if that's required to get this back into view.

Nah, no need to send a [RESEND] when the patch is just a couple of weeks
old.

Cheers,
Benjamin

> 
> -- 
> Lee Jones [李琼斯]
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: (subset) [PATCH 1/1] HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure
  2026-02-27 10:09 [PATCH 1/1] HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure Lee Jones
  2026-03-03  9:35 ` Günther Noack
@ 2026-03-16 15:59 ` Benjamin Tissoires
  1 sibling, 0 replies; 6+ messages in thread
From: Benjamin Tissoires @ 2026-03-16 15:59 UTC (permalink / raw)
  To: Filipe Laíns, Bastien Nocera, Jiri Kosina, linux-input,
	linux-kernel, Lee Jones


On Fri, 27 Feb 2026 10:09:38 +0000, Lee Jones wrote:
> Presently, if the force feedback initialisation fails when probing the
> Logitech G920 Driving Force Racing Wheel for Xbox One, an error number
> will be returned and propagated before the userspace infrastructure
> (sysfs and /dev/input) has been torn down.  If userspace ignores the
> errors and continues to use its references to these dangling entities, a
> UAF will promptly follow.
> 
> [...]

Applied, thanks!

[1/1] HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure
      commit: f7a4c78bfeb320299c1b641500fe7761eadbd101

Best regards,
-- 
Benjamin Tissoires <bentiss@kernel.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure
  2026-03-16 15:30     ` Benjamin Tissoires
@ 2026-03-17  9:17       ` Lee Jones
  0 siblings, 0 replies; 6+ messages in thread
From: Lee Jones @ 2026-03-17  9:17 UTC (permalink / raw)
  To: Benjamin Tissoires
  Cc: Günther Noack, Filipe Laíns, Bastien Nocera,
	Jiri Kosina, linux-input, linux-kernel

On Mon, 16 Mar 2026, Benjamin Tissoires wrote:

> On Mar 16 2026, Lee Jones wrote:
> > On Tue, 03 Mar 2026, Günther Noack wrote:
> > 
> > > On Fri, Feb 27, 2026 at 10:09:38AM +0000, Lee Jones wrote:
> > > > Presently, if the force feedback initialisation fails when probing the
> > > > Logitech G920 Driving Force Racing Wheel for Xbox One, an error number
> > > > will be returned and propagated before the userspace infrastructure
> > > > (sysfs and /dev/input) has been torn down.  If userspace ignores the
> > > > errors and continues to use its references to these dangling entities, a
> > > > UAF will promptly follow.
> > > > 
> > > > We have 2 options; continue to return the error, but ensure that all of
> > > > the infrastructure is torn down accordingly or continue to treat this
> > > > condition as a warning by emitting the message but returning success.
> > > > It is thought that the original author's intention was to emit the
> > > > warning but keep the device functional, less the force feedback feature,
> > > > so let's go with that.
> > > > 
> > > > Signed-off-by: Lee Jones <lee@kernel.org>
> > > > ---
> > > >  drivers/hid/hid-logitech-hidpp.c | 4 +++-
> > > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
> > > > index e871f1729d4b..eee9ab6a2fc4 100644
> > > > --- a/drivers/hid/hid-logitech-hidpp.c
> > > > +++ b/drivers/hid/hid-logitech-hidpp.c
> > > > @@ -4487,10 +4487,12 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
> > > >  		if (!ret)
> > > >  			ret = hidpp_ff_init(hidpp, &data);
> > > >  
> > > > -		if (ret)
> > > > +		if (ret) {
> > > >  			hid_warn(hidpp->hid_dev,
> > > >  		     "Unable to initialize force feedback support, errno %d\n",
> > > >  				 ret);
> > > > +			ret = 0;
> > > > +		}
> > > >  	}
> > > >  
> > > >  	/*
> > > > -- 
> > > > 2.53.0.473.g4a7958ca14-goog
> > > > 
> > > 
> > > Reviewed-by: Günther Noack <gnoack@google.com>
> > 
> > What are the subsystem preferences in terms of pokes or [RESENDS], please?
> 
> Just send a gently ping like this on the thread, this will make it pop
> up in our mailboxes :)
> 
> > 
> > I'm happy to submit a [RESEND] if that's required to get this back into view.
> 
> Nah, no need to send a [RESEND] when the patch is just a couple of weeks
> old.

Understood, thank you.

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-17  9:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 10:09 [PATCH 1/1] HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure Lee Jones
2026-03-03  9:35 ` Günther Noack
2026-03-16 15:11   ` Lee Jones
2026-03-16 15:30     ` Benjamin Tissoires
2026-03-17  9:17       ` Lee Jones
2026-03-16 15:59 ` (subset) " Benjamin Tissoires

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox