Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1828193ybl; Thu, 15 Aug 2019 01:50:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmcGZgz1+YZ/KawJFw5FxHRjZbEQ2bNqirAhpL+gbsfS8fjnYcdabMTKEVhggPsWcH/Bdc X-Received: by 2002:a17:90a:c24e:: with SMTP id d14mr1262432pjx.129.1565859013614; Thu, 15 Aug 2019 01:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565859013; cv=none; d=google.com; s=arc-20160816; b=WiWVLwpy8rwcpA/dM0Ns2yiMD9uOpFNGpr49InNS8W2q0Te5G9vNt4jURCekg5LMJS Uozso54Dnb4gEMLE1TTOnT35wVNQHEJKjMwif8aMHf5jjX8y5QK50TM3/X7/uSyxDObC NP2AzxLU7ePkCNGqVXYFLn3jWKsHo3k2Yhqg2tEfQ6GT8xFVE+6yZ1LUjcM+9qt2N1vb MvBqB42pTJOSbSLjh/OXHzEn791VY5NGSS5kznRb+nFhSuhc6ncNCWPsaS7SnF0NBsPw m5ukCUvhv2Nu00c+jGtAYFjnO/tFmAp8xQZz7fsT4RPHvYvnKuxq4tsQpj+hPzE3N8IU KYKA== 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=xowRFVMtWwCBUA5oc7cxCmUOdp7VlDlKfHVhy4hAJqQ=; b=kx2DVK4gh9iHOOd3ZcJgDv0vT6TGtMYDgMU8vdUKegbzgxizCv4/shvGwB8NqyuY5L 7gsI2pU+MyXyw8u6YX44PL6es/O+f8dGymHsCLSl0P822eShazPlRT6ZCzh159DI78tT 75MHOFudiDxqyG15ovLIYTBCqsdxI8taIuob+X12Knl3Ko5KdUBKaNt+Wa9j9PjU/qHS 1O6mYq1L+/mVBcVVsvI+RoNXRHKlDihUGTZk7HXe8GVgtsVLLPD8eiwH+f7AwMFvh7yv qgZT9/Blkjp5EELFS3XTmo7bDGbHLsfhR8dDGqSnZnrwgBTCrG50CTF3u0jAT4CIqb/k /cLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u8AWuu4f; 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 y16si1629503pfc.51.2019.08.15.01.49.58; Thu, 15 Aug 2019 01:50:13 -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=@kernel.org header.s=default header.b=u8AWuu4f; 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 S1730528AbfHOItZ (ORCPT + 99 others); Thu, 15 Aug 2019 04:49:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:35646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbfHOItZ (ORCPT ); Thu, 15 Aug 2019 04:49:25 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 78148218C9; Thu, 15 Aug 2019 08:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565858964; bh=hWTTTkR4rwS2l5FUJgldUqWsSPmx6Qek8c4m1QxhUZo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=u8AWuu4fOejF2RYy+PawpZAqyzXp/u36EwXSoyuwIVTiJh3PmN8+cLh1CbYclj0zj Yt9LP0sq+ypW5XMoQ0yddIDatDT7WgwIfvXdV79rAYO0C36sYi3mB8xmiYgX03juSl yiMai7+diCiyTFHAtcgdnVT6IawYsx4mBjAvkpTc= Date: Thu, 15 Aug 2019 10:49:21 +0200 From: Greg Kroah-Hartman To: Knut Omang Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, Shuah Khan , Jonathan Corbet , Masahiro Yamada , Michal Marek , Shreyans Devendra Doshi <0xinfosect0r@gmail.com>, Alan Maguire , Brendan Higgins , Kevin Hilman , Hidenori Yamaji , Frank Rowand , Timothy Bird , Luis Chamberlain , Theodore Ts'o , Daniel Vetter , Stephen Boyd Subject: Re: [RFC 06/19] ktf: A simple debugfs interface to test results Message-ID: <20190815084921.GE3512@kroah.com> References: <20190813082152.GA17627@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 14, 2019 at 07:17:07PM +0200, Knut Omang wrote: > I notice the discussion and your response here: > http://linux-kernel.2935.n7.nabble.com/debugfs-and-module-unloading-td865175.html > I assume that means that protection against module unload while a debugfs file > is open is now safe. It should be, if you set the *owner field of your file_operations properly. Try it and see! > On older kernels, having this code in place is far better than an unprotected > debugfs entry/exit - I have tested it extensively in the past :-) Yes, it seems to work, but again, it really is racy and will fail. Please don't use it. > I perfectly agree with you that reducing the hole for a race condition > is generally a bad idea, but from the above mail thread > it seems that's the only available choice for older kernels? I have no idea, but please, do not use that pattern of code as it is racy in all kernels, from all of time. thanks, greg k-h