Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5319036ima; Tue, 5 Feb 2019 09:45:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IZn0rLVxNRn9MFUbLa6SGv8TVHv87oHFsrb5/oGWF7p56vGy228IvKHhqg8nCKmmumgqxB/ X-Received: by 2002:a63:4b25:: with SMTP id y37mr5711974pga.181.1549388703673; Tue, 05 Feb 2019 09:45:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549388703; cv=none; d=google.com; s=arc-20160816; b=z8Rx+6GCmBydYLn3b4hnr4PpISJ2ulF9iQ9TZmy4+3dIdFV4LXlaO4DFZ29pOu1IWS eB3bC1+k4NIC/InQeZPY2k8zmWnHvIH1LvOEPX5f45KEx3eCW1cM+2nPQ8kjanHufvmB agEDx4BcjCTgNiuEVEL3pXUyVVtJ2y8ygmkATuhN3SqjtrbHX4S9LlE76tu/bZPtaApZ oxLAQNK9uVJO3cZra4/HUb329JLnDy5ntblFm4wFRRqduWASha2u8LRZcAPRxR/VaXcf p5rECfkg5D/qXKpD7151ZA3aP5oO2Z3JUZyznKudv74oVl6+rebVUdQIT9CdByZK3KTp ClHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=d36hRwL1vCQ4M4MMJSJFMbrGERkZyD3OKas7oIXeZWc=; b=V9ezwxbt6qzh4PIR9As2652WSxHyPRticRZ468HJtn8h5CMmSQcFAaHOWXJbw00XAN GU1cJodulEcz5VZXMWzDghxZGWG0DnIz3wc9pWvXLheXlJj87WDW4KHIRU1QRQu0vClO J2G9mtH8g0YtvzpZCxizFChNr+JTsinCauvUK+NTBgAnJWN6kbhMgYH/m/HJo/c81sMI /YOTfEO3AnHSFlO09kqURdEzKuoQPIoXjJpnnQHHozDRY+/xjYvxhiNJyfas2yLngAqN VOvC1+cyhcgmo4BAy2qIqkUTr8mSAjxugLyWedThe5WTXMxRTpF5Up4Oea8I1zbA4Ip/ p38w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SrpvPtyw; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f95si4122859plb.60.2019.02.05.09.44.47; Tue, 05 Feb 2019 09:45:03 -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; dkim=pass header.i=@kernel.org header.s=default header.b=SrpvPtyw; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730388AbfBERV6 (ORCPT + 99 others); Tue, 5 Feb 2019 12:21:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:47324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726533AbfBERV5 (ORCPT ); Tue, 5 Feb 2019 12:21:57 -0500 Received: from earth.universe (dyndsl-091-096-002-001.ewe-ip-backbone.de [91.96.2.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 34F0A20818; Tue, 5 Feb 2019 17:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549387317; bh=d36hRwL1vCQ4M4MMJSJFMbrGERkZyD3OKas7oIXeZWc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SrpvPtywJ52S10RzFaBSnye0W5BdoByrCyFVqE5bL9zletbLVMFCeLTiAY/IGIxgI TlmytVibUFAOUA1lAzmzq25YivX0UvWGekxrCDGloG784Ey6AFFBski/JrutXn67Bu WAD2IDYR4S0A7fT8TuVtwCDoovv6vCH37KCZ0dHU= Received: by earth.universe (Postfix, from userid 1000) id 6D0AE3C08DE; Tue, 5 Feb 2019 18:21:54 +0100 (CET) Date: Tue, 5 Feb 2019 18:21:54 +0100 From: Sebastian Reichel To: Sven Van Asbroeck Cc: Dmitry Torokhov , Tejun Heo , Lai Jiangshan , Linux Kernel Mailing List , Kees Cook Subject: Re: [RFC v1 2/3] max17042_battery: fix potential user-after-free on module unload Message-ID: <20190205172154.j4zhucvnc7enadbc@earth.universe> References: <20190204220952.30761-1-TheSven73@googlemail.com> <20190204220952.30761-3-TheSven73@googlemail.com> <20190205082727.GB118684@dtor-ws> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d2jrdxogdqjb3gzv" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --d2jrdxogdqjb3gzv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Tue, Feb 05, 2019 at 09:27:49AM -0500, Sven Van Asbroeck wrote: > On Tue, Feb 5, 2019 at 3:27 AM Dmitry Torokhov > wrote: > > > > Are there many more instances of this? >=20 > Unfortunately I think so. > A simple grep brings up a couple of candidates, but I'm sure there are mo= re: >=20 > drivers/regulator/arizona-micsupp.c > drivers/nfc/port100.c > drivers/power/supply/max14656_charger_detector.c > drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c >=20 > > I am unsure if we need > > devm_init_work() when we can easily do the same in remove() call. >=20 > The devm_init_work() suggestion only addresses the problem for those modu= les > that use devm_. The others will need fixes in remove(). But this is not as > elegant and error-proof as using devm_init_work(). >=20 > [...] I would for sure appreciate a devm_init_work(). There are a lot of devm_ users in power-supply and this helper would definitely simplify things. -- Sebastian --d2jrdxogdqjb3gzv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlxZxi8ACgkQ2O7X88g7 +prQuQ/9F542FnFizpWNTCBQFiEGR8h7hB4/iBdHPTqUiKInCVv//JcRxgrBMeDm G7+V2J1iFdL/sRM/4qLHMh+q2b8nxSzqPBjE+0RPrV3EwFtO3NLXz1PfBzfupzS4 xdUPuE8eF1A2qhk1xjvPXvT8poptJHpMYs7mOfFOUdlDMYcdl6BdHhozitywxQ23 8FEFU4KLIYzeVP/gDvXM10+rkxuS1MVWmUnZ4c8aMJCIvTHw1oC5shjCCA/vxr7f Yh+7OXaZFy7/2okjkgnPof+MnlEud9hGaI9pV5a2+/p29SeeZT/WolzMjqAo52Dx IRVazKuBagH2n7xQAjgt/F/T47L/gjr+YRE3lc9hfznS9ZdPPB1OsmaojOO5V4tS cBALSxm/AVluiwtcZGciWtCqAm6Zvy/biZtkspobZfFfe9+bHz68XtTGX8hfRMVl wQse7xXA3QejDkLHjeL8Z8yImwo2ILS8Y8/uhpKPvCs51fJ0qRUeBDsF00Anda4R HlWKrVODG/7oJyN3PGPKZ6brn8eX/ANosAY4jmUJpu3002VsLVitAme5YTcvJxia Yx2PCd2CQcxxLFL497Sp4wNZibYmqBa21hi4+re/50n1tF5lMNTC5DjXaELuPh8D FW+2su1x1Eh4RfUiaGfhwiQOzWKJ6jOQXVrzZZFHtClztJKYDdw= =+Ulx -----END PGP SIGNATURE----- --d2jrdxogdqjb3gzv--