[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABgObfamvoMai1b9hrPkt1uwgw0kozhU5V_Vvk1__k_sGnx4LA@mail.gmail.com>
Date: Tue, 3 Aug 2021 15:29:16 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: Alexey Kardashevskiy <aik@...abs.ru>,
"Kernel Mailing List, Linux" <linux-kernel@...r.kernel.org>,
kvm <kvm@...r.kernel.org>
Subject: Re: [RFC PATCH kernel] KVM: Stop leaking memory in debugfs
> So userspace can create kvm resources with duplicate names? That feels
> wrong to me.
Yes, the name is just the (pid, file descriptor). It's used only for
debugfs, and it's not really likely going to happen unless a program
does it on purpose, but the ugliness/wrongness is one of the reasons
why we now have a non-debugfs mechanism to retrieve the stats.
> But if all that is "duplicate" is the debugfs kvm directory, why not ask
> debugfs if it is already present before trying to create it again? That
> way you will not have debugfs complain about duplicate
> files/directories.
That would also be racy; it would need a simple mutex around
debugfs_lookup and debugfs_create_dir. But it would indeed avoid the
complaints altogether, so I'll prepare a patch. Thanks,
Paolo
Powered by blists - more mailing lists