From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAE433AE198; Sat, 17 Oct 2026 17:08:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792256901; cv=none; b=lSRG5dbNdfwJduZXBwlseVjc5kijE7QmOhZMYech/wtLLNq+BNgf0gbdOcbITal2y1WmxF4QTJ/kuGiPzj83xEj+ynrt0yMMPP3o+kvu7dzI87C3z1ycEDQ/RVaqF+LQQDEhbCcFHoA0RrDB0VXleWfQVTpVxX5462QhWN6EoHQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792256901; c=relaxed/simple; bh=IHP0TJRH3xa+mL0RbNu8Ujq2c76jsehA06xUWZzUxCc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DdNbbEMcrapiSW5hWNc9GezH5umGivGeYyMMHcxCcmtHs881qHZ7E3Buc/cTICy6m0Yea9SEtUAEjrMhAsmTmCuOy7NINVNGhQL1iALjkEL0vKCG6BmStPzBJSLdvd9BmO9E//ey1TWGjJ0kJA3CstpP2DdFhpDSDQr0tXX/PLY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KT4EPD0r; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="KT4EPD0r" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37C381F000C4; Sat, 17 Oct 2026 17:08:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792256900; bh=uxzhabPhbR20S+zjGYpNRRzIP94l1I7g4ueTQoe3Ijo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KT4EPD0rX2jl7bfOCFYOm/sbTOT2q6qdPBM90lGmgT5wxA1cbOUd+LEqsPUzEp7AV BrzXZkEfbrpHvyI9WMwxIhDV6LlaoSUT/QjKqeONda+ghidFlWHvRM3Yl2akKzhxic OHdFPoGim29HOYzNaKETJSx/8/qIXNFAjlfBe0FM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Arka Mondal , Jonathan Cameron Subject: [PATCH 6.6 0345/1674] iio: imu: adis16400: fix unprotected debugfs reads Date: Sat, 17 Oct 2026 17:43:37 +0200 Message-ID: <20261017160439.985035238@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160431.119607952@linuxfoundation.org> References: <20261017160431.119607952@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arka Mondal commit d94787287a113a1326211647d5e0deed1e9de105 upstream. adis16400_serial_number_fops is open coded and never calls debugfs_file_get(), so debugfs_remove_recursive() does not wait for a read in progress and unbind frees the iio_dev underneath it. Commit ae1d37a9bb4b ("iio: imu: adis16400: use DEFINE_DEBUGFS_ATTRIBUTE instead of DEFINE_SIMPLE_ATTRIBUTE") converted product_id and flash_count to DEFINE_DEBUGFS_ATTRIBUTE, which protects itself, but moved all three files to debugfs_create_file_unsafe(). serial_number prints three registers as "%.4x-%.4x-%.4x" and DEFINE_DEBUGFS_ATTRIBUTE() formats a single u64, so it cannot be converted without changing what the file returns. adis16475 and adis16550 already use debugfs_create_file() for their open coded files. Use it here too. Fixes: ae1d37a9bb4b ("iio: imu: adis16400: use DEFINE_DEBUGFS_ATTRIBUTE instead of DEFINE_SIMPLE_ATTRIBUTE") Signed-off-by: Arka Mondal Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/imu/adis16400.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/imu/adis16400.c +++ b/drivers/iio/imu/adis16400.c @@ -279,7 +279,7 @@ static int adis16400_debugfs_init(struct struct dentry *d = iio_get_debugfs_dentry(indio_dev); if (st->variant->flags & ADIS16400_HAS_SERIAL_NUMBER) - debugfs_create_file_unsafe("serial_number", 0400, + debugfs_create_file("serial_number", 0400, d, st, &adis16400_serial_number_fops); if (st->variant->flags & ADIS16400_HAS_PROD_ID) debugfs_create_file_unsafe("product_id", 0400,