Skip to content

Commit 21e80f3

Browse files
committed
Merge tag 'modules-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux
Pull modules updates from Luis Chamberlain: "The only thing worth highligthing is that gzip moves to use vmalloc() instead of kmalloc just as we had a fix for this for zstd on v6.6-rc1. The rest is regular house keeping, keeping things neat, tidy, and boring" [ The kmalloc -> vmalloc conversion is not the right approach. Unless you know you need huge areas or know you need to use virtual mappings for some reason (playing with protection bits or whatever), you should use kvmalloc()/kvfree, which automatically picks the right allocation model - Linus ] * tag 'modules-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: module: Annotate struct module_notes_attrs with __counted_by module: Fix comment typo module: Make is_valid_name() return bool module: Make is_mapping_symbol() return bool module/decompress: use vmalloc() for gzip decompression workspace MAINTAINERS: add include/linux/module*.h to modules module: Clarify documentation of module_param_call()
2 parents 426ee51 + ea0b0bc commit 21e80f3

File tree

7 files changed

+13
-9
lines changed

7 files changed

+13
-9
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14527,7 +14527,7 @@ L: [email protected]
1452714527
S: Maintained
1452814528
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git modules-next
1452914529
F: include/linux/kmod.h
14530-
F: include/linux/module.h
14530+
F: include/linux/module*.h
1453114531
F: kernel/module/
1453214532
F: lib/test_kmod.c
1453314533
F: scripts/module*

include/linux/module_symbol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#define _LINUX_MODULE_SYMBOL_H
44

55
/* This ignores the intensely annoying "mapping symbols" found in ELF files. */
6-
static inline int is_mapping_symbol(const char *str)
6+
static inline bool is_mapping_symbol(const char *str)
77
{
88
if (str[0] == '.' && str[1] == 'L')
99
return true;

include/linux/moduleparam.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,11 @@ struct kparam_array
293293
= { __param_str_##name, THIS_MODULE, ops, \
294294
VERIFY_OCTAL_PERMISSIONS(perm), level, flags, { arg } }
295295

296-
/* Obsolete - use module_param_cb() */
296+
/*
297+
* Useful for describing a set/get pair used only once (i.e. for this
298+
* parameter). For repeated set/get pairs (i.e. the same struct
299+
* kernel_param_ops), use module_param_cb() instead.
300+
*/
297301
#define module_param_call(name, _set, _get, arg, perm) \
298302
static const struct kernel_param_ops __param_ops_##name = \
299303
{ .flags = 0, .set = _set, .get = _get }; \

kernel/module/decompress.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static ssize_t module_gzip_decompress(struct load_info *info,
100100
s.next_in = buf + gzip_hdr_len;
101101
s.avail_in = size - gzip_hdr_len;
102102

103-
s.workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
103+
s.workspace = vmalloc(zlib_inflate_workspacesize());
104104
if (!s.workspace)
105105
return -ENOMEM;
106106

@@ -138,7 +138,7 @@ static ssize_t module_gzip_decompress(struct load_info *info,
138138
out_inflate_end:
139139
zlib_inflateEnd(&s);
140140
out:
141-
kfree(s.workspace);
141+
vfree(s.workspace);
142142
return retval;
143143
}
144144
#elif defined(CONFIG_MODULE_COMPRESS_XZ)

kernel/module/stats.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static LIST_HEAD(dup_failed_modules);
126126
* These typically should not happen unless your system is under memory
127127
* pressure.
128128
* * invalid_becoming_bytes: total number of bytes allocated and freed used
129-
* used to read the kernel module userspace wants us to read before we
129+
* to read the kernel module userspace wants us to read before we
130130
* promote it to be processed to be added to our @modules linked list. These
131131
* failures can happen if we had a check in between a successful kernel_read_file_from_fd()
132132
* call and right before we allocate the our private memory for the module

kernel/module/sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static void remove_sect_attrs(struct module *mod)
143143
struct module_notes_attrs {
144144
struct kobject *dir;
145145
unsigned int notes;
146-
struct bin_attribute attrs[];
146+
struct bin_attribute attrs[] __counted_by(notes);
147147
};
148148

149149
static ssize_t module_notes_read(struct file *filp, struct kobject *kobj,

scripts/mod/modpost.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,12 +1059,12 @@ static int secref_whitelist(const char *fromsec, const char *fromsym,
10591059
* only by merging __exit and __init sections into __text, bloating
10601060
* the kernel (which is especially evil on embedded platforms).
10611061
*/
1062-
static inline int is_valid_name(struct elf_info *elf, Elf_Sym *sym)
1062+
static inline bool is_valid_name(struct elf_info *elf, Elf_Sym *sym)
10631063
{
10641064
const char *name = elf->strtab + sym->st_name;
10651065

10661066
if (!name || !strlen(name))
1067-
return 0;
1067+
return false;
10681068
return !is_mapping_symbol(name);
10691069
}
10701070

0 commit comments

Comments
 (0)