Received: by 10.213.65.68 with SMTP id h4csp2119001imn; Sun, 8 Apr 2018 20:10:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Qsm4dnXa7i0D+Kya+PXVMWMj6pZp+tlHni6qJh7zO0t9osfTL6IQQ9iTl9hzSHrxBzjmz X-Received: by 2002:a17:902:7c83:: with SMTP id y3-v6mr32134030pll.378.1523243430233; Sun, 08 Apr 2018 20:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243430; cv=none; d=google.com; s=arc-20160816; b=n+D+5swHTDvPtFeVFqcxAn3rJYJHhV/BupJtqrxD+gKZSvsYZtfgq/dIsjYu7kzz2r iMH9dW1i6OKB8gYht8I6Clf4OzO/5+6kbuyA8kZctRf02qDlxOPob404aNXu3u2BiGzu DMxeq3vsU6KfaG494BA0RgqERoySKTdOqA58FoUjVY/Hv/uiA/Dghd2XQaLtq7SpNrb7 zvQaR/dgla8MPzJucfPAUqVXvcTmbibL8zBUc9jD4g053Ze1Q54LR+KB4/p+TxECRLSd fnmJsHQ6UwKJi1RWzLXXnZuBpXXH8nYFukwtq5n1MF9HQGEydl9Wo+d2FfSDzscwPtLw snRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ZVk8Si9iwXSWUrWRXnfzZ78Fm9YVzmCtufCRfskUC1U=; b=Mmh4JU3uv1cMDGBVLapBk/IOSQqXsNX0i1d6eWsJItWptX91fC5yJivP4zuPMDqQjk s00OuX2W5uyDtxwd5+qvfx9Iuy644sXusCXQy83NQDW2wqmESOlZYbeeTptzLirhDnFR LjdN7i2esbg5G12mESehyVV8KiV4/GxjyilY0QWEKpooawXtDGFiLSjMxm0vpw/nv4FM CGlqJ4+59BWIE5V2X8fIyc9ne4b8l98bXUvN3SliTzkVmRw68MxQiQLViajo3b2EkeYF wq9jeqN2RrLEItjxSForEqDWrdjjvGGXrRbyLh6Ca+7naSCVLTSJMvsOm+w5k60+rcKk CEPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=m05kXnwA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4-v6si13617335plb.205.2018.04.08.20.09.53; Sun, 08 Apr 2018 20:10:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=m05kXnwA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755815AbeDICpa (ORCPT + 99 others); Sun, 8 Apr 2018 22:45:30 -0400 Received: from mail-by2nam03on0126.outbound.protection.outlook.com ([104.47.42.126]:2432 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755332AbeDIA0q (ORCPT ); Sun, 8 Apr 2018 20:26:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ZVk8Si9iwXSWUrWRXnfzZ78Fm9YVzmCtufCRfskUC1U=; b=m05kXnwAtv77OMKv6NrSFwRU+sUVdYemVBL9+SqvzWMOI9i1FuMkX0SvECqUHOo7QSZ2ruEh+21zdEMMj2HguByra822b1Ea/SykacSa9TDwyyKq7rdhlkEq4odB5PSBtS18EJ6s3PB4OowgHtL8T1XSGmO3fv+M2tybtRf827g= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0885.namprd21.prod.outlook.com (52.132.132.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:26:40 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:26:40 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Dan Carpenter , David Howells , James Morris , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 018/293] X.509: Fix error code in x509_cert_parse() Thread-Topic: [PATCH AUTOSEL for 4.9 018/293] X.509: Fix error code in x509_cert_parse() Thread-Index: AQHTz5jsZxlPd+WTNkOnQUWGncG8HA== Date: Mon, 9 Apr 2018 00:23:03 +0000 Message-ID: <20180409002239.163177-18-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0885;7:deCmr4yD834/R430PEvnYg+1le+U6y/XQP3AOPXYZmYH4cvn8LVPORYRhsopaDuHODKSLRVpvFKJxEL8h+/1IbtUkPeECr4QNtMRd+cA4HC5EMaukOjDNHVUqZXu0HIibudvWidJWAx3rdwGw9HQ0YGJRu7IpyEI9ClL3/Ve+W07WrVngfLieVtXqJiYzDs7ztHGyPkNPAaHbAw2rUGM1sxL/ubSuyt+nFdHptp9bbmc/G9XlN8CiOy4flbebfZ8;20:Y+6k+qYfZsaIrA/Jetn7U8diFthjPEJusmmcK11VkGKo5tu/OsyiCBR3NJMCJARA2LSa3Aho2G/5mLfUYWc6N9R32+v3m6oLVSX4kTsQ/mXaeOuN39Kjrp+LS/b8iCrDyY7l5oc8MgC+FEwXoMDjTbNjjoJdPKa/SDqGfOb1F4s= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: ca5c4e60-5ce0-4091-8780-08d59db090a1 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0885; x-ms-traffictypediagnostic: DM5PR2101MB0885: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0885;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0885; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(346002)(376002)(396003)(39380400002)(189003)(199004)(2906002)(68736007)(22452003)(316002)(6512007)(5660300001)(6666003)(54906003)(110136005)(486006)(6486002)(102836004)(36756003)(14454004)(99286004)(86612001)(105586002)(72206003)(106356001)(2900100001)(1076002)(97736004)(10090500001)(3280700002)(5250100002)(6436002)(3660700001)(6116002)(3846002)(305945005)(86362001)(66066001)(10290500003)(186003)(81166006)(8936002)(478600001)(476003)(25786009)(81156014)(8676002)(4326008)(7736002)(2501003)(107886003)(6506007)(2616005)(26005)(76176011)(446003)(53936002)(11346002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0885;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: dTWbxdmqLXNXvShFRppuT5h05UbluFR5HntLL7SWz7ix9lzqqNbkfsit4YfuUgiSIhTr5PFw3r1nP0KJdSXczKdJmamxFLitD4x02t9EBpsAUrnFR2+APLv3CaqZzaO6np+Ajhw4OSjdYGyPQWIkLYyCBJq6wz7S0PGq0Z2BpncWtm7ndzgxZpI1+XBX09BOnTl3+IiUxydYMDe4sq4AihJhbKlZZVeb2laOdjnIfrZTB/2CxN+02EgS1BzjyX6teIRTlZWliDoGqnUU9JVRdqYlG7XkC75wfkPiXjru9yYBJk3Z0lRVSh4712XtQuWSQEiPR4kuAjsXn7kR6TywIarXRMW7QXxZ5Ismm36kmyMs82rJXh7Rqvt/HNNwFF9FbpRbfJClXqq1CqJ2yqRZIl6bqHkd8M85fencjLpzLIo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca5c4e60-5ce0-4091-8780-08d59db090a1 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:23:03.8935 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0885 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 4e880168e9ffb1cdbdb72b3b48ab0324b30c2d62 ] We forgot to set the error code on this path so it could result in returning NULL which leads to a NULL dereference. Fixes: db6c43bd2132 ("crypto: KEYS: convert public key and digsig asym to t= he akcipher api") Signed-off-by: Dan Carpenter Signed-off-by: David Howells Signed-off-by: James Morris Signed-off-by: Sasha Levin --- crypto/asymmetric_keys/x509_cert_parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_= keys/x509_cert_parser.c index 029f7051f2be..ce2df8c9c583 100644 --- a/crypto/asymmetric_keys/x509_cert_parser.c +++ b/crypto/asymmetric_keys/x509_cert_parser.c @@ -102,6 +102,7 @@ struct x509_certificate *x509_cert_parse(const void *da= ta, size_t datalen) } } =20 + ret =3D -ENOMEM; cert->pub->key =3D kmemdup(ctx->key, ctx->key_size, GFP_KERNEL); if (!cert->pub->key) goto error_decode; --=20 2.15.1