From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E756C433E9 for ; Wed, 10 Feb 2021 17:01:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4565D64E77 for ; Wed, 10 Feb 2021 17:01:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233074AbhBJRBp (ORCPT ); Wed, 10 Feb 2021 12:01:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:39236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232159AbhBJRBg (ORCPT ); Wed, 10 Feb 2021 12:01:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4707564DF6; Wed, 10 Feb 2021 17:00:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612976456; bh=H7GaOW+CiBvaeY1yYaT/BLhAmPmDWl62qWGA8z+LWpE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=moAfNVCjfFxnZKnAhRc+lbDyBoG0CzSSD4svV6t34566SHtjaTQaILzmcSpytKcN6 6ZyunSK/Q0VeXwZNg99SMzv4TbQUenOMQ+F2lU+d41OfjFMaMvKYCo0xe/zUdOAOxp aSA6T5N4akhoDz3agOWkj8TtDV9QIL7iUAKGzPY9R2lCbcS9t5bdad5fu9qgKwWjQ1 /XtDLtVe7ZjbWJuwuSPvT+JTmZO8w0V9oydRT26oW/RDRzLxxcGGefQKF+CEKtiSbC U0GJpe1dEEhTZ9gLLm8bdLRt1FlI4cnosdVslVSvahasqIQwQffVygPUC9Ec4XVVY0 zSbRzHQucknLA== Date: Wed, 10 Feb 2021 19:00:46 +0200 From: Jarkko Sakkinen To: Sumit Garg Cc: jarkko.sakkinen@linux.intel.com, zohar@linux.ibm.com, jejb@linux.ibm.com, dhowells@redhat.com, jens.wiklander@linaro.org, corbet@lwn.net, jmorris@namei.org, serge@hallyn.com, casey@schaufler-ca.com, janne.karhunen@gmail.com, daniel.thompson@linaro.org, Markus.Wamser@mixed-mode.de, lhinds@redhat.com, keyrings@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, op-tee@lists.trustedfirmware.org Subject: Re: [PATCH v8 1/4] KEYS: trusted: Add generic trusted keys framework Message-ID: References: <1604419306-26105-1-git-send-email-sumit.garg@linaro.org> <1604419306-26105-2-git-send-email-sumit.garg@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1604419306-26105-2-git-send-email-sumit.garg@linaro.org> Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org On Tue, Nov 03, 2020 at 09:31:43PM +0530, Sumit Garg wrote: > + case Opt_new: > + key_len = payload->key_len; > + ret = static_call(trusted_key_get_random)(payload->key, > + key_len); > + if (ret != key_len) { > + pr_info("trusted_key: key_create failed (%d)\n", ret); > + goto out; > + } This repeats a regression in existing code, i.e. does not check "ret < 0" condition. I noticed this now when I rebased the code on top of my fixes. I.e. it's fixed in my master branch, which caused a merge conflict, and I found this. /Jarkko