Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752473AbcDVVdB (ORCPT ); Fri, 22 Apr 2016 17:33:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35851 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751742AbcDVVdA (ORCPT ); Fri, 22 Apr 2016 17:33:00 -0400 Date: Fri, 22 Apr 2016 14:32:59 -0700 From: Andrew Morton To: Alexander Potapenko Cc: adech.fo@gmail.com, dvyukov@google.com, cl@linux.com, ryabinin.a.a@gmail.com, kcc@google.com, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 1/2] mm, kasan: don't call kasan_krealloc() from ksize(). Message-Id: <20160422143259.b2d2c253da7ea6fa4b425269@linux-foundation.org> In-Reply-To: <2126fe9ca8c3a4698c0ad7aae652dce28e261182.1460545373.git.glider@google.com> References: <2126fe9ca8c3a4698c0ad7aae652dce28e261182.1460545373.git.glider@google.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 620 Lines: 22 On Wed, 13 Apr 2016 13:20:09 +0200 Alexander Potapenko wrote: > Instead of calling kasan_krealloc(), which replaces the memory allocation > stack ID (if stack depot is used), just unpoison the whole memory chunk. I don't understand why these two patches exist. Bugfix? Cleanup? Optimization? I had to change kmalloc_tests_init() a bit due to mm-kasan-initial-memory-quarantine-implementation.patch: kasan_stack_oob(); kasan_global_oob(); #ifdef CONFIG_SLAB kasan_quarantine_cache(); #endif + ksize_unpoisons_memory(); return -EAGAIN; } Please check.