Received: by 10.213.65.68 with SMTP id h4csp517515imn; Tue, 13 Mar 2018 11:33:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELs2r5Ub7LA6NZ+Ptp/HZ1r8js2aBCWGm5hXsuHr+P+kCUoZTd8bWwYGbJgBljRvP31JjDco X-Received: by 10.99.175.78 with SMTP id s14mr1247035pgo.388.1520966027093; Tue, 13 Mar 2018 11:33:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520966027; cv=none; d=google.com; s=arc-20160816; b=Hhg3wXeA9Ia7xqsdqhKyBdFOeW3/AwHe572ZjQgy66GuDI3NsyBfj1RgstWjL8Cve/ 4Pp/ZzFXCgueeacJts6mSN904Ca1T0zXcHAzrKkTDbAkVKEWSM4BBjWCFbIEX+79j49v dbY5bjcabRV21fWgPbC5bb9P44MZkJX46VqotcfEs/5dwOzs+Bw5fpdDQJfLAnexPFe1 feZBkSDDhcTUlwtWOi6xeQ0k9DEdur7qqZCLWfSF7KF3VKuuSIGh+q7zLRYYCclFmPsV VAFMFy+ZK2Vy+eqCNo9nbDtnSuDMKT701+rSqo0CVPtuTjKHa0W0xE0ZBOFwa+l+fDFI 6/kg== 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=S1VLBPT/odgGlddQrwtNkyByUo1oVNuaX4VY1sxg2UU=; b=kbbw/fJkCvoZAUEtno4fzjjYl257R4KKdiLRDt2K+NgA4FrfH41P3vHfqBSDOJuR0z msOq1HxEEjQnHfgZN+Naj4KFgm/SvVEIzdA5BTKuqrG7aiQ1DeVBIPitrvajz/b/Zs+k F9SWlbnt8XbYwndoEVvQbyVgJxYI//EklaBkjkGXRFpHK3b75Sx9MKZM7J2pJACFam06 Rs1AjulwKOUmP3ipg4N1qMy/dnHZ6Qz9I9sZFNa/HF5BZDP4ryy+QqxoRZRLNNN7c8EA pKqz61TnAVBi6K7qAo0ekoDDsogwRnFSP994zfZgUI1qTTXZCQvgKGiAaCLPOBfUbIiC vOwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=E70S/7I+; 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 j15si459786pga.418.2018.03.13.11.33.31; Tue, 13 Mar 2018 11:33:47 -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=E70S/7I+; 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 S1752262AbeCMSc2 (ORCPT + 99 others); Tue, 13 Mar 2018 14:32:28 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47968 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751613AbeCMSc1 (ORCPT ); Tue, 13 Mar 2018 14:32:27 -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=S1VLBPT/odgGlddQrwtNkyByUo1oVNuaX4VY1sxg2UU=; b=E70S/7I+vFkqHoGXk/s9BVg8l hu8OPYh/tCiOlff9ihz40FnvfHWgmwJyYDrG3g7IlGfMFpMZZmnMSAL7bLMDkgRl/Ch4ec/Cd//GG V7rFaDTYexI+KWfib3YScRaP8DixuX9A6rX8VwLNlj5ivtkI6phAPbRv+hT0LSwiqmJonzjdCaolr HOIKqYiPaY+IAG9hMmQEl4cm3r+pEQa11A9hnsdmfO+WxAmC5mUDrE9/CQh41ZRl0yFO5pngSn4Ye ijVQwwqWIoQWLBgasGns8glITmkXxIsr0R3D3wksIctjTkiDNT7xYtbS/onRN00Tomwr4PDSVZqgX 74xI6CQ5A==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1evoij-0007CX-3w; Tue, 13 Mar 2018 18:32:21 +0000 Date: Tue, 13 Mar 2018 11:32:20 -0700 From: Matthew Wilcox To: Julia Lawall Cc: Kees Cook , Andrew Morton , Matthew Wilcox , Linux-MM , LKML , Kernel Hardening , cocci@systeme.lip6.fr, Himanshu Jha Subject: Re: [PATCH 2/2] mm: Add kvmalloc_ab_c and kvzalloc_struct Message-ID: <20180313183220.GA21538@bombadil.infradead.org> References: <20180214182618.14627-1-willy@infradead.org> <20180214182618.14627-3-willy@infradead.org> <20180308025812.GA9082@bombadil.infradead.org> <20180308230512.GD29073@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, Mar 13, 2018 at 06:19:51PM +0100, Julia Lawall wrote: > On Thu, 8 Mar 2018, Matthew Wilcox wrote: > > On Thu, Mar 08, 2018 at 07:24:47AM +0100, Julia Lawall wrote: > > > Thanks. So it's OK to replace kmalloc and kzalloc, even though they > > > didn't previously consider vmalloc and even though kmalloc doesn't zero? > > > > We'll also need to replace the corresponding places where those structs > > are freed with kvfree(). Can coccinelle handle that too? > > Is the use of vmalloc a necessary part of the design? Or could there be a > non vmalloc versions for call sites that are already ok with that? We can also add kmalloc_struct() along with kmalloc_ab_c that won't fall back to vmalloc but just return NULL.