Received: by 10.192.165.148 with SMTP id m20csp4906617imm; Tue, 24 Apr 2018 10:18:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+eg0AI+Vb2HOf8ab6cHM7JmIyKlLLegiS8OE2IL67WQdQ6YAN/9pNcITTr0Ry28IBVHGMF X-Received: by 10.98.198.7 with SMTP id m7mr24893269pfg.66.1524590315018; Tue, 24 Apr 2018 10:18:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524590314; cv=none; d=google.com; s=arc-20160816; b=zN60/rXlyFxboSKDVFFZrQdemCAAl4XFnkRd70iDUGpAUkNKchc/+Hh29OcH5TSEQL ug1cou2qyrvStUR303ZzLibCNfulvK/leocEaFhq8BVlgFFKzjFpjWXgiEONiP2vGLod zr3y9VsGwL/3x016Vhtam/4XmG81IEAJuYET9xizV4RyKoCZgD4U/9j9/8UyCcM7PwsV Im003n1t7Eaf5hMPPIRmc5lnNToHO1e8S2pWnGymRhEq37nB/3qSQKgD5N3EnURtfhSX mZvDPG+VNAorWlrMWroZPphMtOngpu0G8t41OGrH3mIhV1irNrMugHOpbC1GIqLY1mF/ RQAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=kz4lVeOIkHRfbGzshrV7mrR/r2d2xMBSWDK/QASbPbc=; b=PpGMQQtadZL3kGVcA//8a/ZfXcdScS1qcqVN0dA5OxlkI8QeW1AUwX3xBtQ2OK6R41 gLJDUKPratS4x8YlUWtGLyklGvPg5we+AinI0XdR9SeQ64baelLpqGPEOe3MidS8L8LH W4TLeLIvVU4d1nnJE55nJs2umZkgejXNHfXTpEsKMZFRh0hwMJcX5OouwgXaxHhEA1Ue 8Odci2WxhdH4cWCPslYRfisDWADn2Ab3nz3lYHEl38E1PE9t8lsygHmaK0nKy0gj9ew9 akOIFTbw99orSwT3M00I9cTwRfyLN1XMy8h1DnGT1ryo6gPibxvbrfDTegCUJ7buncR+ ydPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qrlTlzB8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e17si11578936pgt.179.2018.04.24.10.18.20; Tue, 24 Apr 2018 10:18:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qrlTlzB8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751933AbeDXRRE (ORCPT + 99 others); Tue, 24 Apr 2018 13:17:04 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45874 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841AbeDXRQ7 (ORCPT ); Tue, 24 Apr 2018 13:16:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kz4lVeOIkHRfbGzshrV7mrR/r2d2xMBSWDK/QASbPbc=; b=qrlTlzB8s4+8l45kFCTcBTGVz Sv8pYjXCyqRq0fy37ZaYuF8I3pJW5EKbRVBwm4hIAKPvk40pZ04TtgSw2KVrWcv6OjVK6+TkiCxg4 T2gUcO1jM1RzyVaRcwxVqgTmMC5Ed2l++Q0bf+v6KB5cxooseO2v9P07kWXrHstN5WRX0f6M4OzGO HTwGgcB8h/qhYv7ke5xI8fpGDf+knV8wD9rAX0SP2qKJqZ6TfNYFtQ9A6xc+ZlkoXBLsjVzd4eI++ gQvnJx9fkf1dWrkLf5ar1zrypvm/3a5/Yr3n1uqy4kwQisoEf6XfrucxHMnR7OlcgMTjDv7q170Gx IXiiwOwUw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fB1Yi-00087t-4t; Tue, 24 Apr 2018 17:16:52 +0000 Date: Tue, 24 Apr 2018 10:16:51 -0700 From: Matthew Wilcox To: Mikulas Patocka 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 Message-ID: <20180424171651.GC30577@bombadil.infradead.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 24, 2018 at 08:29:14AM -0400, Mikulas Patocka wrote: > > > 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 ) Is it still worth doing this, now we have kasan?