Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp815250lqb; Fri, 24 May 2024 14:24:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVw63zZsHghkAq6BbB3Hngll1S4rMYgtouTM/PHT+E4sFIUWfWowe8Pf45yx8vVZBGwejvt9ErxiwhsmYkpzXZQPtyDQAKvEKm6M/1W9g== X-Google-Smtp-Source: AGHT+IH2JRG+Zc0AxuO9seGg5+kkBKp3KP6puWv9PVY8SUI2LIdbq6AQkZ72u3E/A+UUNJq3MnJG X-Received: by 2002:a37:de0f:0:b0:793:72:cb1 with SMTP id af79cd13be357-794ab07abb0mr336127085a.17.1716585881260; Fri, 24 May 2024 14:24:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716585881; cv=pass; d=google.com; s=arc-20160816; b=iZbJGm1Isb83LpEg5f7AamhtvLwv+GzjX7zrQBiayxjyT6CeuqSdGTDJ8fN0GX6deh 5zfUczWmelNx7Y1XFnhY8oEunoVg/kMQni8hoLZPcqFZamBKi6ZNjYNnvc1lRyw/sXnA iFBTIbvJ/S6Wsw45lAQJ1Fx5HEcqZwImHYKYGEbW2lqX7Kop+me6SljxgN+yxg9VbQSh b2ta5wLhdp6d9KjCneADLsKbZOTJsAXCdX6lDE0VUyvqjY03ifdREcydwTrEPGRrJF4l 5Cll9Ud35iPf6xsELNGo6GMJoECANj4L94ojEaMzGxeBgTj30mvZGwh/EZsFN+ml6skd juwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=eK6rlcOU0J69xEkB/U5QpYB9YYPAvvGIcMGhJFJ9Io0=; fh=PxkaCFkW35KuNnMEK7vUJjNs9jjUKlAx+EwUg5d7cwU=; b=IarHVd1ltUVi44xVLfK1dbuPIjGl1GydC1WcWH3nv4Nw0v8bhWTy4KSNXHG1PkYtDQ rnj8lIKEPRexxhsFj+GuBf5pAJnd1r9Yl2qyDW/J5eOox5SuzrFXh9dBXWitySNlg2eW EDrlvCo+3YCGiy1fuFTF2F1Ofvl1vzhLGUKEkH2yyf8RTANFCcZYE1LwsQJnEA6wEsky 0Z+evDcIp/KvIfHprovTbhs71cE/ruirnX5N4ieZv+DqLPxA+qDU5chQdPB4fat5yeX5 n9UW6qksy9xMB4hgIU/wuBwflvQ02GCxZll/ToX/WpSc0dsqA0Nott2VHy5joXWwhy59 bygQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F6J1ClIK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-189143-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189143-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794abcabb2esi234843585a.117.2024.05.24.14.24.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 14:24:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189143-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F6J1ClIK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-189143-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189143-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F19FD1C20C34 for ; Fri, 24 May 2024 21:24:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 184D085640; Fri, 24 May 2024 21:24:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F6J1ClIK" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3567C29403; Fri, 24 May 2024 21:24:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716585874; cv=none; b=A7dyG3eQwYOf34gRO0cLJs2kro/L1zXPlN/2cnAcewFP8+6tbjhznJRFiYBP0guoAqzPT/QVDTv0MPcWGDqhezJJNPbigsjmGwdG+Xlv8z0HwSjW35t3FAqZf1fYke2sypJarIr9GjvlTaV1eZR6jU9ioganLrRDhVP4RnwHjfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716585874; c=relaxed/simple; bh=ZVPg8EMx0Yr6yPElmIUEkpUwH0oSsvKTxevOdlxBNxI=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=hGjJoxDDAwHD0L0O4BO2v2Xx5NXB0kmQ2rX8Jxvxbr68St37cSnCd3q7RzcYirGX45OCUvV/jnEc/3Ae+h1hqCs5hhXSONdcJmZP2wrGC090L4UBSORBojHOXo6rXoy5IKv/ZLIzIGxLhRdmAU9DHD0nrUafC3QMXnVSfiasDRU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F6J1ClIK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B325CC2BBFC; Fri, 24 May 2024 21:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716585874; bh=ZVPg8EMx0Yr6yPElmIUEkpUwH0oSsvKTxevOdlxBNxI=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=F6J1ClIK/S5O+G6GhHyDpJt5o5KL5E+VS3FheUVROo53UdlMEojNnYsSStUS+R9yw UC10CcHcy0pjGU+ivFhvQO4ikOXqQjNQzHipPspVJt3Z1wrImN5HYKu6xzR8xcAloy FMfZ6hF9CTEtrod8mQIi4T6qleSicQFYxkqtgkCkT6poqYTs2aWmMqXdh4vNOw8J3p cqzbYAZjCc2cjHtbc/O9LS9VPL4IuUih1ysCu0pEklQ0KScMHaVksP6hMQwe2u/uC6 Nzi/GBYWD2h6VWw05InFZsKFZYGEBEbGTojIrUBfB3EVYsgmVtfYNQ+dGTMkoZmHi7 Y7KKqD8fC2LCg== 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 Content-Type: text/plain; charset=UTF-8 Date: Sat, 25 May 2024 00:24:30 +0300 Message-Id: Cc: "david" , "oe-kbuild-all" , "linux-kernel" , "david oberhollenzer" Subject: Re: security/keys/trusted-keys/trusted_dcp.c:206:24: sparse: sparse: incorrect type in assignment (different base types) From: "Jarkko Sakkinen" To: "Richard Weinberger" , "kernel test robot" X-Mailer: aerc 0.17.0 References: <202405240610.fj53EK0q-lkp@intel.com> <1855855000.144805.1716584815663.JavaMail.zimbra@nod.at> In-Reply-To: <1855855000.144805.1716584815663.JavaMail.zimbra@nod.at> On Sat May 25, 2024 at 12:06 AM EEST, Richard Weinberger wrote: > >| Reported-by: kernel test robot > >| Closes: > >| https://lore.kernel.org/oe-kbuild-all/202405240610.fj53EK0q-lkp@intel.= com/ > >=20 > > sparse warnings: (new ones prefixed by >>) > >>> security/keys/trusted-keys/trusted_dcp.c:206:24: sparse: sparse: inco= rrect type > >>> in assignment (different base types) @@ expected restricted __le3= 2 > >>> [usertype] payload_len @@ got unsigned int @@ > > security/keys/trusted-keys/trusted_dcp.c:206:24: sparse: expected= restricted > > __le32 [usertype] payload_len > > security/keys/trusted-keys/trusted_dcp.c:206:24: sparse: got unsi= gned int > >=20 > > vim +206 security/keys/trusted-keys/trusted_dcp.c > >=20 > > 179 > > 180 static int trusted_dcp_seal(struct trusted_key_payload *p, char *= datablob) > > 181 { > > 182 struct dcp_blob_fmt *b =3D (struct dcp_blob_fmt *)p->blob; > > 183 int blen, ret; > > 184 > > 185 blen =3D calc_blob_len(p->key_len); > > 186 if (blen > MAX_BLOB_SIZE) > > 187 return -E2BIG; > > 188 > > 189 b->fmt_version =3D DCP_BLOB_VERSION; > > 190 get_random_bytes(b->nonce, AES_KEYSIZE_128); > > 191 get_random_bytes(b->blob_key, AES_KEYSIZE_128); > > 192 > > 193 ret =3D do_aead_crypto(p->key, b->payload, p->key_len, b->blob_k= ey, > > 194 b->nonce, true); > > 195 if (ret) { > > 196 pr_err("Unable to encrypt blob payload: %i\n", ret); > > 197 return ret; > > 198 } > > 199 > > 200 ret =3D encrypt_blob_key(b->blob_key); > > 201 if (ret) { > > 202 pr_err("Unable to encrypt blob key: %i\n", ret); > > 203 return ret; > > 204 } > > 205 > > > 206 b->payload_len =3D get_unaligned_le32(&p->key_len); > > I think this should be a put_unaligned_le32(p->key_len, &b->payload_len). Please send then fix, reasoning of that, and finally: Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202405240610.fj53EK0q-lkp@int= el.com/ > Thanks, > //richard BR, Jarkko