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-next>] [day] [month] [year] [list]
Date:	Sun, 20 Dec 2015 12:15:49 +0100
From:	Julia Lawall <Julia.Lawall@...6.fr>
To:	linux-s390@...r.kernel.org
Cc:	kernel-janitors@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
	alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
	linux-omap@...r.kernel.org
Subject: [PATCH 0/4] add NULL test

Add NULL tests on various calls to kzalloc and devm_kzalloc.

The semantic match that finds these problems is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,y;
identifier fld;
@@

(
x = \(vmalloc\|kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|krealloc\|
        kmemdup\|kstrdup\|
	devm_kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kasprintf\|
	kmalloc_array\)(...,<+... __GFP_NOFAIL ...+>,...);
|
* x = \(vmalloc\|kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|krealloc\|
        kmemdup\|kstrdup\|
	devm_kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kasprintf\|
	kmalloc_array\)(...);
)
  ... when != (x) == NULL
      when != (x) != NULL
      when != (x) == 0
      when != (x) != 0
      when != x = y
(
  x->fld
|
  *x
|
  x[...]
)
// </smpl>

---

 drivers/s390/char/con3215.c                 |    2 ++
 drivers/s390/char/raw3270.c                 |    2 ++
 sound/soc/fsl/imx-pcm-dma.c                 |    2 ++
 sound/soc/intel/baytrail/sst-baytrail-pcm.c |    2 ++
 sound/soc/omap/omap-hdmi-audio.c            |    2 ++
 5 files changed, 10 insertions(+)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ