mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +00:00
Kernel+ping: Only allow superuser to create SOCK_RAW sockets
/bin/ping is now setuid-root, and will drop privileges immediately after opening a raw socket.
This commit is contained in:
@@ -2609,6 +2609,8 @@ size_t Process::amount_purgeable_nonvolatile() const
|
||||
|
||||
int Process::sys$socket(int domain, int type, int protocol)
|
||||
{
|
||||
if ((type & SOCK_TYPE_MASK) == SOCK_RAW && !is_superuser())
|
||||
return -EACCES;
|
||||
int fd = alloc_fd();
|
||||
if (fd < 0)
|
||||
return fd;
|
||||
|
||||
Reference in New Issue
Block a user