From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30B98C6778C for ; Sun, 1 Jul 2018 09:03:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC67F24BE8 for ; Sun, 1 Jul 2018 09:03:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC67F24BE8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lip6.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbeGAJDd (ORCPT ); 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-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Date: Sun, 01 Jul 2018 09:03:29 +0000 Subject: Re: [PATCH v3 12/16] treewide: Use array_size() for kmalloc()-family Message-Id: MIME-Version: 1 Content-Type: multipart/mixed; boundary="8323329-1156912627-1530435810=:2748" List-Id: References: <20180601004233.37822-13-keescook@chromium.org> In-Reply-To: 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 --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-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f200.google.com (mail-wr0-f200.google.com [209.85.128.200]) by kanga.kvack.org (Postfix) with ESMTP id C91AD6B0006 for ; Sun, 1 Jul 2018 05:03:32 -0400 (EDT) Received: by mail-wr0-f200.google.com with SMTP id d17-v6so7257307wro.9 for ; Sun, 01 Jul 2018 02:03:32 -0700 (PDT) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr. [192.134.164.104]) by mx.google.com with ESMTPS id g12-v6si5053341wrr.21.2018.07.01.02.03.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 02:03:31 -0700 (PDT) Date: Sun, 1 Jul 2018 11:03:29 +0200 (CEST) From: Julia Lawall 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> MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1156912627-1530435810=:2748" Sender: owner-linux-mm@kvack.org List-ID: 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 --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 a??kv?[mz]alloca??. > 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--