From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 DC2613E6DC3 for ; Thu, 8 Oct 2026 07:55:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791446161; cv=none; b=YPjvjIjToOIk0ID0iG+QwHZVQ7lFFSm5z3uF/Dw7bPDzOGiWHUVKthTfEeH1asVdT/WmLOxuUzxzmT0N9zrXTT6js64EUcaprm+m6UvcxMg8VESJWI54OEwF4C+ESdmNoZP0dmtbwy4NEDpZTbP7dTSGfqjvAUU1nvfs6hrH7Yc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791446161; c=relaxed/simple; bh=1eLsAsBcb3/SU5wMEmlWmiLY4M5auQ2xVNRdqlqUs4c=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f4J9/q3W+/9oYnOLVyqvpVV9K/yEUp/L5iil/VIDMsKFXqQEYqfvuff1Ody3Umc5deGfCIiOLjNOHGBz8KjS7WqlQD+bsyLB0RxzH+n0sJliseogjj7KRznCogwnpds5AGK46X3bUs4GwPNHb1v2Z+yKnacUlBndPimHw8lhEvw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PPhLKAKL; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PPhLKAKL" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-48c02782159so1711731f8f.0 for ; Thu, 08 Oct 2026 00:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791446158; x=1792050958; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=RqJ80RZLGvdSDJWSa/30QB3K8CJAPo6KFuj937ftJzU=; b=PPhLKAKLe3Xj3jWLUOoBBNGiy5nU11Mdq8tEOP1WIqNd6b97t8C+0nqokWqG9J2cR2 KParJi47v2JiNiCIh0v7u5ANu5urcvf5ZsBEBWKjAeOu2zRcIE4mNfdSdZu2uQUXRCQh 1RWNVNHf36C7BhA781Ua1+oce37wOirjhHrtx1sItMEuPzLa6EI0neX+DO9L7ZPbW6xg BEj1zHerprEsF7mmOplUPasj817BHcBCeZ5sdlS3nMfdkNVqiJfJij9Px+SVohyig0k0 cgo2EPgilaS0Vv5alzeroYb0VoojSzPeuXAlIMKJ18EvRZKsDfgvDWeZEHDWJcN0S3r5 +jmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791446158; x=1792050958; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=RqJ80RZLGvdSDJWSa/30QB3K8CJAPo6KFuj937ftJzU=; b=xx7CEwJX7qq9LoqZ6CuoqhbGvNLCkEV70bWHKCcVwnvL/teo51oeurBUVjApeKN1Lu Hv/k9Pf0/BChhB9JtPAOKpDSwZxKw9JKB45W3j2WpSL6qIyPSAJgt0yDStAuQso+9YPH 39lN5e+tZ7MQjUIsT0ybGqR8YFWgrGWBjAQ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TFO/o79HqPX PHRo7F9CqtVCkJ6bFNk1rOSl+XOw0rP695BOEMXC2FArxccsisH3fkZnvNfHhnNLDdpVwoiGULl BIydH1tA== X-Received: by 2002:adf:ed4c:0:b0:487:1662:cf4c with SMTP id ffacd0b85a97d-48c72707d0fmr7555934f8f.7.1791446158003; Thu, 08 Oct 2026 00:55:58 -0700 (PDT) Received: from localhost (90-182-112-124.rcp.o2.cz. [90.182.112.124]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48c71d31767sm10344398f8f.51.2026.10.08.00.55.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2026 00:55:57 -0700 (PDT) Date: Thu, 8 Oct 2026 09:55:57 +0200 From: Joshua Crofts To: Christopher Hoover Cc: Jonathan Cameron , Jiri Kosina , Benjamin Tissoires , Srinivas Pandruvada , David Lechner , nuno.sa@analog.com, Andy Shevchenko , linux-iio@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/3] iio: hid-sensors: fix shared callbacks in temperature and humidity Message-ID: <20261008095557.0000617a@gmail.com> In-Reply-To: <20261007184423.622445-1-ch@murgatroid.com> References: <20261007072329.27806-1-ch@murgatroid.com> <20261007184423.622445-1-ch@murgatroid.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.51; x86_64-w64-mingw32) 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=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 7 Oct 2026 11:44:20 -0700 Christopher Hoover wrote: > hid-sensor-temperature and hid-sensor-humidity share one static > struct hid_sensor_hub_callbacks across instances and overwrite its pdev > on every probe. With two temperature sensors, reports for one go to > the other's pdev; once that device is removed, > temperature_capture_sample() dereferences NULL. I hit this on 7.0 > with two uhid-created sensors. > > Patches 2-3 make the callbacks per instance, as the other HID sensor > drivers do. Patch 1 makes sensor_hub_remove_callback() take > pdata->lock, as sensor_hub_raw_event() does, so a report racing an > unbind cannot call through the freed callbacks. > > Changes in v2: > - New patch 1, for the use-after-free on unbind found by the Sashiko > review of v1. > > Christopher Hoover (3): > HID: hid-sensor-hub: Synchronize callback removal with raw events > iio: temperature: hid-sensor-temperature: Use per-instance callbacks > iio: humidity: hid-sensor-humidity: Use per-instance callbacks > > drivers/hid/hid-sensor-hub.c | 12 ++++++++++-- > drivers/iio/humidity/hid-sensor-humidity.c | 12 +++++------- > drivers/iio/temperature/hid-sensor-temperature.c | 12 +++++------- > 3 files changed, 20 insertions(+), 16 deletions(-) > > > base-commit: 9ee8306121495d2a25aa5d1bfd519f2748786b83 Also for future reference, please don't send a new version as a reply to the previous version, it breaks tooling :( -- Kind regards, Joshua Crofts