From nobody Sat Feb 7 11:31:37 2026 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) (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 3C8B933290B for ; Mon, 5 Jan 2026 12:24:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767615888; cv=none; b=pgGEgSLoHrOE5XKTgEckz3ixIoZ5hL+ELMps3OVqjTepFRxb81eFRwKH8AFnLyn4c0e3Ul/a1Ys/pgLfIfpWG1bDOeZhkFRqoBIdTuFxlZv3jOtM8jyGeTY2oPIp83kdI2y42tOizEsKemm2y+1o3UYSxsz494N8CTl1eGWHTHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767615888; c=relaxed/simple; bh=oZ5AzMH/4SQ2rr8CO+UbA1/Z7dMNLzHqH4V5aDT8458=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Uudo5CatrzILAcweN3lJeAUHFeNrAWB7pAkPjKbwJfGV4GuMopoHxXPUPELnB+8bj3v50ATf+UPSp08VytmdoiM5NhKtiB4lqSLEWBfAsYygsQzMxH5XtoalPjxpGP4jiiCdLFWBSdXnSqVPzzDV6gOhRmkyRP3taG+r6FSDrRo= 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=ghmWoHUm; arc=none smtp.client-ip=95.215.58.182 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="ghmWoHUm" 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=1767615884; 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=w9gywOqf/A5KnJyxaaxeyqq24z/FBCXUgwq/3X0oLRE=; b=ghmWoHUmLLRU82B/witACEEheBIaSQpJbp356ROJclvS7Fhy8vzlasRCKOafTgMUsBKK8G 2KID2wGrFPQZRWtIWGml4Rt+5Wrzf4vaBF3KssCq/hoKzVJdCw1eEl2HbkhbHHeLh4NgW3 RQdxafOUeGISE52AsKW0b64nQCgt4d4= From: Thorsten Blum To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Kees Cook , "Gustavo A. R. Silva" Cc: Thorsten Blum , Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH RESEND] crypto: af_alg - Annotate struct af_alg_iv with __counted_by Date: Mon, 5 Jan 2026 13:24:03 +0100 Message-ID: <20260105122402.2685-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Add the __counted_by() compiler attribute to the flexible array member 'iv' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Reviewed-by: Simon Horman Signed-off-by: Thorsten Blum --- include/uapi/linux/if_alg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/if_alg.h b/include/uapi/linux/if_alg.h index b35871cbeed7..4f51e198ac2e 100644 --- a/include/uapi/linux/if_alg.h +++ b/include/uapi/linux/if_alg.h @@ -42,7 +42,7 @@ struct sockaddr_alg_new { =20 struct af_alg_iv { __u32 ivlen; - __u8 iv[]; + __u8 iv[] __counted_by(ivlen); }; =20 /* Socket options */ --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4