From nobody Wed Jun 17 06:02:51 2026 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) (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 054EF321F2D for ; Thu, 11 Jun 2026 21:55:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781214958; cv=none; b=nK2h2r/ZQR1riyXyiKVCOQXPwX92cpeGHLV7Nbfm0bmTgYuuTJiLyeaM0P+GkXoVfWfqF33VVoKc76V4h4/gO0FiqkhiAcceMbXLEeK2vjFWEyKGLE46w3fm81QnVdqfnDjGMPMZSEPb9s6gbKmvxlBKR+r7pDYgneyQPXwVj2I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781214958; c=relaxed/simple; bh=D5piSNa/XD7Ir3Er9XoL6m4fTNi2IcT2btEYZrAM68s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=METbHGviyqJXr46IHrR2YhsDZBm66+aDN9GFwBkxRAnXpjODk2l2h2Qwcwc9Jq6JLL4GOHQgfrJPAFIHVDv5jK/t2fLNtQsGLNiOBwTm7vYNt/VMzT6XzyxHjUelWBLkZFDPQlkUs/vLSNr4AWact99w5TkiIiLGYh+LvtrDQE0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=MTNuYHFV; arc=none smtp.client-ip=91.218.175.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="MTNuYHFV" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781214941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=FDcpN3Rzl0QyU5jzjG6FOrj+H6SLg2mf0yYuFNo/SCc=; b=MTNuYHFVszEvVueH1qZgONioyu+YIhcF8kDu28CO04/nH3dj9o1iyNedXd+0o6HFKObi+r d6UKiHbw/P6xK878NeeG1sRKmjT3tbPIXcM2ESFbKATgrG7vO1np6GzqXkaV2hc+qCCGtA cAUd1IXAKja1OlVzqJyQbGsk7kk9/Ag= From: Thorsten Blum To: Tomi Valkeinen , Luca Ceresoli , Kees Cook , "Gustavo A. R. Silva" Cc: Thorsten Blum , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH RESEND] i2c: atr: annotate i2c_atr_adap_desc->aliases with __counted_by_ptr Date: Thu, 11 Jun 2026 23:55:02 +0200 Message-ID: <20260611215501.464405-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=718; i=thorsten.blum@linux.dev; h=from:subject; bh=D5piSNa/XD7Ir3Er9XoL6m4fTNi2IcT2btEYZrAM68s=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFnaelsFSn0NZ7tMP/fv8UlBhgC7aFPNhPuVT+90nWSOz Xgx8cDkjlIWBjEuBlkxRZYHs37M8C2tqdxkErETZg4rE8gQBi5OAZhI6z6G/zkee7vv7D51YVb/ 2tAYtqka95IkzY/+VvZbVPre0m3LgdcM/5QTM5bN3d75+EyLQbnFxilNDBPPpYt22XivmBsepqv 9nQsA X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Add the __counted_by_ptr() compiler attribute to ->aliases to improve bounds checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Reviewed-by: Luca Ceresoli Signed-off-by: Thorsten Blum --- include/linux/i2c-atr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/i2c-atr.h b/include/linux/i2c-atr.h index 2bb54dc87c8e..b52a7b9ec536 100644 --- a/include/linux/i2c-atr.h +++ b/include/linux/i2c-atr.h @@ -71,7 +71,7 @@ struct i2c_atr_adap_desc { struct device *parent; struct fwnode_handle *bus_handle; size_t num_aliases; - u16 *aliases; + u16 *aliases __counted_by_ptr(num_aliases); }; =20 /**