Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3782395imb; Tue, 5 Mar 2019 19:51:17 -0800 (PST) X-Google-Smtp-Source: APXvYqxRI1vw9TSnAeATrs2n2fQ5xhyKxpVFP/QE/EC7Foru6ogbDRxj+RjvlTAI4ZJXf5RoZ6OA X-Received: by 2002:a62:4743:: with SMTP id u64mr5092277pfa.95.1551844277596; Tue, 05 Mar 2019 19:51:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551844277; cv=none; d=google.com; s=arc-20160816; b=TE1wHnm1GEks9e6CXKcwNxivJpnJTEdCSCYJ7Ws1f+A2ukh5wzBCQ8yt8ZAg1WfqOr AIAWAVPvV+/zJGKElvJvr84y6MxjQUdAvjqjX1rVGs1Do3xvPjTQV3FUCTrDv9QaH44K PlgWFYJNNHI+BpEfxjr4ypTfQ5qohxClVr8NdFpPqK1hIBAcOKpfovm57yTGn3oi+3+9 swsBUfvOiAYDzARondyzSZzWf38vU63jvay1sQQQfd+cU+EKEcxcsVpC8C6azDYYrqo+ AfhGZcQsd2lNb4nwGIQ3i3v1Yl2Hf6QVZXTfYy7un/B4bYzkhLM1qu9ZP+F5nMvsSmkf S4mQ== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=5/jTeG5IhlJSf7Z8Q2ZL+Prum/SO81pFZMWuDQ8cBL8=; b=Fi2nsNyrAVIgU6fbcS4cu7rV2lf3xYHRzqagb5HAqHKrTOsHrUUaGI5hNhCi9pk9lS ycHZlI961S2Y/n4ZognkypO1o3EObDzwDLPO8t2UtFT0xENohRnE8rg1hjMXyMgp0e+A GYHjTXW8gbr9hNGuOA4664MwO3SbmMRPWAt0vNIplBKxw/ntyYKOUJ5cgwoX66iBHyws Feei5r0aCmFa495uxzm3omHpIsXpd2hbl57DVNQhzdHtKt6OrhjN5RS8KG0bAo6y9dsV DeTEpn1/f0pIUTHr2N3DWXfREpuuzCJHCRekftxT8BES0r6g+p5nVleaPOVOChQwXVbA Qw2A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2si607856pfi.103.2019.03.05.19.51.02; Tue, 05 Mar 2019 19:51:17 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729016AbfCFDXZ (ORCPT + 99 others); Tue, 5 Mar 2019 22:23:25 -0500 Received: from mx21.baidu.com ([220.181.3.85]:44515 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728992AbfCFDXY (ORCPT ); Tue, 5 Mar 2019 22:23:24 -0500 Received: from M1-MAIL-EX02.internal.baidu.com (unknown [10.44.83.51]) by Forcepoint Email with ESMTPS id B58D3436B5A23; Wed, 6 Mar 2019 11:23:15 +0800 (CST) Received: from BC-Mail-Ex15.internal.baidu.com (172.31.40.51) by M1-MAIL-EX02.internal.baidu.com (10.44.83.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1531.3; Wed, 6 Mar 2019 11:23:16 +0800 Received: from BC-Mail-Ex13.internal.baidu.com (172.31.40.49) by BC-Mail-Ex15.internal.baidu.com (172.31.40.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1531.3; Wed, 6 Mar 2019 11:23:16 +0800 Received: from BC-Mail-Ex13.internal.baidu.com ([172.31.40.49]) by Bc-Mail-Ex13.internal.baidu.com ([172.31.40.49]) with mapi id 15.01.1531.010; Wed, 6 Mar 2019 11:23:16 +0800 From: "Li,Rongqing" To: Paul Moore CC: Eric Paris , "linux-audit@redhat.com" , "linux-kernel@vger.kernel.org" Subject: =?utf-8?B?562U5aSNOiBbUEFUQ0hdIGF1ZGl0OiBmaXggYSBtZW1sZWFrIGNhdXNlZCBi?= =?utf-8?Q?y_auditing_load_module?= Thread-Topic: [PATCH] audit: fix a memleak caused by auditing load module Thread-Index: AQHU015GTPrk5LbesEazqwpDeyDWr6X97ztA Date: Wed, 6 Mar 2019 03:23:16 +0000 Message-ID: <0100abb43ecf4a1fbb4d61364b246767@baidu.com> References: <1551784466-15610-1-git-send-email-lirongqing@baidu.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.24.150.31] x-baidu-bdmsfe-datecheck: 1_BC-Mail-Ex15_2019-03-06 11:23:16:802 x-baidu-bdmsfe-viruscheck: BC-Mail-Ex15_GRAY_Inside_WithoutAtta_2019-03-06 11:23:16:787 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-Baidu-BdMsfe-DateCheck: 1_M1-MAIL-EX02_2019-03-06 11:23:16:891 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DQoNCj4gLS0tLS3pgq7ku7bljp/ku7YtLS0tLQ0KPiDlj5Hku7bkuro6IFBhdWwgTW9vcmUgW21h aWx0bzpwYXVsQHBhdWwtbW9vcmUuY29tXQ0KPiDlj5HpgIHml7bpl7Q6IDIwMTnlubQz5pyINeaX pSAyMjoxOA0KPiDmlLbku7bkuro6IExpLFJvbmdxaW5nIDxsaX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XVkaXRfYWxsb2Moc3RydWN0IHRhc2tfc3Ry dWN0ICp0c2spDQogDQogc3RhdGljIGlubGluZSB2b2lkIGF1ZGl0X2ZyZWVfY29udGV4dChzdHJ1 Y3QgYXVkaXRfY29udGV4dCAqY29udGV4dCkNCiB7DQorICAgICAgIGlmIChjb250ZXh0LT50eXBl ID09IEFVRElUX0tFUk5fTU9EVUxFKQ0KKyAgICAgICAgICAgICAgIGtmcmVlKGNvbnRleHQtPm1v ZHVsZS5uYW1lKTsNCisNCiAgICAgICAgYXVkaXRfZnJlZV9uYW1lcyhjb250ZXh0KTsNCiAgICAg ICAgdW5yb2xsX3RyZWVfcmVmcyhjb250ZXh0LCBOVUxMLCAwKTsNCiAgICAgICAgZnJlZV90cmVl X3JlZnMoY29udGV4dCk7DQpAQCAtMTI4Miw2ICsxMjg1LDggQEAgc3RhdGljIHZvaWQgc2hvd19z cGVjaWFsKHN0cnVjdCBhdWRpdF9jb250ZXh0ICpjb250ZXh0LCBpbnQgKmNhbGxfcGFuaWMpDQog ICAgICAgICAgICAgICAgaWYgKGNvbnRleHQtPm1vZHVsZS5uYW1lKSB7DQogICAgICAgICAgICAg ICAgICAgICAgICBhdWRpdF9sb2dfdW50cnVzdGVkc3RyaW5nKGFiLCBjb250ZXh0LT5tb2R1bGUu bmFtZSk7DQogICAgICAgICAgICAgICAgICAgICAgICBrZnJlZShjb250ZXh0LT5tb2R1bGUubmFt ZSk7DQorICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LT5tb2R1bGUubmFtZSA9IE5VTEw7 DQorICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LT50eXBlID0gMDsNCiAgICAgICAgICAg ICAgICB9IGVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGl0X2xvZ19mb3JtYXQoYWIs ICIobnVsbCkiKTsNCiANCkBAIC0xNTgzLDYgKzE1ODgsMTEgQEAgdm9pZCBfX2F1ZGl0X3N5c2Nh bGxfZXhpdChpbnQgc3VjY2VzcywgbG9uZyByZXR1cm5fY29kZSkNCiAgICAgICAgaWYgKCFsaXN0 X2VtcHR5KCZjb250ZXh0LT5raWxsZWRfdHJlZXMpKQ0KICAgICAgICAgICAgICAgIGF1ZGl0X2tp bGxfdHJlZXMoJmNvbnRleHQtPmtpbGxlZF90cmVlcyk7DQogDQorICAgICAgIGlmIChjb250ZXh0 LT50eXBlID09IEFVRElUX0tFUk5fTU9EVUxFKSB7DQorICAgICAgICAgICAgICAga2ZyZWUoY29u dGV4dC0+bW9kdWxlLm5hbWUpOw0KKyAgICAgICAgICAgICAgIGNvbnRleHQtPm1vZHVsZS5uYW1l ID0gTlVMTDsNCisgICAgICAgfQ0KKw0KICAgICAgICBhdWRpdF9mcmVlX25hbWVzKGNvbnRleHQp Ow0KICAgICAgICB1bnJvbGxfdHJlZV9yZWZzKGNvbnRleHQsIE5VTEwsIDApOw0KICAgICAgICBh dWRpdF9mcmVlX2F1eChjb250ZXh0KTsNCg0KDQotUm9uZ1FpbmcgDQoNCj4gLVBhdWwNCj4gDQo+ IC0tDQo+IHBhdWwgbW9vcmUNCj4gd3d3LnBhdWwtbW9vcmUuY29tDQo=