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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66896C64EC4 for ; Thu, 9 Mar 2023 11:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229803AbjCILLN (ORCPT ); Thu, 9 Mar 2023 06:11:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231463AbjCILKo (ORCPT ); Thu, 9 Mar 2023 06:10:44 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DECAE982C for ; Thu, 9 Mar 2023 03:05:11 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6480561AB9 for ; Thu, 9 Mar 2023 11:05:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7987BC433D2; Thu, 9 Mar 2023 11:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678359909; bh=wWkL/7W+HjspFf9yXxiuNHJjlGxw3h1j6PgjMMNL1BE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N2TBWnn+TznwRXvDqVgOAH1iKYjKWx+JHTwHIRgqzPnI9PbZzzuJ7swjfItBTSAcU /aCUCLDfDKKcFxhGyy+HDcKpwmBHV69yehO6JvEjCkWF6CzPv+CkcfE++YJ9MYVWyt g0Q5YWoseaNE+SDzgkSCbBveVe/zTe9DUsDyMCDs= Date: Thu, 9 Mar 2023 12:05:07 +0100 From: Greg KH To: Su Weifeng Cc: mst@redhat.com, linux-kernel@vger.kernel.org, shikemeng@huawei.com, liuzhiqiang26@huawei.com, linfeilong@huawei.com, zhanghongtao22@huawei.com Subject: Re: [PATCH v3] uio:uio_pci_generic:Don't clear master bit when the process does not exit Message-ID: References: <20230304074316.736922-1-suweifeng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230304074316.736922-1-suweifeng1@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 04, 2023 at 03:43:16PM +0800, Su Weifeng wrote: > From: Weifeng Su > > The /dev/uioX device has concurrent operations in a few scenarios. And you just broke that :( > For example, when a process is operating the uio0 device, someone executes > like "cat /dev/uio0" command. In this case, the bus master bit is cleared > unconditionally. It is cleared when the close happens, not when "cat" runs. So prevent userspace from doing that with permissions, why must the kernel enforce this policy you are making? > As a result, the running program cannot work commands > or I/Os, which is usually unaware of. This happens after > 865a11f("uio/uio_pci_generic: Disable bus-mastering on release"); Please always reference commits in the documented way. > The restriction on the process that uses the PCI device is added. The new > process can be used only after the process that uses the PCI device exits. > Otherwise, the system returns a message indicating that the device is busy. Again, you are changing the functionality of the kernel, are you sure you did not just now break something else? thanks, greg k-h