Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933879Ab1FWRn7 (ORCPT ); Thu, 23 Jun 2011 13:43:59 -0400 Received: from mail.windriver.com ([147.11.1.11]:35616 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933831Ab1FWRik (ORCPT ); Thu, 23 Jun 2011 13:38:40 -0400 From: Paul Gortmaker To: stable@kernel.org, linux-kernel@vger.kernel.org Cc: stable-review@kernel.org, Kulikov Vasiliy , "David S. Miller" , Paul Gortmaker Subject: [34-longterm 233/247] net: tipc: fix information leak to userland Date: Thu, 23 Jun 2011 13:35:01 -0400 Message-Id: <1308850515-15242-174-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1308850515-15242-1-git-send-email-paul.gortmaker@windriver.com> References: <1308849690-14530-1-git-send-email-paul.gortmaker@windriver.com> <1308850515-15242-1-git-send-email-paul.gortmaker@windriver.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1509 Lines: 40 From: Kulikov Vasiliy ------------------- This is a commit scheduled for the next v2.6.34 longterm release. If you see a problem with using this for longterm, please comment. ------------------- commit 88f8a5e3e7defccd3925cabb1ee4d3994e5cdb52 upstream. Structure sockaddr_tipc is copied to userland with padding bytes after "id" field in union field "name" unitialized. It leads to leaking of contents of kernel stack memory. We have to initialize them to zero. Signed-off-by: Vasiliy Kulikov Signed-off-by: David S. Miller Signed-off-by: Paul Gortmaker --- net/tipc/socket.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index cfb20b8..a70214a 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -395,6 +395,7 @@ static int get_name(struct socket *sock, struct sockaddr *uaddr, struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr; struct tipc_sock *tsock = tipc_sk(sock->sk); + memset(addr, 0, sizeof(*addr)); if (peer) { if ((sock->state != SS_CONNECTED) && ((peer != 2) || (sock->state != SS_DISCONNECTING))) -- 1.7.4.4 -- 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/