Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp808949lqb; Fri, 24 May 2024 14:07:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXj2dyP5LgZvmYRwTg7y3gfcLmbqrIe60qdH2NuiI0MykgutHPHzurfk3Pw6mklTx/B9c+iGDI9INQgHl2tocj8CMGqJqS3twRh6Zpf4Q== X-Google-Smtp-Source: AGHT+IHyMiqap8Pi7uncbpppbSkIXTyjKnfeSCks1bHW+9uwZb+cIIu2CC5TQVhKYY4YE0clJKT6 X-Received: by 2002:a05:6e02:20ef:b0:371:ee30:e5ed with SMTP id e9e14a558f8ab-3737b3a355fmr38645585ab.28.1716584860377; Fri, 24 May 2024 14:07:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716584860; cv=pass; d=google.com; s=arc-20160816; b=zHFtnW0RhHoSns7qkUxRKUrO+VLmgnJJy6R2zod5kFwbGhUqRn7vpxgOht4ahgIr2O u1HKtCvdaVAh9+Hb9K9vKwsMrjXR2klfYHVJrWSce+O1/uqOSlZp1DKq62G74m2OMkfL zcwjH5jDZK3mtHLcgEb+Ylm/f/s8jdGfeZFLxw4YTxiRkOsMSUfgqdKENHV2+uUzJ5jn PxfzHZoxJbYvvqUmi+9GiuyTYDwbqD/ibmWLpROOiSTLdVpfUjMDjyOB/7ZXpD+BM9gr pWJ5roSUR4v/asuG9RUKGNOc9icjYy4DD2MkUN8ExI+rNBCZG2RuoGwMxwQI4zZAmtgO A08g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=thread-index:thread-topic:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject :references:in-reply-to:message-id:cc:to:from:date; bh=G7xjldqLvzRYVLgeJq2LlnHlKpOa1cfOgaseHu+drDU=; fh=shZOppHJSLf9f+U2Vwh2F3LZGttAXUI+2iPksyqtX3E=; b=P5Yf8S9zp6ySgfyFGtPKRRhEWjTzl/LS9dNo4VUjvh9LZE2YH5F5dQy0hd8jYAxh73 MkRxG3hz8gxSpl34MbEDRO3PI/AHmpNJnEQLequQ6sbC4JBtkrYl6Al9MqEkg8fYO/86 8TClpqnzUP2FyEdsD7076n0tc5syjebIA7JDr1uflGq6iVDYC3xkrs14LUZ0zfHj9+aN tfVAt11jh0CFQG3QcEwOPZmW9U6HRIY7F907wnoxXPVhAqmBfiWF2pUdM5yAoKUFld/b fKMhnUwJkhOzH//z2oTNhvCuratP2TIhWvkcjU6D3DA5CHbMjjG1wGh2zt98dHbUvKb2 OzvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-189136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189136-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-682299340e9si1815443a12.596.2024.05.24.14.07.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 14:07:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-189136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189136-linux.lists.archive=gmail.com@vger.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5FBB8B21BD6 for ; Fri, 24 May 2024 21:07:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06CFE85264; Fri, 24 May 2024 21:07:03 +0000 (UTC) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) (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 EC17381736 for ; Fri, 24 May 2024 21:06:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.201.40.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716584822; cv=none; b=ma51TinZbZ5jTFqRlOqh3nlQtzGyUDrhmOes7uPGNlk48KA42wJLRAhZb7k/QdvKQ4iEveuj8QCSMNoK2Bnnoe1lgv7jaSEKsvCmIudTm95QgFnvCBnaln6bK/mIkC/4udbWCm1LkOPtq2+cHlt+aVoKQ78GOcjr9VDXQ4nNL8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716584822; c=relaxed/simple; bh=Sz6ZUVRXx17p9MUniuhApiR8QthQCg38UlEL+WVHPBM=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=TEVHO9KvEwWNsWrrhG2uDvd00Gh58plbg9PJ30co0ippe30tigxe3ejqJr1oMx+/oRWiiohoh2YOu+kQ5ocFB61RBj7k/JlIQJ5M+6PQNcp4TObSOGKyIj3hyUNfCdIC2VxVeSBK3h+oZuXt2iSNXUxmvs7IEffj8Fi9enPFHds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nod.at; spf=fail smtp.mailfrom=nod.at; arc=none smtp.client-ip=195.201.40.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nod.at Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nod.at Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id A555962348A5; Fri, 24 May 2024 23:06:56 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id TY85XimMHdoO; Fri, 24 May 2024 23:06:56 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id EEDA96195FD9; Fri, 24 May 2024 23:06:55 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hq2mlyIH99_G; Fri, 24 May 2024 23:06:55 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id CD1CE6195FCC; Fri, 24 May 2024 23:06:55 +0200 (CEST) Date: Fri, 24 May 2024 23:06:55 +0200 (CEST) From: Richard Weinberger To: kernel test robot Cc: david , oe-kbuild-all , linux-kernel , Jarkko Sakkinen , david oberhollenzer Message-ID: <1855855000.144805.1716584815663.JavaMail.zimbra@nod.at> In-Reply-To: <202405240610.fj53EK0q-lkp@intel.com> References: <202405240610.fj53EK0q-lkp@intel.com> Subject: Re: security/keys/trusted-keys/trusted_dcp.c:206:24: sparse: sparse: incorrect type in assignment (different base types) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF97 (Linux)/8.8.12_GA_3809) Thread-Topic: security/keys/trusted-keys/trusted_dcp.c:206:24: sparse: sparse: incorrect type in assignment (different base types) Thread-Index: CtnofoC0Fpa85+mbFcGqHZ2NTw79OQ== ----- Urspr=C3=BCngliche Mail ----- > Von: "kernel test robot" > An: "david" > CC: "oe-kbuild-all" , "linux-kernel" , "Jarkko Sakkinen" > , "richard" , "david oberhollenzer" > Gesendet: Freitag, 24. Mai 2024 00:48:26 > Betreff: security/keys/trusted-keys/trusted_dcp.c:206:24: sparse: sparse:= incorrect type in assignment (different base > types) > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi= t > master > head: 6d69b6c12fce479fde7bc06f686212451688a102 > commit: 2e8a0f40a39cc253002f21c54e1b5b995e5ec510 KEYS: trusted: Introduce= NXP > DCP-backed trusted keys > date: 2 weeks ago > config: arm-randconfig-r112-20240524 > (https://download.01.org/0day-ci/archive/20240524/202405240610.fj53EK0q-l= kp@intel.com/config) > compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0 > reproduce: > (https://download.01.org/0day-ci/archive/20240524/202405240610.fj53EK0q-l= kp@intel.com/reproduce) >=20 > If you fix the issue in a separate patch/commit (i.e. not just a new vers= ion of > the same patch/commit), kindly add following tags >| Reported-by: kernel test robot >| Closes: >| https://lore.kernel.org/oe-kbuild-all/202405240610.fj53EK0q-lkp@intel.co= m/ >=20 > sparse warnings: (new ones prefixed by >>) >>> security/keys/trusted-keys/trusted_dcp.c:206:24: sparse: sparse: incorr= ect type >>> in assignment (different base types) @@ expected restricted __le32 >>> [usertype] payload_len @@ got unsigned int @@ > security/keys/trusted-keys/trusted_dcp.c:206:24: sparse: expected r= estricted > __le32 [usertype] payload_len > security/keys/trusted-keys/trusted_dcp.c:206:24: sparse: got unsign= ed int >=20 > vim +206 security/keys/trusted-keys/trusted_dcp.c >=20 > 179 > 180=09static int trusted_dcp_seal(struct trusted_key_payload *p, char *= datablob) > 181=09{ > 182=09=09struct dcp_blob_fmt *b =3D (struct dcp_blob_fmt *)p->blob; > 183=09=09int blen, ret; > 184 > 185=09=09blen =3D calc_blob_len(p->key_len); > 186=09=09if (blen > MAX_BLOB_SIZE) > 187=09=09=09return -E2BIG; > 188 > 189=09=09b->fmt_version =3D DCP_BLOB_VERSION; > 190=09=09get_random_bytes(b->nonce, AES_KEYSIZE_128); > 191=09=09get_random_bytes(b->blob_key, AES_KEYSIZE_128); > 192 > 193=09=09ret =3D do_aead_crypto(p->key, b->payload, p->key_len, b->blob= _key, > 194=09=09=09=09 b->nonce, true); > 195=09=09if (ret) { > 196=09=09=09pr_err("Unable to encrypt blob payload: %i\n", ret); > 197=09=09=09return ret; > 198=09=09} > 199 > 200=09=09ret =3D encrypt_blob_key(b->blob_key); > 201=09=09if (ret) { > 202=09=09=09pr_err("Unable to encrypt blob key: %i\n", ret); > 203=09=09=09return ret; > 204=09=09} > 205 > > 206=09=09b->payload_len =3D get_unaligned_le32(&p->key_len); I think this should be a put_unaligned_le32(p->key_len, &b->payload_len). Thanks, //richard