From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751438AbdBIE5f (ORCPT ); Wed, 8 Feb 2017 23:57:35 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33607 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751060AbdBIE5e (ORCPT ); Wed, 8 Feb 2017 23:57:34 -0500 Date: Wed, 8 Feb 2017 20:22:29 -0800 From: Eric Biggers To: Hoeun Ryu Cc: Andrew Morton , Michal Hocko , Ingo Molnar , Andy Lutomirski , Kees Cook , "Eric W. Biederman" , Mateusz Guzik , linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: Re: [kernel-hardening] [PATCH v2 1/2] fork: free vmapped stacks in cache when cpus are offline Message-ID: <20170209042229.GA4311@zzz> References: <1486613040-30555-1-git-send-email-hoeun.ryu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1486613040-30555-1-git-send-email-hoeun.ryu@gmail.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hoeun, On Thu, Feb 09, 2017 at 01:03:46PM +0900, Hoeun Ryu wrote: > +static int free_vm_stack_cache(unsigned int cpu) > +{ > + int i; > + > + for (i = 0; i < NR_CACHED_STACKS; i++) { > + struct vm_struct *vm_stack = this_cpu_read(cached_stacks[i]); > + if (!vm_stack) > + continue; > + > + vfree(vm_stack->addr); > + this_cpu_write(cached_stacks[i], NULL); > + } > + > + return 0; > +} Doesn't this need to free the stacks for the 'cpu' that's passed in, instead of "this" CPU? - Eric