From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D14D4C31E40 for ; Thu, 15 Aug 2019 08:49:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A80DC21952 for ; Thu, 15 Aug 2019 08:49:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565858968; bh=hWTTTkR4rwS2l5FUJgldUqWsSPmx6Qek8c4m1QxhUZo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=d65pb0ASFWOJ5wgsBcUdJ5etr7Ozx0uYp1bqt2UGSI7cTLkXfI1TijuhTcKCjgPT/ 0QjAldNWFUVSFBVbbq+nA4bpd9pn3z6SWK7eePrAbAEwbGOwTQLL7hNdYfBTiHteW2 mmKsXbQJ1vNPlsc0IMJbLtDnUGAzH/X/gyuwT9RY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728660AbfHOItZ (ORCPT ); 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-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@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