History

alloc_tag: handle module codetag load errors as module load failures

Failures inside codetag_load_module() are currently ignored. As a result an error there would not cause a module load failure and freeing of the associated resources. Correct this behavior by propagating the error code to the caller and handling possible errors. With this change, error to allocate percpu counters, which happens at this stage, will not be ignored and will cause a module load failure and freeing of resources. With this change we also do not need to disable memory allocation profiling when this error happens, instead we fail to load the module.

Suren Baghdasaryan committed 1 year ago

Commit 044d2ae1 parent 9c49e5d4 files · +39 −20Browse files

Showing the changes to kernel/module (1 of 4 files). Show all

Unified · Split

kernel/module/main.c+3−2
@@ -3386,11 +3386,12 @@ static int load_module(struct load_info *info, const char __user *uargs, · 3385 unmodified lines
33863386 goto sysfs_cleanup;
33873387 }
33883388
3389+ if (codetag_load_module(mod))
3390+ goto sysfs_cleanup;
3391+
33893392 /* Get rid of temporary copy. */
33903393 free_copy(info, flags);
33913394
3392− codetag_load_module(mod);
3393−
33943395 /* Done! */
33953396 trace_module_load(mod);
33963397

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t