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 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=-4.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 22D3CC433E0 for ; Wed, 10 Feb 2021 17:02:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CB89E64E02 for ; Wed, 10 Feb 2021 17:02:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB89E64E02 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9Tkrs/z/LCEh77ceoD0C+vbNyMBB8qoThLXJFTfwt6s=; b=bZDJLD7d5eiF7BCjd8JnUD496 BFdBoG4MS74H96jIPqb7rQYa0Nj5gyFXJ1/uT8Z59UCgmQn/9pZ/uv9skvxSSGse6ELZiN6kDgGYm 5x/wzvgjFLEsyVQuLLfUYsQLWYGtUxakqMp2MKB5EE6D1A1a7eAn9l5F+9wmtIHZ4YSP3NSXxQTQO MsRH7FVeUtR+rAJmQkQvz2J8Wy1OKpzpbWS+UbKLKPiBKdsm4CtgNs2lKKYxDLQ+P0m0usxGmhf5c GD9mJULYXKVROyrhFhmiX8sqHES6CcNNxNA/XPrtBRm104fXDJCBYaRyXvm9r0p4mw6tI08Dc85bN /Y/MpXKRQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9srN-0005LF-LE; Wed, 10 Feb 2021 17:01:01 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9srK-0005KH-9M for linux-arm-kernel@lists.infradead.org; Wed, 10 Feb 2021 17:00:59 +0000 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 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-Disposition: inline In-Reply-To: <1604419306-26105-2-git-send-email-sumit.garg@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210210_120058_573766_2A1AC63C X-CRM114-Status: GOOD ( 10.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-security-module@vger.kernel.org, daniel.thompson@linaro.org, op-tee@lists.trustedfirmware.org, corbet@lwn.net, jejb@linux.ibm.com, janne.karhunen@gmail.com, linux-doc@vger.kernel.org, jmorris@namei.org, zohar@linux.ibm.com, linux-kernel@vger.kernel.org, dhowells@redhat.com, lhinds@redhat.com, keyrings@vger.kernel.org, jarkko.sakkinen@linux.intel.com, Markus.Wamser@mixed-mode.de, casey@schaufler-ca.com, linux-integrity@vger.kernel.org, jens.wiklander@linaro.org, linux-arm-kernel@lists.infradead.org, serge@hallyn.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel