<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/module/internal.h, branch v6.0.15</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.0.15</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.0.15'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-07-15T00:40:23Z</updated>
<entry>
<title>module: Modify module_flags() to accept show_state argument</title>
<updated>2022-07-15T00:40:23Z</updated>
<author>
<name>Aaron Tomlin</name>
<email>atomlin@redhat.com</email>
</author>
<published>2022-07-14T15:39:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=17dd25c29cda98c370f8d5a4ae3daee33fac1669'/>
<id>urn:sha1:17dd25c29cda98c370f8d5a4ae3daee33fac1669</id>
<content type='text'>
No functional change.

With this patch a given module's state information (i.e. 'mod-&gt;state')
can be omitted from the specified buffer. Please note that this is in
preparation to include the last unloaded module's taint flag(s),
if available.

Signed-off-by: Aaron Tomlin &lt;atomlin@redhat.com&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
</entry>
<entry>
<title>module: Fix selfAssignment cppcheck warning</title>
<updated>2022-07-01T21:44:17Z</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@csgroup.eu</email>
</author>
<published>2022-06-12T15:21:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cfa94c538be621a0ba645adfa9ead005b5fa02f6'/>
<id>urn:sha1:cfa94c538be621a0ba645adfa9ead005b5fa02f6</id>
<content type='text'>
cppcheck reports the following warnings:

kernel/module/main.c:1455:26: warning: Redundant assignment of 'mod-&gt;core_layout.size' to itself. [selfAssignment]
   mod-&gt;core_layout.size = strict_align(mod-&gt;core_layout.size);
                         ^
kernel/module/main.c:1489:26: warning: Redundant assignment of 'mod-&gt;init_layout.size' to itself. [selfAssignment]
   mod-&gt;init_layout.size = strict_align(mod-&gt;init_layout.size);
                         ^
kernel/module/main.c:1493:26: warning: Redundant assignment of 'mod-&gt;init_layout.size' to itself. [selfAssignment]
   mod-&gt;init_layout.size = strict_align(mod-&gt;init_layout.size);
                         ^
kernel/module/main.c:1504:26: warning: Redundant assignment of 'mod-&gt;init_layout.size' to itself. [selfAssignment]
   mod-&gt;init_layout.size = strict_align(mod-&gt;init_layout.size);
                         ^
kernel/module/main.c:1459:26: warning: Redundant assignment of 'mod-&gt;data_layout.size' to itself. [selfAssignment]
   mod-&gt;data_layout.size = strict_align(mod-&gt;data_layout.size);
                         ^
kernel/module/main.c:1463:26: warning: Redundant assignment of 'mod-&gt;data_layout.size' to itself. [selfAssignment]
   mod-&gt;data_layout.size = strict_align(mod-&gt;data_layout.size);
                         ^
kernel/module/main.c:1467:26: warning: Redundant assignment of 'mod-&gt;data_layout.size' to itself. [selfAssignment]
   mod-&gt;data_layout.size = strict_align(mod-&gt;data_layout.size);
                         ^

This is due to strict_align() being a no-op when
CONFIG_STRICT_MODULE_RWX is not selected.

Transform strict_align() macro into an inline function. It will
allow type checking and avoid the selfAssignment warning.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
</entry>
<entry>
<title>module: Introduce module unload taint tracking</title>
<updated>2022-05-12T17:29:41Z</updated>
<author>
<name>Aaron Tomlin</name>
<email>atomlin@redhat.com</email>
</author>
<published>2022-05-02T20:52:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=99bd9956551b27cb6f5b445abaced7e13b9976cd'/>
<id>urn:sha1:99bd9956551b27cb6f5b445abaced7e13b9976cd</id>
<content type='text'>
Currently, only the initial module that tainted the kernel is
recorded e.g. when an out-of-tree module is loaded.

The purpose of this patch is to allow the kernel to maintain a record of
each unloaded module that taints the kernel. So, in addition to
displaying a list of linked modules (see print_modules()) e.g. in the
event of a detected bad page, unloaded modules that carried a taint/or
taints are displayed too. A tainted module unload count is maintained.

The number of tracked modules is not fixed. This feature is disabled by
default.

Signed-off-by: Aaron Tomlin &lt;atomlin@redhat.com&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
</entry>
<entry>
<title>module: Move module_assert_mutex_or_preempt() to internal.h</title>
<updated>2022-05-12T17:29:41Z</updated>
<author>
<name>Aaron Tomlin</name>
<email>atomlin@redhat.com</email>
</author>
<published>2022-05-02T20:51:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6fb0538d0121ffab770a505b183968d93466ad59'/>
<id>urn:sha1:6fb0538d0121ffab770a505b183968d93466ad59</id>
<content type='text'>
No functional change.

This patch migrates module_assert_mutex_or_preempt() to internal.h.
So, the aforementiond function can be used outside of main/or core
module code yet will remain restricted for internal use only.

Signed-off-by: Aaron Tomlin &lt;atomlin@redhat.com&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
</entry>
<entry>
<title>module: Make module_flags_taint() accept a module's taints bitmap and usable outside core code</title>
<updated>2022-05-12T17:29:41Z</updated>
<author>
<name>Aaron Tomlin</name>
<email>atomlin@redhat.com</email>
</author>
<published>2022-05-02T20:51:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c14e522bc76efed6e947cd0ab83a1fac7a7a3ec9'/>
<id>urn:sha1:c14e522bc76efed6e947cd0ab83a1fac7a7a3ec9</id>
<content type='text'>
No functional change.

The purpose of this patch is to modify module_flags_taint() to accept
a module's taints bitmap as a parameter and modifies all users
accordingly. Furthermore, it is now possible to access a given
module's taint flags data outside of non-essential code yet does
remain for internal use only.

This is in preparation for module unload taint tracking support.

Signed-off-by: Aaron Tomlin &lt;atomlin@redhat.com&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
</entry>
<entry>
<title>module: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC</title>
<updated>2022-04-05T15:43:05Z</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@csgroup.eu</email>
</author>
<published>2022-02-23T12:02:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=01dc0386efb769056257410ba5754558384006a7'/>
<id>urn:sha1:01dc0386efb769056257410ba5754558384006a7</id>
<content type='text'>
Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC to allow architectures
to request having modules data in vmalloc area instead of module area.

This is required on powerpc book3s/32 in order to set data non
executable, because it is not possible to set executability on page
basis, this is done per 256 Mbytes segments. The module area has exec
right, vmalloc area has noexec.

This can also be useful on other powerpc/32 in order to maximize the
chance of code being close enough to kernel core to avoid branch
trampolines.

Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Acked-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Cc: Douglas Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
[mcgrof: rebased in light of kernel/module/kdb.c move]
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
</entry>
<entry>
<title>module: Introduce data_layout</title>
<updated>2022-04-05T15:43:05Z</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@csgroup.eu</email>
</author>
<published>2022-02-23T12:02:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6ab9942c44b2d213a16b2620e4baf0223122222f'/>
<id>urn:sha1:6ab9942c44b2d213a16b2620e4baf0223122222f</id>
<content type='text'>
In order to allow separation of data from text, add another layout,
called data_layout. For architectures requesting separation of text
and data, only text will go in core_layout and data will go in
data_layout.

For architectures which keep text and data together, make data_layout
an alias of core_layout, that way data_layout can be used for all
data manipulations, regardless of whether data is in core_layout or
data_layout.

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
</entry>
<entry>
<title>module: Prepare for handling several RB trees</title>
<updated>2022-04-05T15:43:05Z</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@csgroup.eu</email>
</author>
<published>2022-02-23T12:02:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=446d55666d5599ca58c1ceac25ce4b5191e70835'/>
<id>urn:sha1:446d55666d5599ca58c1ceac25ce4b5191e70835</id>
<content type='text'>
In order to separate text and data, we need to setup
two rb trees.

Modify functions to give the tree as a parameter.

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
</entry>
<entry>
<title>module: Always have struct mod_tree_root</title>
<updated>2022-04-05T15:43:05Z</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@csgroup.eu</email>
</author>
<published>2022-02-23T12:02:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=80b8bf4369906aefbcb63a03012aed7a1abcbd18'/>
<id>urn:sha1:80b8bf4369906aefbcb63a03012aed7a1abcbd18</id>
<content type='text'>
In order to separate text and data, we need to setup
two rb trees.

This means that struct mod_tree_root is required even without
MODULES_TREE_LOOKUP.

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Reviewed-by: Aaron Tomlin &lt;atomlin@atomlin.com&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
</entry>
<entry>
<title>module: Rename debug_align() as strict_align()</title>
<updated>2022-04-05T15:43:04Z</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@csgroup.eu</email>
</author>
<published>2022-02-23T09:01:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7337f929d5672e37a80c8582d357f084320f475f'/>
<id>urn:sha1:7337f929d5672e37a80c8582d357f084320f475f</id>
<content type='text'>
debug_align() was added by commit 84e1c6bb38eb ("x86: Add RO/NX
protection for loadable kernel modules")

At that time the config item was CONFIG_DEBUG_SET_MODULE_RONX.

But nowadays it has changed to CONFIG_STRICT_MODULE_RWX and
debug_align() is confusing because it has nothing to do with
DEBUG.

Rename it strict_align()

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
</entry>
</feed>
