lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1704252133230.3576@hadrien>
Date:   Tue, 25 Apr 2017 21:33:43 +0200 (CEST)
From:   Julia Lawall <julia.lawall@...6.fr>
To:     Fabian Frederick <fabf@...net.be>
cc:     Gilles Muller <Gilles.Muller@...6.fr>, cocci@...teme.lip6.fr,
        Jan Kara <jack@...e.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1 linux-next] scripts/coccinelle/misc: Warn about NULL
 check on kmap()



On Tue, 25 Apr 2017, Fabian Frederick wrote:

> This script removes NULL check on kmap() and all process involved
> (OOM message ...)
>
> Thanks to Jan Kara for explanations.
>
> Signed-off-by: Fabian Frederick <fabf@...net.be>

Acked-by: Julia Lawall <julia.lawall@...6.fr>

> ---
>  scripts/coccinelle/misc/kmap.cocci | 43 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
>  create mode 100644 scripts/coccinelle/misc/kmap.cocci
>
> diff --git a/scripts/coccinelle/misc/kmap.cocci b/scripts/coccinelle/misc/kmap.cocci
> new file mode 100644
> index 0000000..9ae4a6e
> --- /dev/null
> +++ b/scripts/coccinelle/misc/kmap.cocci
> @@ -0,0 +1,43 @@
> +/// kmap never fails; remove NULL test case.
> +///
> +// Copyright: (C) 2017 Fabian Frederick.  GPLv2.
> +// Comments: -
> +// Options: --no-includes --include-headers
> +
> +virtual patch
> +virtual org
> +virtual report
> +virtual context
> +
> +@r2 depends on patch@
> +expression E;
> +position p;
> +@@
> +
> +E = kmap(...);
> +- if (!E) {
> +- ...
> +- }
> +
> +@r depends on context || report || org @
> +expression E;
> +position p;
> +@@
> +
> +* E = kmap(...);
> +* if (@p!E) {
> +* ...
> +* }
> +
> +@...ipt:python depends on org@
> +p << r.p;
> +@@
> +
> +cocci.print_main("kmap() can't fail, NULL check and special process is not needed", p)
> +
> +@...ipt:python depends on report@
> +p << r.p;
> +@@
> +
> +msg = "WARNING: NULL check on kmap() result is not needed."
> +coccilib.report.print_report(p[0], msg)
> --
> 2.9.3
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ