From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754375AbbLJRDO (ORCPT ); Thu, 10 Dec 2015 12:03:14 -0500 Received: from mail-pf0-f181.google.com ([209.85.192.181]:36252 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753887AbbLJRDK (ORCPT ); Thu, 10 Dec 2015 12:03:10 -0500 Date: Thu, 10 Dec 2015 09:03:06 -0800 From: Alexei Starovoitov To: Peter Zijlstra Cc: Dmitry Vyukov , syzkaller , Ingo Molnar , Arnaldo Carvalho de Melo , LKML , Kostya Serebryany , Alexander Potapenko , Eric Dumazet , Sasha Levin Subject: Re: use-after-free in __perf_install_in_context Message-ID: <20151210170305.GA28459@ast-mbp.thefacebook.com> References: <20151208032405.GA47397@ast-mbp.thefacebook.com> <20151208175433.GA75053@ast-mbp.thefacebook.com> <20151208180528.GA77166@ast-mbp.thefacebook.com> <20151208195623.GA92501@ast-mbp.thefacebook.com> <20151210035434.GA11217@ast-mbp.thefacebook.com> <20151210090251.GV6356@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151210090251.GV6356@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 10, 2015 at 10:02:51AM +0100, Peter Zijlstra wrote: > On Wed, Dec 09, 2015 at 07:54:35PM -0800, Alexei Starovoitov wrote: > > Freeing memory is a requirement regardless. > > Even when kernel running with kasan, there must be a way to stop > > stack collection and free that memory. > > You cannot treat kernel as your test program or 'device under test'. > > Relax, that is exactly what lockdep does. It cannot dynamically allocate > things because allocators use lock etc.. > > Its fine to build up state for debug bits, esp. if its bounded, like the > number of unique callchains. except the code in question is doing unbounded alloc_pages()