<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/params.c, branch v6.14</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-01-26T12:05:23Z</updated>
<entry>
<title>module: Constify 'struct module_attribute'</title>
<updated>2025-01-26T12:05:23Z</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-12-16T17:25:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f3227ffda07470848abe3cfa2039b21816ce3090'/>
<id>urn:sha1:f3227ffda07470848abe3cfa2039b21816ce3090</id>
<content type='text'>
These structs are never modified, move them to read-only memory.
This makes the API clearer and also prepares for the constification of
'struct attribute' itself.

While at it, also constify 'modinfo_attrs_count'.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Reviewed-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
Link: https://lore.kernel.org/r/20241216-sysfs-const-attr-module-v1-3-3790b53e0abf@weissschuh.net
Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
</content>
</entry>
<entry>
<title>module: Handle 'struct module_version_attribute' as const</title>
<updated>2025-01-26T12:05:23Z</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-12-16T17:25:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=38e3fe6595e1fa806c0450b2db666bc46325025e'/>
<id>urn:sha1:38e3fe6595e1fa806c0450b2db666bc46325025e</id>
<content type='text'>
The structure is always read-only due to its placement in the read-only
section __modver. Reflect this at its usage sites.
Also prepare for the const handling of 'struct module_attribute' itself.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Reviewed-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
Link: https://lore.kernel.org/r/20241216-sysfs-const-attr-module-v1-2-3790b53e0abf@weissschuh.net
Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
</content>
</entry>
<entry>
<title>params: Prepare for 'const struct module_attribute *'</title>
<updated>2025-01-26T12:05:23Z</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-12-16T17:25:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=30d446088866db99b0cf9e6af58ac1427f51f3dd'/>
<id>urn:sha1:30d446088866db99b0cf9e6af58ac1427f51f3dd</id>
<content type='text'>
The 'struct module_attribute' sysfs callbacks are about to change to
receive a 'const struct module_attribute *' parameter.
Prepare for that by avoid casting away the constness through
container_of() and using const pointers to 'struct param_attribute'.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Reviewed-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
Link: https://lore.kernel.org/r/20241216-sysfs-const-attr-module-v1-1-3790b53e0abf@weissschuh.net
Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
</content>
</entry>
<entry>
<title>params: Fix multi-line comment style</title>
<updated>2023-12-01T17:51:44Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2023-11-20T15:11:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b5e3f86a47d34f7b8af899f8cc70520f6daf8b53'/>
<id>urn:sha1:b5e3f86a47d34f7b8af899f8cc70520f6daf8b53</id>
<content type='text'>
The multi-line comment style in the file is rather arbitrary.
Make it follow the standard one.

Reviewed-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20231120151419.1661807-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>params: Sort headers</title>
<updated>2023-12-01T17:51:44Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2023-11-20T15:11:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a05f096c2c0ca52e8fd34740c7d4b53ab3e7123e'/>
<id>urn:sha1:a05f096c2c0ca52e8fd34740c7d4b53ab3e7123e</id>
<content type='text'>
Sort the headers in alphabetic order in order to ease
the maintenance for this part.

Reviewed-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20231120151419.1661807-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>params: Use size_add() for kmalloc()</title>
<updated>2023-12-01T17:51:43Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2023-11-20T15:11:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0fc79cbc937f2a754a302a710a94b68c61d0a89a'/>
<id>urn:sha1:0fc79cbc937f2a754a302a710a94b68c61d0a89a</id>
<content type='text'>
Prevent allocations from integer overflow by using size_add().

Reviewed-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20231120151419.1661807-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>params: Do not go over the limit when getting the string length</title>
<updated>2023-12-01T17:51:43Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2023-11-20T15:11:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fd0cd057a1b7351604daa6ffc91dfe28adf7225d'/>
<id>urn:sha1:fd0cd057a1b7351604daa6ffc91dfe28adf7225d</id>
<content type='text'>
We can use strnlen() even on early stages and it prevents from
going over the string boundaries in case it's already too long.

Reviewed-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20231120151419.1661807-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>params: Introduce the param_unknown_fn type</title>
<updated>2023-12-01T17:51:43Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2023-11-20T15:11:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=12cd3cd8c797e07afcc47bc4afa760e4ec75e9d7'/>
<id>urn:sha1:12cd3cd8c797e07afcc47bc4afa760e4ec75e9d7</id>
<content type='text'>
Introduce a new type for the callback to parse an unknown argument.
This unifies function prototypes which takes that as a parameter.

Reviewed-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20231120151419.1661807-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>kernel: params: Remove unnecessary ‘0’ values from err</title>
<updated>2023-07-10T19:47:01Z</updated>
<author>
<name>Li zeming</name>
<email>zeming@nfschina.com</email>
</author>
<published>2023-07-11T19:43:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9ce170cef66916526dcaa868a67cfcc0c2f0c3d6'/>
<id>urn:sha1:9ce170cef66916526dcaa868a67cfcc0c2f0c3d6</id>
<content type='text'>
err is assigned first, so it does not need to initialize the assignment.

Signed-off-by: Li zeming &lt;zeming@nfschina.com&gt;
Reviewed-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
</content>
</entry>
<entry>
<title>kallsyms: Replace all non-returning strlcpy with strscpy</title>
<updated>2023-06-14T19:27:38Z</updated>
<author>
<name>Azeem Shaikh</name>
<email>azeemshaikh38@gmail.com</email>
</author>
<published>2023-06-14T01:03:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=33457938a0c4e817ab6f9923e244b91289f47f54'/>
<id>urn:sha1:33457938a0c4e817ab6f9923e244b91289f47f54</id>
<content type='text'>
strlcpy() reads the entire source buffer first.
This read may exceed the destination size limit.
This is both inefficient and can lead to linear read
overflows if a source string is not NUL-terminated [1].
In an effort to remove strlcpy() completely [2], replace
strlcpy() here with strscpy().
No return values were used, so direct replacement is safe.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
[2] https://github.com/KSPP/linux/issues/89

Signed-off-by: Azeem Shaikh &lt;azeemshaikh38@gmail.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20230614010354.1026096-1-azeemshaikh38@gmail.com
</content>
</entry>
</feed>
