lkml.org 
[lkml]   [2023]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] uio:uio_pci_generic:Don't clear master bit when the process does not exit
On Sat, Mar 04, 2023 at 03:43:16PM +0800, Su Weifeng wrote:
> From: Weifeng Su <suweifeng1@huawei.com>
>
> 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

\
 
 \ /
  Last update: 2023-03-27 00:51    [W:0.023 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site