kernel/module/debug_kmemleak.c

Source file repositories/reference/linux-study-clean/kernel/module/debug_kmemleak.c

File Facts

System
Linux kernel
Corpus path
kernel/module/debug_kmemleak.c
Extension
.c
Size
497 bytes
Lines
22
Domain
Core OS
Bucket
Scheduler, Processes, Timers, Sync, And Syscalls
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Module kmemleak support
 *
 * Copyright (C) 2009 Catalin Marinas
 */

#include <linux/module.h>
#include <linux/kmemleak.h>
#include "internal.h"

void kmemleak_load_module(const struct module *mod,
			  const struct load_info *info)
{
	/* only scan writable, non-executable sections */
	for_each_mod_mem_type(type) {
		if (type != MOD_DATA && type != MOD_INIT_DATA &&
		    !mod->mem[type].is_rox)
			kmemleak_no_scan(mod->mem[type].base);
	}
}

Annotation

Implementation Notes