0001
0002
0003
0004
0005
0006
0007
0008 #include <linux/module.h>
0009 #include <linux/kmemleak.h>
0010 #include "internal.h"
0011
0012 void kmemleak_load_module(const struct module *mod,
0013 const struct load_info *info)
0014 {
0015 unsigned int i;
0016
0017
0018 kmemleak_scan_area(mod, sizeof(struct module), GFP_KERNEL);
0019
0020 for (i = 1; i < info->hdr->e_shnum; i++) {
0021
0022 if (!(info->sechdrs[i].sh_flags & SHF_ALLOC) ||
0023 !(info->sechdrs[i].sh_flags & SHF_WRITE) ||
0024 (info->sechdrs[i].sh_flags & SHF_EXECINSTR))
0025 continue;
0026
0027 kmemleak_scan_area((void *)info->sechdrs[i].sh_addr,
0028 info->sechdrs[i].sh_size, GFP_KERNEL);
0029 }
0030 }