2012-05-07 05:25:13

by Rusty Russell

[permalink] [raw]
Subject: Re: [PATCH] 9p: disconnect channel when PCI device is removed

On Fri, 13 Apr 2012 17:48:36 -0400, Sasha Levin <[email protected]> wrote:
> When a virtio_9p pci device is being removed, we should close down any
> active channels and free up resources, we're not supposed to BUG() if there's
> still an open channel since it's a valid case when removing the PCI device.
>
> Otherwise, removing the PCI device with an open channel would cause the
> following BUG():

(Damn changed notmuch.el bindings! Previous reply went only to Sasha).

Applied thanks,
Rusty.


2012-05-07 07:15:33

by Aneesh Kumar K.V

[permalink] [raw]
Subject: Re: [PATCH] 9p: disconnect channel when PCI device is removed

Rusty Russell <[email protected]> writes:

> On Fri, 13 Apr 2012 17:48:36 -0400, Sasha Levin <[email protected]> wrote:
>> When a virtio_9p pci device is being removed, we should close down any
>> active channels and free up resources, we're not supposed to BUG() if there's
>> still an open channel since it's a valid case when removing the PCI device.
>>
>> Otherwise, removing the PCI device with an open channel would cause the
>> following BUG():
>
> (Damn changed notmuch.el bindings! Previous reply went only to Sasha).
>
> Applied thanks,
> Rusty.

I am not sure whether the patch is sufficient, p9_virtio_remove does a
kfree(chan) and since we are not doing anything at the file system
level, we would still allow new 9p client request. That means
p9_virtio_request would be dereferencing a freed memory.

-aneesh