From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796374341; b=gfji3MRJJsbC+GnjWrHT6eT6P5nJ3HjA20TPDGJIWKsjuU7uPKGghl4E5lky/DkEykdl iDiInDofu77rsogvGkBiEGQUxjFZGs1l1p/x9dU1gy92qpQb9umaBKeRYT3IrswBS/tA6 2HJGI21w7EQNLcb5z/3mAzo1i8WGHSRHQOSS0Y7IIxdw/vEfko/I86R6GQt2rfuZmvmxz Xaj4y9t/igvVZw1c1V1un0Gsk+eOw2utm1QmfbpHvOFpoPySJtsHxG7tw/PZh0Cz6PLp3 wltNXXOoOCZ5nc1u1I+/lQ9vNzcVk5Jo/38EPZpMAf5h+a805yDv5VNKWJNLDWXC64Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796374341; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=yqvM4ZyovYgcHQ34AYXkfpNRo0dNM8Mu3F1R+grfZ0E=; b=DYxqd2Sd5tQDhnCuAx9wzSe0U0fcA14A3OkEHvn5BRKwlGQ/N/A2IxjsGhAvzG/jSlGO wzkthfFQBBzB1I7iQSHMlb6SXR1vuVdKpy+7GNGqIeCy7MTQJodrczDYGyXcMTC/aiqM+ ZkbDqNM7NzwLIFgQx93dzXbK6IO9ZJhtURX13y2a07EfeJEVyk3p2Q67yAC4wMhbrtXWV Dg/FnnCdrVNKjkl1u65xckhwB7GeUEdWaCAAiYpRAlZH+nIv+IsUTVQb7lXr5D1wBQGkI r3xicTb9bfkDKA2iXNnhZZYL5nMvzd0rf8Ji0TQMqTzg8P9mJvojMQlaC6Aef8LqHLg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Gw0r8nIr; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEFDC606A32D; Fri, 4 Dec 2026 08:52:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Gw0r8nIr Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7D751F00897; Fri, 4 Dec 2026 08:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796374341; bh=yqvM4ZyovYgcHQ34AYXkfpNRo0dNM8Mu3F1R+grfZ0E=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Gw0r8nIrXcd5pSi9SNWPVkS19dI4IMRrIa6RqZy+XPjeUpqgxAWbMpyt/9QzMlFaa cvcreoQYlHH7esS+to1KAFZiMgt1BOVV0y+b/AnkU71X+qZcFUgbqplf55LkeaHMLU GXMWsn7w0+7iZ3uFR3L5P7MsI4XXxJOAaq96UulPgzsEiY3YQqZUsx+kYVxmG6HdOl nwP76Zo8wSoapgI82DgELztEg7WjKbI88UkRsMi7hiUKcsMI5XeO59ErK616LijY35 LBhmrKVRGGXjWvFMMXyjPRBEtZgYt7zghMScEhq1nEsDMVvaOIiqNi81+VR5TPJA+P ppZ/ScvtgKJ0w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 4/4] crypto: asymmetric_keys - Print the correct offset in a debug message Reply-To: sashiko-reviews@lists.linux.dev To: "Dan Carpenter" , "Lukas Wunner" , "Ignat Korchagin" , "Herbert Xu" , "David S. Miller" , "Joy Latten" , "David Howells" , "Robbie Harwood" , "Vivek Goyal" Cc: "Karthik Bhargavan" , =?utf-8?b?Q2zDqW1lbnQgQmxh?= =?utf-8?b?dWRlYXU=?= , linux-crypto@vger.kernel.org, keyrings@vger.kernel.org In-Reply-To: <20261204-crypto_trivial-v1-4-9e0865f6d9ff@pereq.eu> References: <20261204-crypto_trivial-v1-0-9e0865f6d9ff@pereq.eu> <20261204-crypto_trivial-v1-4-9e0865f6d9ff@pereq.eu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 08:52:20 +0000 X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] crypto: off-by-hdrlen debug offset in pkcs7_extract_cert() -- commit f0faf0419a12880593a89a85374f99bb1edc3463 Author: Dan Carpenter crypto: asymmetric_keys - Print the correct offset in a debug message This commit updates a pr_debug() call in pkcs7_extract_cert() to compute the logged offset from value instead of ctx. > diff --git a/crypto/asymmetric_keys/pkcs7_parser.c b/crypto/asymmetric_ke= ys/pkcs7_parser.c > index 7f00e45a33cf6..c5dd638a50fe4 100644 > --- a/crypto/asymmetric_keys/pkcs7_parser.c > +++ b/crypto/asymmetric_keys/pkcs7_parser.c > @@ -445,7 +445,7 @@ int pkcs7_extract_cert(void *context, size_t hdrlen, > =20 > if (tag !=3D ((ASN1_UNIV << 6) | ASN1_CONS_BIT | ASN1_SEQ)) { > pr_debug("Cert began with tag %02x at %lu\n", > - tag, (unsigned long)ctx - ctx->data); > + tag, (unsigned long)value - ctx->data); > return -EBADMSG; > } [Severity: Low] Should this subtract hdrlen from value when computing the offset? asn1_ber_decoder() advances past the tag and length header before invoking the action, so value points to the payload rather than the tag byte, as shown right below where value is adjusted by hdrlen for x509_cert_parse(). The debug message therefore logs an offset hdrlen bytes past the tag. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-crypto_tri= vial-v1-0-9e0865f6d9ff@pereq.eu?part=3D4