Public bug reported:
When running stress-ng sysinval stressor, I got a panic from an
unrecoverable OOM.
This happens because stress-ng will call init_module with a module
length of INT_MAX and that will allocate that much memory with vmalloc,
which is not accountable for the process. This memory is freed by using
vfree right after that, but when you run 4 to 8 stressors on a VM with
~8GiB of RAM, that might trigger OOM and there will be no way to
recover, causing a panic.
Using __GFP_RETRY_MAYFAIL for both init_module and kernel_read_file
(called by finit_module), alleviates the problem, but does not solve it,
as other allocators will trigger OOM.
Module loading is an operation that is considered trusted, so it will be
hard to do many changes in that path, so we might consider not stressing
the system like that in our testing.
Cascardo.
** Affects: linux (Ubuntu)
Importance: Low
Assignee: Thadeu Lima de Souza Cascardo (cascardo)
Status: Incomplete
** Affects: stress-ng (Ubuntu)
Importance: Low
Assignee: Colin Ian King (colin-king)
Status: New
** Also affects: stress-ng (Ubuntu)
Importance: Undecided
Status: New
** Changed in: stress-ng (Ubuntu)
Assignee: (unassigned) => Colin Ian King (colin-king)
** Changed in: linux (Ubuntu)
Assignee: (unassigned) => Thadeu Lima de Souza Cascardo (cascardo)
** Changed in: stress-ng (Ubuntu)
Importance: Undecided => Low
** Changed in: linux (Ubuntu)
Importance: Undecided => Low
--
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1906447
Title:
init_module may pin a lot of memory if given a bogus size
Status in linux package in Ubuntu:
Incomplete
Status in stress-ng package in Ubuntu:
New
Bug description:
When running stress-ng sysinval stressor, I got a panic from an
unrecoverable OOM.
This happens because stress-ng will call init_module with a module
length of INT_MAX and that will allocate that much memory with
vmalloc, which is not accountable for the process. This memory is
freed by using vfree right after that, but when you run 4 to 8
stressors on a VM with ~8GiB of RAM, that might trigger OOM and there
will be no way to recover, causing a panic.
Using __GFP_RETRY_MAYFAIL for both init_module and kernel_read_file
(called by finit_module), alleviates the problem, but does not solve
it, as other allocators will trigger OOM.
Module loading is an operation that is considered trusted, so it will
be hard to do many changes in that path, so we might consider not
stressing the system like that in our testing.
Cascardo.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1906447/+subscriptions
--
Mailing list: https://launchpad.net/~kernel-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~kernel-packages
More help : https://help.launchpad.net/ListHelp