<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/kernel/module, branch davem/net</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/kernel/module?h=davem%2Fnet</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/kernel/module?h=davem%2Fnet'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2026-09-26T20:55:09Z</updated>
<entry>
<title>module: fix lost error code from codetag_load_module()</title>
<updated>2026-09-26T20:55:09Z</updated>
<author>
<name>Hao Ge</name>
<email>hao.ge@linux.dev</email>
</author>
<published>2026-08-27T03:05:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=c79cf15eb35a4c703bf18f8c33c47e80dd660f8e'/>
<id>urn:sha1:c79cf15eb35a4c703bf18f8c33c47e80dd660f8e</id>
<content type='text'>
If codetag_load_module() fails, err is not set to reflect the failure
and load_module() returns 0 after the module has been torn down.

Also, if the module is a livepatch, mod-&gt;klp_info allocated by
copy_module_elf() leaks on this error path.  Free it via a new
livepatch_cleanup label.

Link: https://lore.kernel.org/20260827030503.49171-1-hao.ge@linux.dev
Fixes: 044d2aee6c57 ("alloc_tag: handle module codetag load errors as module load failures")
Signed-off-by: Hao Ge &lt;hao.ge@linux.dev&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Reported-by: Sashiko &lt;sashiko-bot@kernel.org&gt;
Suggested-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
Reviewed-by: Bradley Morgan &lt;brads@mainlining.org&gt;
Cc: Aaron Tomlin &lt;atomlin@atomlin.com&gt;
Cc: Luis Chamberalin &lt;mcgrof@kernel.org&gt;
Cc: Sami Tolvanen &lt;samitolvanen@google.com&gt;
Cc: Suren Baghdasaryan &lt;surenb@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
</content>
</entry>
<entry>
<title>module: validate string table section types</title>
<updated>2026-08-06T14:44:45Z</updated>
<author>
<name>Thiébaud Weksteen</name>
<email>tweek@google.com</email>
</author>
<published>2026-07-08T01:21:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=9a5ff45689329835f874cefe5174e577d141d423'/>
<id>urn:sha1:9a5ff45689329835f874cefe5174e577d141d423</id>
<content type='text'>
In elf_validity_cache_sechdrs, section sizes and offsets are validated,
unless the section type is SHT_NULL or SHT_NOBITS.

Later, elf_validity_cache_secstrings and elf_validity_cache_index_str
access the section name table (.shstrtab) and symbol string table
(.strtab) headers without first ensuring that their types are
SHT_STRTAB. If a section type is SHT_NULL or SHT_NOBITS, sh_offset has
not been validated and may reference out-of-bounds memory when
dereferenced in elf_validity_cache_secstrings or
elf_validity_cache_strtab.

Validate that both string section headers are of type SHT_STRTAB before
caching them.

Cc: stable@vger.kernel.org
Signed-off-by: Thiébaud Weksteen &lt;tweek@google.com&gt;
Reviewed-by: Aaron Tomlin &lt;atomlin@atomlin.com&gt;
Reviewed-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
</content>
</entry>
<entry>
<title>module/dups: Clean up includes</title>
<updated>2026-08-06T11:29:03Z</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-08-06T09:10:20Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=2a7ecc5fbde76fd48f37c2878e52c50ae8928e0a'/>
<id>urn:sha1:2a7ecc5fbde76fd48f37c2878e52c50ae8928e0a</id>
<content type='text'>
The kernel/module/dups.c file relies on the following definitions and
associated functions:

* module_param() -&gt; linux/moduleparam.h,
* DEFINE_MUTEX() -&gt; linux/mutex.h,
* LIST_HEAD(), list_for_each_entry(), ... -&gt; linux/list.h,
* refcount_t, refcount_inc(), ... -&gt; linux/refcount.h,
* MODULE_NAME_LEN -&gt; linux/module.h,
* completion, complete_all(), ... -&gt; linux/completion.h,
* delayed_work, work_struct, ... -&gt; linux/workqueue.h,
* lockdep_assert_held() -&gt; linux/lockdep.h,
* strcmp(), memcpy() -&gt; linux/string.h,
* container_of() -&gt; linux/container_of.h,
* DEFINE_FREE(), __free(), scoped_guard() -&gt; linux/cleanup.h,
* kzalloc_obj(), kfree() -&gt; linux/slab.h,
* pr_debug(), pr_warn() -&gt; linux/printk.h,
* WARN() -&gt; linux/bug.h,
* TASK_KILLABLE -&gt; linux/sched.h,
* HZ -&gt; linux/param.h.

Update the file's include list accordingly.

Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
</content>
</entry>
<entry>
<title>module/dups: Use strcmp() to compare module names</title>
<updated>2026-08-06T11:29:03Z</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-08-06T09:10:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=cc6e79b2080da3310dbf9749c6ee61ae1641ec70'/>
<id>urn:sha1:cc6e79b2080da3310dbf9749c6ee61ae1641ec70</id>
<content type='text'>
Use strcmp() instead of strlen()+memcmp() to compare module names in
kmod_dup_request_lookup(), since all strings are NUL-terminated.

Reviewed-by: Aaron Tomlin &lt;atomlin@atomlin.com&gt;
Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
</content>
</entry>
<entry>
<title>module/dups: Use scope-based cleanup helpers</title>
<updated>2026-08-06T11:29:03Z</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-08-06T09:10:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=c85e76535b6d66cf89e6895721d36cf63b233c6a'/>
<id>urn:sha1:c85e76535b6d66cf89e6895721d36cf63b233c6a</id>
<content type='text'>
Use scope-based cleanup helpers for kmod_dup_mutex and kmod_req to shorten
the code and to clarify where the lock is taken in
kmod_dup_request_exists_wait().

Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
</content>
</entry>
<entry>
<title>module/dups: Avoid unnecessary kmod_dup_req allocations</title>
<updated>2026-08-06T11:29:03Z</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-08-06T09:10:17Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=96e6f752fc25af366de2b3f8aa09c93963d00d2a'/>
<id>urn:sha1:96e6f752fc25af366de2b3f8aa09c93963d00d2a</id>
<content type='text'>
The kmod dups code preallocates kmod_dup_req before taking kmod_dup_mutex
to avoid allocating memory while holding the lock. This provides little
benefit, since the allocation is fast and can safely be done under the
lock. On the other hand, it leads to unnecessary allocations when the
request turns out to be a duplicate and slightly complicates the code.

Allocate kmod_dup_req only when needed and introduce a helper function
alloc_kmod_req() to initialize the structure.

Reviewed-by: Aaron Tomlin &lt;atomlin@atomlin.com&gt;
Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
</content>
</entry>
<entry>
<title>module/dups: Fix use-after-free in kmod_dup_req lifetime handling</title>
<updated>2026-08-06T11:29:03Z</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-08-06T09:10:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=5eecb11b543f9f417bcf0dea239ff99c6af65dbd'/>
<id>urn:sha1:5eecb11b543f9f417bcf0dea239ff99c6af65dbd</id>
<content type='text'>
The kmod dups code uses RCU to ensure that a kmod_dup_req instance is freed
only after it is no longer referenced. When releasing an instance, the
kmod_dup_request_delete() function removes the kmod_dup_req from the
dup_kmod_reqs list, waits via synchronize_rcu() and finally frees it.
However, this doesn't work correctly because parallel users referencing the
instance in kmod_dup_request_exists_wait() don't enter an RCU read-side
critical section. This can result in a use-after-free.

The kmod_dup_request_exists_wait() function may need to hold a valid
reference to a kmod_dup_req instance across a blocking wait until the
corresponding modprobe command completes. This makes it unsuitable for RCU.

Fix the issue by changing the lifecycle management of kmod_dup_req to use
reference counting.

Fixes: 8660484ed1cf ("module: add debugging auto-load duplicate module support")
Reviewed-by: Aaron Tomlin &lt;atomlin@atomlin.com&gt;
Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
</content>
</entry>
<entry>
<title>module/dups: Inform duplicate requests about the result directly</title>
<updated>2026-08-06T11:29:03Z</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-08-06T09:10:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=d258ed8a86bb46bbbbc84fb914478259a1e694a4'/>
<id>urn:sha1:d258ed8a86bb46bbbbc84fb914478259a1e694a4</id>
<content type='text'>
When kmod_dup_request_announce() announces the completion of
a request_module() call to duplicate waiters, it queues a work item to
invoke kmod_dup_request_complete(), and only that function calls
complete_all().

This adds an arbitrary delay that is unnecessary and provides little
benefit. Call complete_all() directly from kmod_dup_request_announce()
instead.

Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
</content>
</entry>
<entry>
<title>module: Remove unnecessary module::args</title>
<updated>2026-08-06T11:29:03Z</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-06-04T11:04:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=6b722d1ec0384d2479ae453c994c6546c6093687'/>
<id>urn:sha1:6b722d1ec0384d2479ae453c994c6546c6093687</id>
<content type='text'>
Historically, various parameter-handling code kept pointers into
module::args, most notably the charp support. However, in 2009,
commit e180a6b7759a ("param: fix charp parameters set via sysfs") changed
charp parameters to kstrdup() the input string as well. As a result,
module::args now mostly wastes memory.

The last users that still pointed into module::args have now been cleaned
up, so remove this data.

Reviewed-by: Aaron Tomlin &lt;atomlin@atomlin.com&gt;
Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
</content>
</entry>
<entry>
<title>module: procfs: use matching type for accumulator in module_total_size()</title>
<updated>2026-08-06T11:29:02Z</updated>
<author>
<name>Naveen Kumar Chaudhary</name>
<email>naveen.osdev@gmail.com</email>
</author>
<published>2026-06-07T04:18:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=a3126c746ddfe1cc3f6eee70475a33906e173ece'/>
<id>urn:sha1:a3126c746ddfe1cc3f6eee70475a33906e173ece</id>
<content type='text'>
module_total_size() returns unsigned int but uses a signed int
accumulator. While the result is numerically correct, the type
mismatch is misleading.

Change the accumulator to unsigned int to match the return type.

Signed-off-by: Naveen Kumar Chaudhary &lt;naveen.osdev@gmail.com&gt;
Reviewed-by: Sami Tolvanen &lt;samitolvanen@google.com&gt;
[ppavlu: correct the commit title]
Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
</content>
</entry>
</feed>
