Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1327316imj; Thu, 7 Feb 2019 22:52:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IZSH4KctBsBIwgQFTZ1D4UQUpQlVn1pzNLdTt3OK02HbIPDh4xxKv5KL8uy+bTBdUqM7oHv X-Received: by 2002:a17:902:ab84:: with SMTP id f4mr20686484plr.207.1549608749285; Thu, 07 Feb 2019 22:52:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549608749; cv=none; d=google.com; s=arc-20160816; b=dEsB50E/27FiQeYvSTxdcIkqjLPNVcNb7DYZf/KLOETm+xXKmRtJeH8lJrjNzuRF8s lV0gZZDrHVr5LEKawNdE43bHugQ+QIZAG/T4OSvSRem2GsOcFZFep1uJKa/H4sEaFJuJ gPX7C+M/t+oQFmKxcOauFhlpWb8KdcmTcPQraehWVc/Fc8aQZG/XeYQNBrfl632G28WJ HJy3sO46fty4X9lVxdxF+Q4DD2ZzkC4By68Y3DmCZiUm/jy61mrdqye/BTylT45iseQp 9PtsamBl/yonlbDar9Ixpiq9zvQRdMYe2/I2xSshEnqt3dV/tfN1rXz27PBpgfR2te5g fxaA== 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=5IX8TkmGR433QaBVwDi87afJ8L+kKCkw3bTPwzTRIwM=; b=Ac98iIIyd7Lvd58sW3nuoLCIAGDyqB41clNn90nDnCPEeQctCViOnj8mggDQgHDkSl yHKZB3nEDxB5qacNlq+6eMth9J3+dFvj/AO1XgpbzvHUFVZwnTKhCz7eZGopyEFng/sI tDekG5vJ1MnVIcG7H+NJxUxEGPVeV+0RTSKJzt6BKg7Us5M6cw0rQyIxWDrC9C/nsP+y ZtJYwEeW//6jbim7rE5Vz1t23RcWa8D1XLqRj8AjGb+OTitmhV+cD4J/Ck6P3JFTzpfr 9ArXwIfAUXLdfQpc7Tg+aPSm5uwytBlM5Eryndah/RQcUlWUPm6K31XM5U1BgwIfFYYt mJ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pA7sEJ+7; 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 d14si1303836pgi.158.2019.02.07.22.52.12; Thu, 07 Feb 2019 22:52:29 -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=pA7sEJ+7; 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 S1726524AbfBHGvb (ORCPT + 99 others); Fri, 8 Feb 2019 01:51:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:47404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725993AbfBHGva (ORCPT ); Fri, 8 Feb 2019 01:51:30 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 736FD21920; Fri, 8 Feb 2019 06:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549608689; bh=40A43kSQFVoPioyu8Kn4Eatqr9VwVAn8NigU4ZtnySg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pA7sEJ+7nbZ5jGRTsoc3t6PkvsE7H94CfMp3oXhsgBZzFaeRGtEmpzOls+1L1A1q3 TlZjbjD7oiTj1X0JvG5e814AEAqAIjmidDYgpdZUSJWCjJej6FIipK8j2O1e+sEd3S YtNwKdZ0yEfIOBjS1axZ4SfMYCzmsXxhIArS3lqg= Date: Fri, 8 Feb 2019 07:51:27 +0100 From: Greg KH To: Dmitry Torokhov Cc: Sven Van Asbroeck , Kees Cook , Tejun Heo , Lai Jiangshan , LKML , Sebastian Reichel Subject: Re: [RFC v1 0/3] Address potential user-after-free on module unload Message-ID: <20190208065127.GA27770@kroah.com> References: <20190204220952.30761-1-TheSven73@googlemail.com> <20190205184355.GC22198@kroah.com> <20190206164657.GC8466@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 06, 2019 at 09:30:29AM -0800, Dmitry Torokhov wrote: > On Wed, Feb 6, 2019 at 8:47 AM Greg KH wrote: > > > > On Tue, Feb 05, 2019 at 02:12:31PM -0500, Sven Van Asbroeck wrote: > > > On Tue, Feb 5, 2019 at 1:43 PM Greg KH wrote: > > > > > > > > > > > > It really should happen when the device is removed (if it is a driver > > > > that binds to a device.) > > > > > > Absolutely. That's why I'm advocating adding a devm_init_work(), > > > which will take care of this automatically. > > > > > > But it's of course not universally applicable. Not all drivers use devm. > > > > Ick, no, watch out for devm() calls. Odds are this is _NOT_ what you > > want to do for a device. Remember when devm calls get freed (hint, not > > at driver unbind/unload, but at device structure removal. > > > ??? We unwind devm on probe() failure and after remove() is called. > The device can live on. {sigh} you are right, I don't know what I was thinking. Then why were the DRM developers so upset that they didn't see this happening recently? Anyway, all should be fine here, nevermind... thanks, greg k-h