Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2635536imm; Sun, 1 Jul 2018 02:05:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLL88Xokl/22fDiWeZP+e9sFez07sKyg21OOwPcq9XkMpMIjOCbYQGOJCxR93kNedGqm0+X X-Received: by 2002:a17:902:20ca:: with SMTP id v10-v6mr21272481plg.255.1530435905343; Sun, 01 Jul 2018 02:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530435905; cv=none; d=google.com; s=arc-20160816; b=JOxJAM0h+vn4lJoheX0JGhgVMWZW2MMLiQAjx/SUqpvQGJ7zBjidhR39idfQUv8sjJ r03VrDbRi3wQDkXXMUf+67cSkR4P/DvRvTfO8UR+sYCqneLv4NvmEm2WJqdqWYVqg+3E 4FZUVhzfpxEm7HcmGMEllyb2bwB3Zuaqplss+HRvJcxfOZ/tU6rZiwlThA/b2SMBXkSh iFuNCVcIB/sbSE7eoriqw1rEwYFqU/vspBtzp6Dp2b8/m/O/9BwY2M4tS7YTfEHHvaTs 36SnE4heHO/dOyq6GqdisPEKuN1VmCSPjxJB64b6wfcnoAyD9FghgNZMff+988APEUrI 6mMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=/Jk0nww1ZTUJrBIE4SsTCODfL9k0p9gSw3C0/gxkri4=; b=PF5N6cq9cLSBbeK+rMv61lRt+3lJxNCrgkGNgS+eCjShChHjIVXLvkWG8p5O5SV0Y1 kNwWJiTlk0uVO0rUPrWsYqnwT4P1TAUop9jGAyGmdHrqe1z6rjIyI6sjsPbTTnC4BmbE E7bmjdWAeVmuflljjeuE/SF2HgC0b2HBHLAdI4YsiFUf8F7nluBo/iqYuHFZWsS7srqn XJOgtAl6oo4jC1aLVaXHfQGDJYSgJCfbQNa3ZpDEg1xq75VqYUpHOgfuC4frmlfD6QGw FsijedrPY1n6JWnMQC7jnC6QJu50+qJF2QFSV/mzGzGSaJH88+W7Xvh0Rr5SViOcPI2R O7GA== ARC-Authentication-Results: i=1; mx.google.com; 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 n3-v6si11773703pga.298.2018.07.01.02.04.38; Sun, 01 Jul 2018 02:05:05 -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; 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 S1752165AbeGAJDd (ORCPT + 99 others); Sun, 1 Jul 2018 05:03:33 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:16168 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751879AbeGAJDc (ORCPT ); Sun, 1 Jul 2018 05:03:32 -0400 X-IronPort-AV: E=Sophos;i="5.51,294,1526335200"; d="scan'208";a="270948469" Received: from 89-157-201-3.rev.numericable.fr (HELO [192.168.0.15]) ([89.157.201.3]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jul 2018 11:03:30 +0200 Date: Sun, 1 Jul 2018 11:03:29 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: SF Markus Elfring cc: Kees Cook , Matthew Wilcox , linux-mm@kvack.org, kernel-hardening@lists.openwall.com, kernel-janitors@vger.kernel.org, LKML , Matthew Wilcox , Rasmus Villemoes , Linus Torvalds Subject: Re: [PATCH v3 12/16] treewide: Use array_size() for kmalloc()-family In-Reply-To: Message-ID: References: <20180601004233.37822-13-keescook@chromium.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1156912627-1530435810=:2748" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --8323329-1156912627-1530435810=:2748 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT > > // 2-factor product with sizeof(variable) > > @@ > > identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc"; > > * This regular expression could be optimised to the specification “kv?[mz]alloc”. > Extensions will be useful for further function names. > > * The repetition of such a constraint in subsequent SmPL rules could be avoided > if inheritance will be used for this metavariable. This is quite incorrect. Inheritance is only possible when a match of the previous rule has succeeded. If a rule never applies in a given file, the rules that inherit from it won't apply either. Furthermore, what is inherited is the value, not the constraint. If the original binding of alloc only ever matches kmalloc, then the inherited references will only match kmalloc too. julia --8323329-1156912627-1530435810=:2748--