<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/scripts/coccinelle/api, branch stable</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/scripts/coccinelle/api?h=stable</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/scripts/coccinelle/api?h=stable'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2026-11-01T23:27:25Z</updated>
<entry>
<title>coccinelle: Add devm_kmalloc_objs conversion script</title>
<updated>2026-11-01T23:27:25Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2026-11-01T10:35:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=afb17ae1dbf7464cacb8b8e2f8efaf8f7dc7b1b3'/>
<id>urn:sha1:afb17ae1dbf7464cacb8b8e2f8efaf8f7dc7b1b3</id>
<content type='text'>
Like commit bdc5071d7f7b ("coccinelle: Add kmalloc_objs conversion script")
with commit 1c7bbaeed110 ("coccinelle: kmalloc_obj: Remove default GFP_KERNEL arg")

Finds and converts sized devm_kmalloc-family of allocations into the typed
devm_kmalloc_obj-family of allocations.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: kmalloc_obj: Convert multi-byte integral allocations</title>
<updated>2026-09-22T04:26:11Z</updated>
<author>
<name>Kees Cook</name>
<email>kees@kernel.org</email>
</author>
<published>2026-09-14T22:37:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=6e72cefa7a47f33fac62a69b22e02b379b7a754b'/>
<id>urn:sha1:6e72cefa7a47f33fac62a69b22e02b379b7a754b</id>
<content type='text'>
Currently the kmalloc_obj conversion rules leave alone every allocation
sized to an integral type, or assigned to a pointer to one, so that byte
buffers keep being allocated with a byte count. That also leaves alone
arrays of multi-byte integers, such as

	vals = kcalloc(n, sizeof(u32), GFP_KERNEL);

which count objects like any other array. At the same time the signed
types (s8 through s64 and their variants) were not in the list at all.
But these multi-byte types are better handled through the full
kmalloc_obj-style allocation, as they are, in fact, typed and aren't
just a byte string, so they would benefit from type checking.

Split INTEGRAL into BYTE_TYPES and MULTIBYTE_TYPES:

 - Allocations sized by a byte type or a string literal, or assigned to
   a pointer to a byte type, are still left alone.
 - Allocations sized by a multi-byte type are converted when they are
   assigned to a pointer, or a pointer to const, of that same type.
   Other allocations sized by a multi-byte type are left alone, as their
   target may be a pointer to an array.
 - Allocations of other types assigned to a pointer to a multi-byte type
   are still left alone.
 - Arrays of pointers to integral types sized by type, such as
   sizeof(char *), are still left alone, now including the signed
   types, as their target may be a pointer to an array of pointers, like
   "const char *(*fmts)[]". Sized as sizeof(*target), they are converted
   like any other array.

List the signed types and the other spellings of the standard integer
types (short int, unsigned, long long int, and so on), so that a
declaration and a sizeof() that spell the same type differently still
match.

Assisted-by: LLM coccinelle
Link: https://patch.msgid.link/20260914223748.i.971-kees@kernel.org
Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>coccinelle: atomic_as_refcounter: drop atomic_long_dec_and_lock</title>
<updated>2026-08-30T12:17:25Z</updated>
<author>
<name>Sang-Heon Jeon</name>
<email>ekffu200098@gmail.com</email>
</author>
<published>2026-08-23T16:18:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=5264281879ef19b68f61846a7455a627f10b92e8'/>
<id>urn:sha1:5264281879ef19b68f61846a7455a627f10b92e8</id>
<content type='text'>
atomic_long_dec_and_lock() has never existed. So drop it from the rules.

No functional change.

Signed-off-by: Sang-Heon Jeon &lt;ekffu200098@gmail.com&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: kfree_mismatch: drop vmalloc_exec</title>
<updated>2026-08-30T12:09:27Z</updated>
<author>
<name>Sang-Heon Jeon</name>
<email>ekffu200098@gmail.com</email>
</author>
<published>2026-08-23T16:18:17Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=3beb6e620fae118f1dc1092b08b2c82b4e762b8a'/>
<id>urn:sha1:3beb6e620fae118f1dc1092b08b2c82b4e762b8a</id>
<content type='text'>
vmalloc_exec() was removed by commit 7a0e27b2a0ce ("mm: remove
vmalloc_exec").

So drop it from the rules.

No functional change.

Signed-off-by: Sang-Heon Jeon &lt;ekffu200098@gmail.com&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: pool_zalloc-simple: drop the pci_pool_alloc rules</title>
<updated>2026-08-30T09:19:01Z</updated>
<author>
<name>Sang-Heon Jeon</name>
<email>ekffu200098@gmail.com</email>
</author>
<published>2026-08-23T16:18:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=729eb52aa17f480a14ec0e7df363deabd41e57a3'/>
<id>urn:sha1:729eb52aa17f480a14ec0e7df363deabd41e57a3</id>
<content type='text'>
pci_pool_alloc() and pci_pool_zalloc() were removed by commit
88dee3b0efe4 ("PCI: Remove unused pci_pool wrappers").

So drop the pci_pool_alloc rules.

No functional change.

Signed-off-by: Sang-Heon Jeon &lt;ekffu200098@gmail.com&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: zalloc-simple: drop the kmem_alloc rules</title>
<updated>2026-08-23T20:12:11Z</updated>
<author>
<name>Sang-Heon Jeon</name>
<email>ekffu200098@gmail.com</email>
</author>
<published>2026-08-23T16:18:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=0319b42e1e28b845a3092082fa1e1ff9043f833e'/>
<id>urn:sha1:0319b42e1e28b845a3092082fa1e1ff9043f833e</id>
<content type='text'>
- kmem_alloc() was removed by commit f078d4ea8276
  ("xfs: convert kmem_alloc() to kmalloc()")

- kmem_zalloc() was removed by commit 10634530f7ba
  ("xfs: convert kmem_zalloc() to kzalloc()")

So drop the kmem_alloc rules.

No functional change.

Signed-off-by: Sang-Heon Jeon &lt;ekffu200098@gmail.com&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: alloc_cast: drop removed allocators</title>
<updated>2026-08-23T20:12:11Z</updated>
<author>
<name>Sang-Heon Jeon</name>
<email>ekffu200098@gmail.com</email>
</author>
<published>2026-08-23T16:18:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=2bd30b8dc75b823dd7bbef9d7bc68e1fd7ecee5c'/>
<id>urn:sha1:2bd30b8dc75b823dd7bbef9d7bc68e1fd7ecee5c</id>
<content type='text'>
- pci_alloc_consistent() and pci_zalloc_consistent() were removed by
  commit 7968778914e5
  ("PCI: Remove the deprecated "pci-dma-compat.h" API")

- kmem_alloc() was removed by commit f078d4ea8276
  ("xfs: convert kmem_alloc() to kmalloc()")

- kmem_zalloc() was removed by commit 10634530f7ba
  ("xfs: convert kmem_zalloc() to kzalloc()")

- kmem_zone_alloc() and kmem_zone_zalloc() were removed by commit
  bae633a4a283 ("xfs: remove xfs_zone_{alloc,zalloc} helpers")

So drop them from the rules.

No functional change.

Signed-off-by: Sang-Heon Jeon &lt;ekffu200098@gmail.com&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: api: check for macro context</title>
<updated>2026-08-23T20:12:10Z</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@inria.fr</email>
</author>
<published>2026-08-02T19:20:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=b64acacd5429ff3fe7c38cb3cf959bbd3a9fb30f'/>
<id>urn:sha1:b64acacd5429ff3fe7c38cb3cf959bbd3a9fb30f</id>
<content type='text'>
A cast on a call to an allocation function that is the body of a macro can
be useful, as it ensures tha the macro is used for allocating objects of
the right type.  Add two new rules to ignore the macro case.

Suggested-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: kmalloc_obj: Remove default GFP_KERNEL arg</title>
<updated>2026-03-20T17:52:52Z</updated>
<author>
<name>Kees Cook</name>
<email>kees@kernel.org</email>
</author>
<published>2026-03-20T17:51:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=1c7bbaeed110b0fd9e65e173fb4d612f64a20d93'/>
<id>urn:sha1:1c7bbaeed110b0fd9e65e173fb4d612f64a20d93</id>
<content type='text'>
Remove any GFP_KERNEL arguments found in the new kmalloc_obj-family
helpers. This captures the script used in commit 189f164e573e ("Convert
remaining multi-line kmalloc_obj/flex GFP_KERNEL uses").

Link: https://patch.msgid.link/20260320175113.work.016-kees@kernel.org
Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>coccinelle: Add kmalloc_objs conversion script</title>
<updated>2026-02-09T18:48:20Z</updated>
<author>
<name>Kees Cook</name>
<email>kees@kernel.org</email>
</author>
<published>2025-12-03T23:30:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=bdc5071d7f7bb82589737741e9bf19820ceb7a6a'/>
<id>urn:sha1:bdc5071d7f7bb82589737741e9bf19820ceb7a6a</id>
<content type='text'>
Finds and converts sized kmalloc-family of allocations into the
typed kmalloc_obj-family of allocations.

Link: https://patch.msgid.link/20251203233036.3212363-5-kees@kernel.org
Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
</feed>
