From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756976AbeDXM3Z (ORCPT ); Tue, 24 Apr 2018 08:29:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41278 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755555AbeDXM3V (ORCPT ); Tue, 24 Apr 2018 08:29:21 -0400 Date: Tue, 24 Apr 2018 08:29:14 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Matthew Wilcox cc: Michal Hocko , David Miller , Andrew Morton , linux-mm@kvack.org, eric.dumazet@gmail.com, edumazet@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, dm-devel@redhat.com, Vlastimil Babka , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim Subject: Re: [PATCH v3] kvmalloc: always use vmalloc if CONFIG_DEBUG_SG In-Reply-To: <20180424034643.GA26636@bombadil.infradead.org> Message-ID: References: <20180420130852.GC16083@dhcp22.suse.cz> <20180420210200.GH10788@bombadil.infradead.org> <20180421144757.GC14610@bombadil.infradead.org> <20180423151545.GU17484@dhcp22.suse.cz> <20180424034643.GA26636@bombadil.infradead.org> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 23 Apr 2018, Matthew Wilcox wrote: > On Mon, Apr 23, 2018 at 08:06:16PM -0400, Mikulas Patocka wrote: > > Some bugs (such as buffer overflows) are better detected > > with kmalloc code, so we must test the kmalloc path too. > > Well now, this brings up another item for the collective TODO list -- > implement redzone checks for vmalloc. Unless this is something already > taken care of by kasan or similar. The kmalloc overflow testing is also not ideal - it rounds the size up to the next slab size and detects buffer overflows only at this boundary. Some times ago, I made a "kmalloc guard" patch that places a magic number immediatelly after the requested size - so that it can detect overflows at byte boundary ( https://www.redhat.com/archives/dm-devel/2014-September/msg00018.html ) That patch found a bug in crypto code: ( http://lkml.iu.edu/hypermail/linux/kernel/1409.1/02325.html ) Mikulas