Re: general protection fault in sockfs_setattr

From: Cong Wang
Date: Wed Jun 06 2018 - 14:21:34 EST


On Tue, Jun 5, 2018 at 7:19 PM, shankarapailoor
<shankarapailoor@xxxxxxxxx> wrote:
> Hi Cong,
>
> I added that check and it seems to stop the crash. Like you said, I
> don't see where the reference count for the file is increased. The
> inode lock also seems to be held during this call.

I know inode lock is held for ->setattr(), but not for ->release(), this
is why I suspect sock_close() could still race with sockfs_setattr()
after my patch.

I am not sure if it is crazy to just hold fd refcnt for fchmodat() too..