All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: Kees Cook <keescook@chromium.org>,
	Matthew Wilcox <mawilcox@microsoft.com>,
	linux-mm@kvack.org, kernel-hardening@lists.openwall.com,
	kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Matthew Wilcox <willy@infradead.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v3 12/16] treewide: Use array_size() for kmalloc()-family
Date: Sun, 1 Jul 2018 11:03:29 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1807011100110.2748@hadrien> (raw)
In-Reply-To: <b4c01457-7ea5-e7e3-be8b-f00fba6bac2b@users.sourceforge.net>

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

> > // 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

WARNING: multiple messages have this Message-ID (diff)
From: Julia Lawall <julia.lawall@lip6.fr>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: Kees Cook <keescook@chromium.org>,
	Matthew Wilcox <mawilcox@microsoft.com>,
	linux-mm@kvack.org, kernel-hardening@lists.openwall.com,
	kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Matthew Wilcox <willy@infradead.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v3 12/16] treewide: Use array_size() for kmalloc()-family
Date: Sun, 01 Jul 2018 09:03:29 +0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1807011100110.2748@hadrien> (raw)
In-Reply-To: <b4c01457-7ea5-e7e3-be8b-f00fba6bac2b@users.sourceforge.net>

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

> > // 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

WARNING: multiple messages have this Message-ID (diff)
From: Julia Lawall <julia.lawall@lip6.fr>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: Kees Cook <keescook@chromium.org>,
	Matthew Wilcox <mawilcox@microsoft.com>,
	linux-mm@kvack.org, kernel-hardening@lists.openwall.com,
	kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Matthew Wilcox <willy@infradead.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v3 12/16] treewide: Use array_size() for kmalloc()-family
Date: Sun, 1 Jul 2018 11:03:29 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1807011100110.2748@hadrien> (raw)
In-Reply-To: <b4c01457-7ea5-e7e3-be8b-f00fba6bac2b@users.sourceforge.net>

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

> > // 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

  reply	other threads:[~2018-07-01  9:03 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01  0:42 [PATCH v3 00/16] Provide saturating helpers for allocation Kees Cook
2018-06-01  0:42 ` [PATCH v3 01/16] compiler.h: enable builtin overflow checkers and add fallback code Kees Cook
2018-06-01  0:42 ` [PATCH v3 02/16] lib: add runtime test of check_*_overflow functions Kees Cook
2018-06-01  0:42 ` [PATCH v3 03/16] lib: overflow: Report test failures Kees Cook
2018-06-01  0:42 ` [PATCH v3 04/16] overflow.h: Add allocation size calculation helpers Kees Cook
2018-06-01  0:42 ` [PATCH v3 05/16] lib: overflow: Add memory allocation overflow tests Kees Cook
2018-06-01 10:18   ` Andy Shevchenko
2018-06-01  0:42 ` [PATCH v3 06/16] mm: Use overflow helpers in kmalloc_array*() Kees Cook
2018-06-01  0:42 ` [PATCH v3 07/16] mm: Use overflow helpers in kvmalloc() Kees Cook
2018-06-01  0:42 ` [PATCH v3 08/16] device: Use overflow helpers for devm_kmalloc() Kees Cook
2018-06-01  0:42 ` [PATCH v3 09/16] treewide: Use struct_size() for kmalloc()-family Kees Cook
2018-06-01  0:42 ` [PATCH v3 10/16] treewide: Use struct_size() for vmalloc()-family Kees Cook
2018-06-01  0:42 ` [PATCH v3 11/16] treewide: Use struct_size() for devm_kmalloc() and friends Kees Cook
2018-06-01  0:42 ` [PATCH v3 12/16] treewide: Use array_size() for kmalloc()-family Kees Cook
2018-07-01  8:46   ` SF Markus Elfring
2018-07-01  8:46     ` SF Markus Elfring
2018-07-01  8:46     ` SF Markus Elfring
2018-07-01  9:03     ` Julia Lawall [this message]
2018-07-01  9:03       ` Julia Lawall
2018-07-01  9:03       ` Julia Lawall
2018-07-01  9:22       ` SF Markus Elfring
2018-07-01  9:22         ` SF Markus Elfring
2018-06-01  0:42 ` [PATCH v3 13/16] treewide: Use array_size() for kmalloc()-family, leftovers Kees Cook
2018-06-01  0:42 ` [PATCH v3 14/16] treewide: Use array_size() for vmalloc() Kees Cook
2018-06-01  0:42 ` [PATCH v3 15/16] treewide: Use array_size() for devm_*alloc()-like Kees Cook
2018-06-01  0:42 ` [PATCH v3 16/16] treewide: Use array_size() for devm_*alloc()-like, leftovers Kees Cook
2018-06-01  0:54 ` [PATCH v3 00/16] Provide saturating helpers for allocation Linus Torvalds
2018-06-01  4:18   ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1807011100110.2748@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=elfring@users.sourceforge.net \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mawilcox@microsoft.com \
    --cc=torvalds@linux-foundation.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.