1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:48:14 +00:00

Kernel: Forbid empty and whitespace-only process names

Those only exist to confuse the user anyway.

Found while using fuzz-syscalls.
This commit is contained in:
Ben Wiederhake 2021-02-11 20:11:05 +01:00 committed by Andreas Kling
parent 4c42d1e35a
commit 987b7f7917

View file

@ -60,6 +60,9 @@ int Process::sys$set_process_name(Userspace<const char*> user_name, size_t user_
auto name = copy_string_from_user(user_name, user_name_length);
if (name.is_null())
return -EFAULT;
// Empty and whitespace-only names only exist to confuse users.
if (name.is_whitespace())
return -EINVAL;
m_name = move(name);
return 0;
}