Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1086994lqb; Wed, 29 May 2024 22:50:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXhzEUD7gkJr0yaffko+ZKi/gNSRmI1b9Xt9rBHUewdgp12FDEf4Vhq6xQOfQSX/Zsa8TihN5O6KkFGrii8nPLykuB3kbNxOoD5TwIAgw== X-Google-Smtp-Source: AGHT+IGPphmWOkI2CWsl2iNYO2bYqG17ezW0O4I76Iam2zBqepI5OPpbgOtaQrOzMhwsSWvipP5r X-Received: by 2002:a05:622a:587:b0:43a:bd5b:2558 with SMTP id d75a77b69052e-43fe92c2739mr16524581cf.36.1717048206935; Wed, 29 May 2024 22:50:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717048206; cv=pass; d=google.com; s=arc-20160816; b=wLHze0s/Jx4xdWO3FpSUcKmlWsUHoVKi/SEGj21srI5e3TDpDZLJMf0+Oal+Bbfub4 Tzmt8jEmvpY7oAuCq/bUvuyJSrGCvBMQSuCsye4YNDDzdIcSTfR6YtsoQkWDataG+uIv FngU35WEPONEhINkBBAueXUh18eJoqcuWt0brLTZfmjRGOa6xwgXv53ns53AmGB58DC6 PVtyTvddye333uYhEopqdw72B/fGRtBmoGtgKJXN6QLwpgLqQLmn8BECSYKph32xengC d1oO9ltSx3qgE2pHZJXA0pLAFHhjijbgk4d9u10zD2QoigLpJcdsNIUt1tLIB5CuKnRd lKnQ== 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=1jmIdt2fqVfjz0jtqAanggVhmHZQE8E2fMwWeOlkdhc=; fh=5X5asz3974ylRdSpM+qjXJRvUZbcemvW1QM/G3pz29I=; b=fka0yAFxgQqxYQ/kYvntXVdUEQnHPai+4BNS6OLyzTo32llGYbtlykSxjH2qRjuF5D CWHPrbGP5EHqQZ72o0jTOURJW00kzoWL3kdF4b4GZzuXLTGx+DDreqHnG5IqZWQj2TkQ xOjIpr9UGpWX1V3yrv/gKNL/lJOlYhB0XWptZESci92/zlClz7N/jkH88zYfLYd3y/qn Og+wiK+POOMJGqqOzIOS3tZ8SXM673PJN8eXZIJN3f/ZPW6MsXUX+859tRMzpGlapfbm o5y/QQztGH2d9pVCWJam6p8qypejhcYlNlpxE3RUHYLrPFxlHGv/azdE87xZjKYC6exI BKEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y+2n6QSo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-194956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194956-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. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43fe3400ee9si30775791cf.265.2024.05.29.22.50.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 22:50:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y+2n6QSo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-194956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194956-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 A85061C219E8 for ; Thu, 30 May 2024 05:50:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 000EA143733; Thu, 30 May 2024 05:49:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y+2n6QSo" 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 04383142E85; Thu, 30 May 2024 05:49:54 +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=1717048195; cv=none; b=Oc98hRNaaRc/41TzD56gR7m+E8GR5Lr4wxJlZNG2O8kIK1hLUzK/+uDEIDQmkVQfvxBdV3gaDNUz/4LxZjPLJljkMyrL1n28FNEGkq9h0CSQr6DegGTAj0TkIDAg5vgGH8KI8Jm6rEx+OJIpsGsGYwFIpRiQf0FyyeEfROerQY0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717048195; c=relaxed/simple; bh=7+dnG3WUQBWbugvASJZr4RwKum91jLcT2Ms1uQHX6J4=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=WpUqtcXpWBR5fUv+R3jf7LZi2qBl4CmgSyW0CAFo84Zwz9rRYbe0nPKQaQf+o8fzK3tegEIzAjq3THPVuehtR6iduWBdsBMjzb8IaQt/D8fnKCRE3HmkZZRTuctU+s+R3NHeGNI6EQ4GZ1Tifq0yTcNDRe717/G/L5UYWk/4Ot0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y+2n6QSo; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57BDEC2BBFC; Thu, 30 May 2024 05:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717048194; bh=7+dnG3WUQBWbugvASJZr4RwKum91jLcT2Ms1uQHX6J4=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=Y+2n6QSo/Lzj6UGzj9j6W/lNXVRakSs10UiEg82tlLiBQbLQAOkcxOXL/mdNaXhQ8 VJ/anR6Yn0ZhVyPQgzc3OiUOTKTeTr4gzP1PUCQCyy6iyA3C7tmwSXRZgaPVtIp+Uq UGKBdh+Vmd+ySFBE8LP8wgjAylC4VTo9d8TVXZoBxdZqjEBYuCvvUNxKyeWDECIyQY 7p5xQNDO9vDuqPBgzVGwiE6j0WzhFoBCdMgJkTibJKhUOHx0DyKw8oSpJGhn5atAQy sOsHOppc4q+gf3wg5R17etd8DmVzK7ky2iIT4+nvx23g+VgoY81mp/amBVHrkB85mR vP7I2yf5Rt4uw== 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: Thu, 30 May 2024 08:49:43 +0300 Message-Id: Cc: , , , , , , , , "Deven Bowers" Subject: Re: [PATCH v19 13/20] ipe: add support for dm-verity as a trust provider From: "Jarkko Sakkinen" To: "Paul Moore" , "Fan Wu" , , , , , , , , , , , X-Mailer: aerc 0.17.0 References: <1716583609-21790-14-git-send-email-wufan@linux.microsoft.com> <2ecde610ca3f0cabcbb111e3432f2dd5@paul-moore.com> In-Reply-To: <2ecde610ca3f0cabcbb111e3432f2dd5@paul-moore.com> On Thu May 30, 2024 at 4:44 AM EEST, Paul Moore wrote: > On May 24, 2024 Fan Wu wrote: > > + if (type =3D=3D LSM_INT_DMVERITY_ROOTHASH) { > > + if (!value) { > > + ipe_digest_free(blob->root_hash); > > + blob->root_hash =3D NULL; > > + > > + return 0; > > + } > > + digest =3D value; > > + > > + info =3D kzalloc(sizeof(*info), GFP_KERNEL); > > + if (!info) > > + return -ENOMEM; > > + > > + info->digest =3D kmemdup(digest->digest, digest->digest_len, > > + GFP_KERNEL); > > + if (!info->digest) > > + goto dmv_roothash_err; > > + > > + info->alg =3D kstrdup(digest->alg, GFP_KERNEL); > > + if (!info->alg) > > + goto dmv_roothash_err; > > + > > + info->digest_len =3D digest->digest_len; > > + > > + if (blob->root_hash) > > + ipe_digest_free(blob->root_hash); I'd restructure this as: if (type =3D=3D LSM_INT_DMVERITY_SIG_VALID { /* ... */ return 0; } if (type !=3D LSM_INT_DMVERITY_ROOTHASH) return -EINVAL; * ... */ Right? Less packed to the right ;-) BR, Jarkko