[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZKhf8bi/eBDhaihD@bombadil.infradead.org>
Date: Fri, 7 Jul 2023 11:56:49 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: Michal Hocko <mhocko@...e.com>
Cc: Jean Delvare <jdelvare@...e.de>, linux-modules@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] module: print module name on refcount error
On Mon, Jul 03, 2023 at 03:47:22PM +0200, Michal Hocko wrote:
> On Fri 30-06-23 16:05:33, Luis Chamberlain wrote:
> [...]
> > What prevents code from racing the free with a random module_put()
> > called by some other piece of code?
>
> Wouldn't be ref count a garbage already? How can you race when freeing
> if module_put fail?
It could yes, ie, so this risks at all being junk. So best IMHO is
to tidy up all the get / puts and add respective tests to fix all
this mess with proper messages as needed. My cursory review of the
refcnt stuf is I see some races possible.
While I'd be happy to help debugging aids, adding accesses to random
memory for a string seems more risk prone.
Luis
Powered by blists - more mailing lists