From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBA3338E5C7 for ; Tue, 3 Mar 2026 09:36:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772530564; cv=none; b=GhHkzY8UTmrCOXMt8e5acjYEW0bJw3CuQ9B4CeNIixwh6MHE4ltjx8RThJGWDaEdyWK4tsg3dmNdEe37f4kwtIf2a5zFoRfnOMDOnD0uuZPwQxahRZMO5tCEqmBZ8TPTor1YC4D6w2D2Aq07TZdChB05i+PpoV+bJa6/g9sddaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772530564; c=relaxed/simple; bh=3eU9hNd8m5qr+U3hmvFaqItaVpUSdykad2J8ZLCwPlg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aEKrHCogBGBBhjqQx+9+UfrVW/7S9OwAmab+MszOJh6HmsGo3IIGvbwWihAyo2VaZ6gxiFpD03qFX5Sk6gVO5Me0RCJGqcmDOnKFZ8j8dbyO25oKLKnIPo3t/1X6AmWMTv60e7R/enYEWdSyDbEEz4plV+wLnEUqIe5d0tH9LUk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=JPjgrWlk; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="JPjgrWlk" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-439b611274bso1314531f8f.3 for ; Tue, 03 Mar 2026 01:36:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772530560; x=1773135360; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=fWlXK7iDL2mkLC3p31UigGL2w2fM43aTllKU01RV7mg=; b=JPjgrWlkkfeII10dScvQOuzQt9L9OwwuNKA8QBjlN3HFfvrMZB3UhTIQBBKpdzneq9 S9PjfYhjZ2gIdjCYSGzjg6VFvxnsUPj6aosM95kwBA5dmrJWZ3/pA/oKEbGTwiC7rkNV fhngThRTr7PNi0bfNQZGDgcaLdNOhDF0mU9aUhcwjnEvkhd1hyqQy6pyI3xYMPHz2E9W kEYBXOAHwnA6w9yN0fyNkXUuHA930GO/Nt3aUpi8tyNxojvHM/mc+6y73T2FOt8x/CLh 2PPOG2tFtMe5bAWvny+W2ljKluL8ZFDojZ3lzqc1uV3ryOoIf4VTqY1VlIF0mvmbA+/b Y4SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772530560; x=1773135360; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fWlXK7iDL2mkLC3p31UigGL2w2fM43aTllKU01RV7mg=; b=ueYJ0TNIOFt7xm4wQKSLChbSYa10RDT7O4dSpm/G1vthxAO6R57PHZaBRYS9+XDnOL 2vAyqQVFoW/QWhP+Ve8wHu5miiXgPwqZrj6Nk8KMnIxNL6n/pLdfeBBuIyY+yQauDmD1 XAQ21mzrn2GVYNbQxAclwuEt7MOENh4u6jKSR2412ttdU+jODPbfVL+Xai1uL0+7GZYf C/5Mj6LUHIqHhFMQAWaCYCC1h4PbtpeaObCNTlsv10yrOgt6nqT421inkvmUFMkPfJmL 2kwjKWPPL8AD8BJIDEVhi6DnJBVr8G6lry4+DmToTkR/BwSdD/1uW397bnmzrr07u5bd QKpQ== X-Forwarded-Encrypted: i=1; AJvYcCXpjQD0wBinDzQSrJMbakduzy4HL+HHA1PlMenvPToytJFU7AD/69XjGNt7wm2DlhuUF3gUZ/jcnrSOOdg=@vger.kernel.org X-Gm-Message-State: AOJu0YysWI8G8xzJoNDeA0rfBBU4HVlLhLgRP6Fb9aDtcwAAkLLs/0AX ++NULuMEyOxVsgR98uSp5oT41d0Ao8qLhpcgo0lC1U15Nh3Zw0gqBd86Zbd/7y4+gw== X-Gm-Gg: ATEYQzxsANPcciK1iHlzqhl7Of+87CWaJIW03RUkjDJGORPildS1UujJ8ry4zxN75LH WFS3maC+ogOSXdvQphQ/tfZDLD7hMHbwYUnKe4kqBArP9Pl6CHgbbfXJPeGGJeKYeIe476jaHgw YtsHp6/LVMmPfibzFQ5GQZp5hWkOK3VmPpi0xjqGqkvCaynZG4jVKHWUQ+PTaOILMFv9pFMpYiR aof+gn92h3ezj8MCSWvjizqrUSvSTZ1p+tco+NlSXzMiV+Uy39FXKnhE3f/GKKb2Su17vaXXvu3 HFVF/ZNScxeioSur+6DyveLG89tpy3NV/aqCuAS3HD0rBUURMSNnoDdnYCVgKsRtahxCLusBX3z SxXojKLN1Vz/gVkE/Xr4YTQH9gXd6+yzmscrSYUPD67V9wl+rN+T+zdh3UuBfPb97Y4QrNbsnw9 tUQcxOctic/17mFldhjQZGWkm4MyBmm35B6AVcKIFqjUkC4pRkyG6WtSMeoF/2yn8= X-Received: by 2002:a05:6000:25c6:b0:439:c14b:2100 with SMTP id ffacd0b85a97d-439c14b22d7mr2143817f8f.12.1772530559523; Tue, 03 Mar 2026 01:35:59 -0800 (PST) Received: from google.com ([2a00:79e0:288a:8:728e:497:b3ab:6c9f]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439c1fc577bsm2249223f8f.19.2026.03.03.01.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2026 01:35:58 -0800 (PST) Date: Tue, 3 Mar 2026 10:35:53 +0100 From: =?utf-8?Q?G=C3=BCnther?= Noack To: Lee Jones Cc: Filipe =?utf-8?B?TGHDrW5z?= , Bastien Nocera , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure Message-ID: References: <20260227100939.961011-1-lee@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260227100939.961011-1-lee@kernel.org> 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 > --- > 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 Thanks for the patch! —Günther