From Jisheng.Zhang@synaptics.com Fri Oct 18 09:48:16 2019 Received: from mail-eopbgr730081.outbound.protection.outlook.com ([40.107.73.81] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by stoneboat.default.lvansomeren.uk0.bigv.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iLNvf-0005CV-KP for yaffs@stoneboat.aleph1.co.uk; Fri, 18 Oct 2019 09:48:16 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aV3L2kvLWpIklZMC7Wy+K1if1DpCeRXdY1B/SqNDNvUkSkRvGmfvf3P9ycU7D3o4VFm5iBMBnhQv1XMq3lZ+G0HJDkcdoGGsyx8mYmt9781ICTuha3vIq17ACEr1RE6byMDTKS47ODBRflmdEp7mZTyK8uHIbDqzr4ojoUhBhih28wWz+50xGMiCn2Q1LIPlixh2PrL0gFhImIYv2srp0SWJwcJ4clHUTu20GHhGnBZ5Bi9Qvp0tcitWRsVdEzacnt2nXyDpE4a8Hh4TDDds3m5yAk43GYAlxrdY2O+ksQH0ht9RJoQCB50fCjLTNiY9/yq5xVmx76JBQqqZOa8YQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kSn6Wqz6E6KhWB9GEmoRmEVT0HVI+Z82yLJ+nuLG6bM=; b=EE7KneJOAk1XaA/YkuUbTnG/DT6mn7rd1f29ReaImPgdiIsn+wuv8+kHUlfzaXfEDy8yN218mYG0R8tbATeWknkCrNrRWZrfm3rfF5GFalEBI+p1iSkIEdB5eJKxuNSIVQP4CKEl/GD2zy4g3egvFkwa3ZKTWmyGYnAItTdhqkrzUcAZKP2xGon7O/HnIEP8+Hb9tPvv0TzZwvL21UnlyE2ZbGPb7Ts+YrBuEdDj8XNZtvBGSLKFx1MThyLfKPsZ6YpgGk9SVKiemm5XnTKm0FA0ZWCwNU/ItHCqYU1lRQbFbH2qS4mxBsn6IhMrjqrWKd2Ye1gx4swbJfRXRNYyDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kSn6Wqz6E6KhWB9GEmoRmEVT0HVI+Z82yLJ+nuLG6bM=; b=eA1mRa+3uMpgOD573BZwOXNX9ZMBGN1zb5TFzgw8+DIvX3Tup9+9Cc+JVwuPAnzrc8zEtIFZ76NEBm0vZExMZRxs0SR3gp0DePcvpZRFahflLU3UPcoN3XU4DzAFNDFMKWScRf82DkgRYvkdXC3Vo7rkcWQtTsa0cuEMy2EJ8Zs= Received: from BYAPR03MB4773.namprd03.prod.outlook.com (20.179.93.213) by BYAPR03MB3413.namprd03.prod.outlook.com (52.135.213.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.16; Fri, 18 Oct 2019 08:48:08 +0000 Received: from BYAPR03MB4773.namprd03.prod.outlook.com ([fe80::1121:e7:f94d:cc61]) by BYAPR03MB4773.namprd03.prod.outlook.com ([fe80::1121:e7:f94d:cc61%3]) with mapi id 15.20.2347.026; Fri, 18 Oct 2019 08:48:08 +0000 From: Jisheng Zhang To: "yaffs@stoneboat.aleph1.co.uk" , Charles Manning Thread-Topic: [PATCH] fix memory leak when /proc/yaffs is read Thread-Index: AQHVhZDDD8F0HmgulkOs2WggiaZhXw== Date: Fri, 18 Oct 2019 08:48:07 +0000 Message-ID: <20191018163531.4e73b86a@xhacker.debian> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [124.74.246.114] x-clientproxiedby: TY2PR02CA0041.apcprd02.prod.outlook.com (2603:1096:404:a6::29) To BYAPR03MB4773.namprd03.prod.outlook.com (2603:10b6:a03:139::21) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f3516270-447a-4b8e-d615-08d753a7e5cb x-ms-traffictypediagnostic: BYAPR03MB3413: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-forefront-prvs: 01949FE337 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(39860400002)(366004)(346002)(136003)(189003)(199004)(6436002)(486006)(476003)(1076003)(110136005)(26005)(2906002)(71200400001)(71190400001)(186003)(6116002)(3846002)(6512007)(50226002)(2501003)(9686003)(6486002)(8936002)(66556008)(66476007)(6506007)(256004)(66446008)(66946007)(64756008)(8676002)(66066001)(52116002)(5660300002)(478600001)(99286004)(81166006)(25786009)(86362001)(7736002)(81156014)(4744005)(102836004)(305945005)(316002)(14454004)(386003)(39210200001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR03MB3413; H:BYAPR03MB4773.namprd03.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:0; received-spf: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /r2NqBW2Gc1npyEScNxEPqlXcbUr11L8LIW6IOsiDiZu2Z3KNnqAF6uXKtfgrlGO0xrH9YTfTKz1U278/ouxFKo3w/PXNK0PhmS7KL9ZMkwrX9+kYjOxF6k/ntDE206lWXQKEzGJ2UZXCB8YmihJz0SFphlC08J3UqYbOLw+ZqCxlKAzvp+/1xDJDF+r2HBFqoJdjNBNZf1vaSTVvkOKBM9oXSz1pp9EQBKRqfrTNDo/VIh6tFOCaurpXY2WZyZ48wbKh6MDbERTIx2VVdNqI0Drp8EIAfh0cqDYm7A3njaEE/KlFhW3QNaMntSRiAvfYEXJ9Dm0qs3pIg8YIVZnD9eaKhcXtijz7vovksyoW/thc9QRNXzCUWg58Ge3vayL+96mn20qHznDtrulxeKb4oh2u7rXl94UmIvcVGqR514= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3516270-447a-4b8e-d615-08d753a7e5cb X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2019 08:48:07.9767 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8ywG17T4JzoukCqbNBay8Me4l+szsLI/ksM9re4+9xZcOQsDxRM+i6iRsYayvHliCRsK0PFyWUowuC9QAHgBWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR03MB3413 X-Spam_score: -2.1 X-Spam_score_int: -20 X-Spam_bar: -- X-Spam_report: Spam detection software, running on the system "stoneboat.default.lvansomeren.uk0.bigv.io", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: There is a kernel memory leak observed when the proc file /proc/yaffs is read. This reason is that in yaffs_proc_open, single_open is called and the respective release function is not called during re [...] Content analysis details: (-2.1 points, 4.9 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.73.81 listed in list.dnswl.org] 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: synaptics.com] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.2 AWL AWL: Adjusted score from AWL reputation of From: address X-ACL-Warn: warn X-SA-Exim-Connect-IP: 40.107.73.81 X-SA-Exim-Mail-From: Jisheng.Zhang@synaptics.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on stoneboat.default.lvansomeren.uk0.bigv.io X-Spam-Level: X-Spam-Status: No, score=-2.1 required=4.9 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on stoneboat.default.lvansomeren.uk0.bigv.io) X-Mailman-Approved-At: Fri, 18 Oct 2019 09:52:35 +0100 Subject: [Yaffs] [PATCH] fix memory leak when /proc/yaffs is read X-BeenThere: yaffs@stoneboat.aleph1.co.uk X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion of YAFFS NAND flash filesystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2019 08:48:16 -0000 There is a kernel memory leak observed when the proc file /proc/yaffs is read. This reason is that in yaffs_proc_open, single_open is called and the respective release function is not called during release. Fix with correct release function - single_release(). Signed-off-by: Jisheng Zhang --- yaffs_vfs_multi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c index a36d9bf..e4edb2c 100644 --- a/yaffs_vfs_multi.c +++ b/yaffs_vfs_multi.c @@ -3687,6 +3687,7 @@ static struct file_operations procfs_ops =3D { .open =3D yaffs_proc_open, .read =3D seq_read, .write =3D yaffs_proc_write, + .release =3D single_release, }; =20 static int yaffs_procfs_init(void) --=20 1.9.1