Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'modules-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux

Pull module updates from Luis Chamberlain:

- minor enhancement for sysfs compression string (David Disseldorp)

- debugfs interface to view unloaded tainted modules (Aaron Tomlin)

* tag 'modules-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux:
module/decompress: generate sysfs string at compile time
module: Add debugfs interface to view unloaded tainted modules

+69 -1
+1 -1
kernel/module/decompress.c
··· 256 256 static ssize_t compression_show(struct kobject *kobj, 257 257 struct kobj_attribute *attr, char *buf) 258 258 { 259 - return sysfs_emit(buf, "%s\n", __stringify(MODULE_COMPRESSION)); 259 + return sysfs_emit(buf, __stringify(MODULE_COMPRESSION) "\n"); 260 260 } 261 261 262 262 static struct kobj_attribute module_compression_attr = __ATTR_RO(compression);
+68
kernel/module/tracking.c
··· 10 10 #include <linux/printk.h> 11 11 #include <linux/slab.h> 12 12 #include <linux/list.h> 13 + #include <linux/debugfs.h> 13 14 #include <linux/rculist.h> 14 15 #include "internal.h" 15 16 ··· 60 59 } 61 60 } 62 61 } 62 + 63 + #ifdef CONFIG_DEBUG_FS 64 + static void *unloaded_tainted_modules_seq_start(struct seq_file *m, loff_t *pos) 65 + __acquires(rcu) 66 + { 67 + rcu_read_lock(); 68 + return seq_list_start_rcu(&unloaded_tainted_modules, *pos); 69 + } 70 + 71 + static void *unloaded_tainted_modules_seq_next(struct seq_file *m, void *p, loff_t *pos) 72 + { 73 + return seq_list_next_rcu(p, &unloaded_tainted_modules, pos); 74 + } 75 + 76 + static void unloaded_tainted_modules_seq_stop(struct seq_file *m, void *p) 77 + __releases(rcu) 78 + { 79 + rcu_read_unlock(); 80 + } 81 + 82 + static int unloaded_tainted_modules_seq_show(struct seq_file *m, void *p) 83 + { 84 + struct mod_unload_taint *mod_taint; 85 + char buf[MODULE_FLAGS_BUF_SIZE]; 86 + size_t l; 87 + 88 + mod_taint = list_entry(p, struct mod_unload_taint, list); 89 + l = module_flags_taint(mod_taint->taints, buf); 90 + buf[l++] = '\0'; 91 + 92 + seq_printf(m, "%s (%s) %llu", mod_taint->name, buf, mod_taint->count); 93 + seq_puts(m, "\n"); 94 + 95 + return 0; 96 + } 97 + 98 + static const struct seq_operations unloaded_tainted_modules_seq_ops = { 99 + .start = unloaded_tainted_modules_seq_start, 100 + .next = unloaded_tainted_modules_seq_next, 101 + .stop = unloaded_tainted_modules_seq_stop, 102 + .show = unloaded_tainted_modules_seq_show, 103 + }; 104 + 105 + static int unloaded_tainted_modules_open(struct inode *inode, struct file *file) 106 + { 107 + return seq_open(file, &unloaded_tainted_modules_seq_ops); 108 + } 109 + 110 + static const struct file_operations unloaded_tainted_modules_fops = { 111 + .open = unloaded_tainted_modules_open, 112 + .read = seq_read, 113 + .llseek = seq_lseek, 114 + .release = seq_release, 115 + }; 116 + 117 + static int __init unloaded_tainted_modules_init(void) 118 + { 119 + struct dentry *dir; 120 + 121 + dir = debugfs_create_dir("modules", NULL); 122 + debugfs_create_file("unloaded_tainted", 0444, dir, NULL, 123 + &unloaded_tainted_modules_fops); 124 + 125 + return 0; 126 + } 127 + module_init(unloaded_tainted_modules_init); 128 + #endif /* CONFIG_DEBUG_FS */