Received: by 10.223.185.116 with SMTP id b49csp5801908wrg; Wed, 7 Mar 2018 19:00:22 -0800 (PST) X-Google-Smtp-Source: AG47ELuCY6kIx98/IgtoyZWcWzWywD9x5D3B7Uvo+mpUmlPS8kTuU7pR7FPafQgEnJroi+Z5aTeH X-Received: by 10.99.161.2 with SMTP id b2mr20189274pgf.130.1520478021924; Wed, 07 Mar 2018 19:00:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520478021; cv=none; d=google.com; s=arc-20160816; b=iEAylDlmgg1MKw4TwAYqr9V7WuT9pc4VNraOCJlYLeb9jstEYgy12fQdY2pBV1hghf PrZEbyEG8gWh7Sersa9Wot/Q3Mjxm7gcEDdoAksAMJujrI3A+Z52nL0XmkzZZ/vgL9XY koKeoBjWw7iBv9IhDSPbiE2aRJb7grV/kX6+Hd6vq0pQAAOEtpSBQ4K72I6dAuukgiE7 kvR1sJ8NQBUyecPLFmEWOIwGyrP94GrVLfAwAiLHN2TDxJtszKEYTLuWFkg39jXDnyIT f6ewlsYyDBwPOJ4b/xqP+oUXCEFjOq/zEpMCN/WUUykwjbvpDs4NwrO0+0qzzOa2+hVI IJ3Q== 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=BmcxDUnZwYNbw7sVHu9E/snWfrKvdrtGD+55rLIgsac=; b=yPG8ZJfHMQ08fXeOVb1NTKjb4X5lVvqyoDFzwqw8/k7LtGs381qEKloF8KV81xEvuN MBXXX95Gryn3zLQXO/8YA43msUPPdlI/PSqLkuEreQHPkOQ53TXKDLBuj6bi8cQ8mvez wtzr+Fh+TR3p879HtF0olZZnkOhHRFgq3L742Lfn2rvKLeGcwaiu9kxIT25y/Cy+kiTs EhweNjp01M4wIAeeLUbrPLBokb54Yd9LWw+yd9hQOpfadJZuba8ju+jkEdAwfquPFv1V ZYzQkx7KpSSVtqtV1oSa3OYX/83G0q0/AefS3NntP2EITTeREC6eLkorh3Z2qUrDlcss tpPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=eSLf0CLo; 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 n3si12311415pgp.102.2018.03.07.19.00.07; Wed, 07 Mar 2018 19:00:21 -0800 (PST) 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=eSLf0CLo; 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 S934835AbeCHC6Z (ORCPT + 99 others); Wed, 7 Mar 2018 21:58:25 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:44968 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934553AbeCHC6Y (ORCPT ); Wed, 7 Mar 2018 21:58:24 -0500 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=BmcxDUnZwYNbw7sVHu9E/snWfrKvdrtGD+55rLIgsac=; b=eSLf0CLozNcrGvE5r/QAnB2ri u0MA/AEMF8Ro8rdJ67mZIjwqm2+NMhEBgINP0m2WXRoFh8zvjH0DWhxFhtlUDPW+PGQDeJxr/qF8q ++Z2Xk00lU6I2Lk4FS92uAR3TVYquTaABDMVNEwe6/GUH2Wge+7JvWCujGT6CbX15RrfDwsKaDZ22 Q3PDq9EYNIpyuRPuTVmnJS/sLckQmbvs+5qCBLYeBNilKqPK/CQ0IUhCUTddLEcE3Q+wKjOgjBtvv irgSbbi9uxWSrmIXPSw+yZd9/Teq2sAGhkidWjnKNNsuHqZOw1bUpgEforzWc2CJHaUHUbcK3ZcnP dR+QviQbg==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1etlky-0005H4-PT; Thu, 08 Mar 2018 02:58:12 +0000 Date: Wed, 7 Mar 2018 18:58:12 -0800 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: <20180308025812.GA9082@bombadil.infradead.org> References: <20180214182618.14627-1-willy@infradead.org> <20180214182618.14627-3-willy@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 Wed, Mar 07, 2018 at 10:18:21PM +0100, Julia Lawall wrote: > > Otherwise, yes, please. We could build a coccinelle rule for > > additional replacements... > > A potential semantic patch and the changes it generates are attached > below. Himanshu Jha helped with its development. Working on this > uncovered one bug, where the allocated array is too large, because the > size provided for it was a structure size, but actually only pointers to > that structure were to be stored in it. This is cool! Thanks for doing the coccinelle patch! Diffstat: 50 files changed, 81 insertions(+), 124 deletions(-) I find that pretty compelling. I'll repost the kvmalloc_struct patch imminently.