[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210708110016.seeviageyspgctzk@example.org>
Date: Thu, 8 Jul 2021 13:00:16 +0200
From: Alexey Gladkov <gladkov.alexey@...il.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Containers <containers@...ts.linux.dev>
Subject: Re: [PATCH] ucounts: Fix UCOUNT_RLIMIT_SIGPENDING counter leak
On Wed, Jul 07, 2021 at 10:23:35AM -0700, Linus Torvalds wrote:
> On Wed, Jul 7, 2021 at 9:50 AM Alexey Gladkov <legion@...nel.org> wrote:
> >
> > > + dec_rlimit_ucounts(ucounts, UCOUNT_RLIMIT_SIGPENDING, 1);
> > > + fallthrough;
> > > + case LONG_MAX:
> >
> > I think that the counter should be decreased in this case too.
> > inc_rlimit_ucounts() increments the counter in all parent userns. If we
> > don't decrease the counter then the parent userns will have a counter
> > leak.
>
> Ack. So basically that patch, but move the dec_rlimit_ucounts() into
> the LONG_MAX case?
Yep.
> Would you mind making a real patch with a commit message, and trying
> whatever test-case you had for that KASAN use-after-free report?
Sure. I will.
--
Rgrds, legion
Powered by blists - more mailing lists