Received: by 10.213.65.68 with SMTP id h4csp2156759imn; Sun, 8 Apr 2018 21:10:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+o0nEJRVD1c8LmrVYJ4EiFzvS0V/2aPxT2yAEtU5Dl9YhXzI2TlQiXrxH1NQGThpPINq8D X-Received: by 10.99.96.66 with SMTP id u63mr24042756pgb.22.1523247038502; Sun, 08 Apr 2018 21:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523247038; cv=none; d=google.com; s=arc-20160816; b=wZWCHfDAXAG1dVSzcSXCE+jlbGd0DnOjEXEYOp4BEvjwtAHIGtI40akSZeDNvaSh4l 0NT+U7svp8JTfBzKWjX9k+IAv3wmw0vw9FvvgRejyGH1Z+w7FG2MIuQyhfvpdD6gDM6r U9Jod/7mS9lXEqkp/UhOSrAtK8cuobFQIAKOl1wamZJkrB+RHSTXNiLZ19XzeacvaCNq l8h8SBAjdMUuBSWhlRhivqgR8yKSxVNGaYp0genj76iPpA6HC9I30ZvH1srHaiAzJoMj DB2e8UZ/bSX53+bSoJBrcUfJHhoitder6MTL++ZA269n1WrHyDaAu3KSgtOx56ozO/u0 IZWg== 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=AErbnI81yqCiHngRh9wQPXsZoU01i6BpcvhfN13QSPo=; b=HFfHwP5gTpdS1NpSz/DKeVqI/BPu/sW1MtePsCcSGIo78KHADjgMhVeHSrgvCKWAh1 Ytb1ndumm1k0fUAmYxnso0i4RdphBj6CSgQj6OdNAiyrXxXxsd7Mdi17rRaj8FEAoyO/ zgpAmEh/v+ohC6RUiGQjCmlx21gc0S2IiPSrd1/lK6yujy+dQJjYC+ZqLkxWsWlH5PWg WzPyeYwkDnorHyBakaVoccWgslAIl875creD5HZF1dhztyTnuS6vChLZDFC7Z0RyzZE+ mB65ToQkTlqtrn5Bh4X9Pwb/GJbFDDpAORw1mtwWldw7uPBrD/ulUr75k81h17g4Pf3a lmxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=EMCie6Xk; 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 h10si10567547pgs.538.2018.04.08.21.10.01; Sun, 08 Apr 2018 21:10:38 -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=EMCie6Xk; 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 S1753814AbeDIEBo (ORCPT + 99 others); Mon, 9 Apr 2018 00:01:44 -0400 Received: from mail-co1nam03on0092.outbound.protection.outlook.com ([104.47.40.92]:42112 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752981AbeDIASJ (ORCPT ); Sun, 8 Apr 2018 20:18:09 -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=AErbnI81yqCiHngRh9wQPXsZoU01i6BpcvhfN13QSPo=; b=EMCie6Xk//rV1a4WGf3VsBjb+czMLpUz0iym36afihhHI2Eds2KqXpie0gyTdqn3Isl8f0F1o4CunbieXd9iMOgdQmgUjCha7oLfiA5QkP/BHLIVosXsfZQGBolPJuVku3dEBvBeVAdUIMRV4/v8zGiAI6h+H/T9kUgAnhqLVPk= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1046.namprd21.prod.outlook.com (52.132.128.15) 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:17:55 +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:17:55 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Ulf Magnusson , Masahiro Yamada , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 056/189] kconfig: Fix expr_free() E_NOT leak Thread-Topic: [PATCH AUTOSEL for 4.15 056/189] kconfig: Fix expr_free() E_NOT leak Thread-Index: AQHTz5glVoxWzfXhGEGy8jIbymy8lg== Date: Mon, 9 Apr 2018 00:17:29 +0000 Message-ID: <20180409001637.162453-56-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-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;DM5PR2101MB1046;7:JrtZS6WjcjAPUoFXZZWnIcN25kNm96iIl49MkhQJmP3OB1bqSJ7JtYOUO1GC2Up5UAFmvH0p/Cr0NxLQS7niWe0KHYD2DsR57wcEJav+ohV3/saEq5YLgz9od+qx1RY1/FynM2IjcYO/1uj6Zi+o0fpLV8e0nuOgZ5KtOFUjY24+Nfjus+dDFWk6+AJV3XtU4UrtMdxLTT3MzzqdM43w2vZCSCNij7EIlwBftl8hsaKiscIzN4yeG68YRALGWlTb;20:O2KAFVIRnPTqSFNWw8avFYxviTrS/C6nIPrTXhmwgrCR+l72CxMlZcUNJ7Dv+mDVTq+46Q8udnWk5kfbh1cHjmg3mcDNi/vMzx4OaiJW8S7IhyPUj4S2B9DyuH64PKGmNWqPm1Khdy0ZZJZ4pOzFlMBoxIBUj5MdfRuNFSnmsrQ= X-MS-Office365-Filtering-Correlation-Id: 1b0d3a25-48e4-47c4-1888-08d59daf574a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB1046; x-ms-traffictypediagnostic: DM5PR2101MB1046: 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)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1046;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1046; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(346002)(376002)(396003)(366004)(39860400002)(199004)(189003)(36756003)(186003)(11346002)(446003)(476003)(2616005)(7736002)(5660300001)(26005)(10290500003)(478600001)(106356001)(6666003)(68736007)(10090500001)(54906003)(3846002)(59450400001)(22452003)(6116002)(86612001)(110136005)(99286004)(86362001)(72206003)(305945005)(76176011)(102836004)(6506007)(486006)(316002)(3280700002)(3660700001)(81166006)(81156014)(8676002)(2906002)(14454004)(2900100001)(97736004)(6486002)(8936002)(1076002)(6512007)(6436002)(105586002)(39060400002)(25786009)(4326008)(2501003)(5250100002)(53936002)(66066001)(107886003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1046;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: h+Gj18HUDVCwEBFycg6uQMyCR7wCCGRJIeiGuDeeFlxqBZZmGyLsVNp7hqMC1Ugm+RYKtW5JohulQM6IPnibgL+mEIEBY4aFalWGpTT6X8m+/cNxTOEAplJstNljylNWnfWF+LD5XIp31gVEn5r6RoTIl7WcwQ+UT3eDiOoHdfZbY6s4CTH9m3HHxAS4In2HVK1ULbjKdDKnzgTWMGazGfOG1O6TeP2DFv0HqDXenW2QTeGjyuVjpmDFf0S6ff1wxBMQT2q1H1D3LElY37T20Fyj+511Q9+PioYR3yWfEDHmjWx6ouCYkK+SybrCjtvoVoCR+vy4Km0LJY88DJn7UrXR9AjA7xdxzTCrGj1DDNK/BatRmpsQYfukgpr52fUk+CIw9qfQueKItI4Ed3FawpPO7XqNoaoG+xAXelwX6Pk= 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: 1b0d3a25-48e4-47c4-1888-08d59daf574a X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:29.9626 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1046 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ulf Magnusson [ Upstream commit 5b1374b3b3c2fc4f63a398adfa446fb8eff791a4 ] Only the E_NOT operand and not the E_NOT node itself was freed, due to accidentally returning too early in expr_free(). Outline of leak: switch (e->type) { ... case E_NOT: expr_free(e->left.expr); return; ... } *Never reached, 'e' leaked* free(e); Fix by changing the 'return' to a 'break'. Summary from Valgrind on 'menuconfig' (ARCH=3Dx86) before the fix: LEAK SUMMARY: definitely lost: 44,448 bytes in 1,852 blocks ... Summary after the fix: LEAK SUMMARY: definitely lost: 1,608 bytes in 67 blocks ... Signed-off-by: Ulf Magnusson Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/kconfig/expr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index 8cee597d33a5..ee23ebc881a6 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c @@ -113,7 +113,7 @@ void expr_free(struct expr *e) break; case E_NOT: expr_free(e->left.expr); - return; + break; case E_EQUAL: case E_GEQ: case E_GTH: --=20 2.15.1