On Sat, Dec 12, 2015 at 05:09:07PM +0100, Sebastian Herbszt wrote:
Larry Finger wrote:
On 12/10/2015 05:07 PM, Sebastian Herbszt wrote:
Hello,
I am getting the following warning on 4.4.0-rc4-1.g923c13b-vanilla while loading a simple kernel module:
[ 499.783288] init_module() [ 499.783301] ------------[ cut here ]------------ [ 499.783322] WARNING: CPU: 0 PID: 2126 at ../kernel/module.c:1124 module_put+0xac/0xc0() [ 499.783324] Modules linked in: h(O) xfs libcrc32c dm_mod sr_mod cdrom irda ata_generic floppy e1000 ppdev vmw_balloon fjes joydev i2c_piix4 8250_fintek crc_ccitt vmw_vmci ata_piix parport_pc parport shpchp mptctl pcspkr acpi_cpufreq battery tpm_tis tpm button ac sg mptspi mptscsih mptbase scsi_transport_spi vmwgfx ttm drm_kms_helper drm fb_sys_fops sysimgblt sysfillrect syscopyarea scsi_dh_alua scsi_dh_emc scsi_dh_rdac scsi_dh_hp_sw [ 499.783377] CPU: 0 PID: 2126 Comm: insmod Tainted: G O 4.4.0-rc4-1.g923c13b-vanilla #1 [ 499.783381] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2012 [ 499.783384] ffffffff81a5cee9 ffff88000019fcc8 ffffffff8137ada9 0000000000000000 [ 499.783390] ffff88000019fd00 ffffffff8107c1f2 ffffffffa01db000 ffffffffa01db000 [ 499.783394] ffff880037c55600 0000000000000001 ffffffffa01db000 ffff88000019fd10 [ 499.783398] Call Trace: [ 499.783459] [<ffffffff8137ada9>] dump_stack+0x4b/0x72 [ 499.783476] [<ffffffff8107c1f2>] warn_slowpath_common+0x82/0xc0 [ 499.783484] [<ffffffff8107c2ea>] warn_slowpath_null+0x1a/0x20 [ 499.783488] [<ffffffff810fd52c>] module_put+0xac/0xc0 [ 499.783502] [<ffffffff811810d7>] do_init_module+0xd5/0x1e5 [ 499.783508] [<ffffffff81101f99>] load_module+0x15d9/0x1b30 [ 499.783513] [<ffffffff810fe190>] ? __symbol_put+0x50/0x50 [ 499.783522] [<ffffffff81102615>] SyS_init_module+0x125/0x160 [ 499.783534] [<ffffffff816a4db6>] entry_SYSCALL_64_fastpath+0x16/0x75 [ 499.783538] ---[ end trace 57f0d89c0b9a5063 ]---
This warning does not appear on 4.4.0-rc4-1.g923c13b-default.
The module source is:
#include
#include int init_module(void) { printk(KERN_INFO "init_module()\n"); return 0; }
void cleanup_module(void) { printk(KERN_INFO "cleanup_module()\n"); }
MODULE_LICENSE("GPL");
Sebastian
It is possible that the default start and end module names are no longer sufficient. Try adding the following macros:
Adding
module_init(init_module); module_exit(cleanup_module);
resulted in
/usr/src/linux-4.4.0-rc4-1.g923c13b/include/linux/module.h:130:6: error: redefinition of ‘init_module’ int init_module(void) __attribute__((alias(#initfn)));
so I changed the module to:
#include
#include int init_module2(void) { printk(KERN_INFO "init_module()\n"); return 0; }
void cleanup_module2(void) { printk(KERN_INFO "cleanup_module()\n"); }
module_init(init_module2); module_exit(cleanup_module2);
MODULE_LICENSE("GPL");
The above fucntions should be static, i.e.: static int __init init_module2(void) { [...] return 0; } module_init(init_module2); static void __exit cleanup_module2(void) { [...] } module_exit(cleanup_module2);
This did not fix the warning.
Larry
Sebastian -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
-- Johannes Thumshirn Storage jthumshirn@suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850 -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org