<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/kernel/module, branch master</title>
<subtitle>Linux kernel mainline source</subtitle>
<id>http://mirrors.hust.edu.cn/git/linux.git/atom?h=master</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/linux.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/'/>
<updated>2026-08-06T14:44:45+00:00</updated>
<entry>
<title>module: validate string table section types</title>
<updated>2026-08-06T14:44:45+00:00</updated>
<author>
<name>Thiébaud Weksteen</name>
<email>tweek@google.com</email>
</author>
<published>2026-07-08T01:21:07+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/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:03+00:00</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-08-06T09:10:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/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:03+00:00</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-08-06T09:10:19+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/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:03+00:00</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-08-06T09:10:18+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/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:03+00:00</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-08-06T09:10:17+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/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:03+00:00</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-08-06T09:10:16+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/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:03+00:00</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-08-06T09:10:15+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/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:03+00:00</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-06-04T11:04:46+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/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:02+00:00</updated>
<author>
<name>Naveen Kumar Chaudhary</name>
<email>naveen.osdev@gmail.com</email>
</author>
<published>2026-06-07T04:18:58+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/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>
<entry>
<title>module: use strscpy() to copy module names in stats and dup tracking</title>
<updated>2026-08-06T11:29:02+00:00</updated>
<author>
<name>Naveen Kumar Chaudhary</name>
<email>naveen.osdev@gmail.com</email>
</author>
<published>2026-06-04T17:45:02+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/commit/?id=93c29ebd1622fb0670701e1c1b3a978a5cac08b7'/>
<id>urn:sha1:93c29ebd1622fb0670701e1c1b3a978a5cac08b7</id>
<content type='text'>
Both try_add_failed_module() and kmod_dup_request_exists_wait() use
memcpy() with strlen() to copy module names into fixed-size
char[MODULE_NAME_LEN] buffers. Neither performs a bounds check on the
copy. Current callers always pass names originating from
mod-&gt;name (itself char[MODULE_NAME_LEN]), so this is not exploitable
today. However both functions accept a plain const char * with no
documented length contract, making them latent buffer overflows if a
future caller passes a longer string.

Replace memcpy() with strscpy() in both sites, which bounds the copy
to MODULE_NAME_LEN and always NUL-terminates.

Signed-off-by: Naveen Kumar Chaudhary &lt;naveen.osdev@gmail.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>
</feed>
