lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aLdOLQLjt-A1DBGi@fedora>
Date: Tue, 2 Sep 2025 13:06:05 -0700
From: "Vishal Moola (Oracle)" <vishal.moola@...il.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Juri Lelli <juri.lelli@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Kees Cook <kees@...nel.org>, kernel test robot <lkp@...el.com>,
	Dan Carpenter <dan.carpenter@...aro.org>
Subject: Re: [PATCH] mm: Fix kernel stack tagging for certain configs

On Tue, Sep 02, 2025 at 08:23:06PM +0200, David Hildenbrand wrote:
> On 02.09.25 19:59, Vishal Moola (Oracle) wrote:
> > Commit 4ef905bda61f ("mm: tag kernel stack pages") began marking pages
> > that were being used for the kernel stack.
> > 
> > There are 3 cases where kernel pages are allocated for kernel stacks:
> > CONFIG_VMAP_STACK, THREAD_SIZE >= PAGE_SIZE, THREAD_SIZE < PAGE_SIZE.
> > These cases use vmalloc(), alloc_pages() and kmem_cache_alloc()
> > respectively.
> > 
> > In the first 2 cases, THREAD_SIZE / PAGE_SIZE will always be greater
> > than 0, and pages are tagged as expected. In the third case,
> > THREAD_SIZE / PAGE_SIZE evaluates to 0 and doesn't tag any pages at all.
> > This meant that in those configs, the stack tagging was a no-op, and led
> > to smatch build warnings.
> > 
> > We definitely have at least 1 page we want tagged at this point, so fix
> > it by using a do {} while loop instead of a for loop.
> > 
> > Fixes: 4ef905bda61f ("mm: tag kernel stack pages")
> > Reported-by: kernel test robot <lkp@...el.com>
> > Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> > Closes: https://lore.kernel.org/r/202508300929.TrRovUMu-lkp@intel.com/
> > Signed-off-by: Vishal Moola (Oracle) <vishal.moola@...il.com>
> > ---
> 
> You sent the patch on August 20 and I replied on August 21.
> 
> I did not receive any reply so far.

Ah sorry, I didn't mean to miss your reply.

I can't find your reply in my inboxes so I definitely missed it somehow.
I'll go find it and respond.

> And now I realize that this patch is not upstream yet and the commit id not
> stable. So the Fixes/Closes etc. do not really apply.

Gotcha.

> My current opinion is that we don't want this. (see vmalloc reasoning and
> unclear use)
> 
> I'm happy to be convinced otherwise.
> 
> -- 
> Cheers
> 
> David / dhildenb
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ