From patchwork Sat Oct 30 14:26:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kulikov Vasiliy X-Patchwork-Id: 69661 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2C218B7043 for ; Sun, 31 Oct 2010 01:28:43 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754209Ab0J3O0l (ORCPT ); Sat, 30 Oct 2010 10:26:41 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]:40880 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754177Ab0J3O0g (ORCPT ); Sat, 30 Oct 2010 10:26:36 -0400 Received: by mail-ew0-f46.google.com with SMTP id 7so2736955ewy.19 for ; Sat, 30 Oct 2010 07:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=34ij9/ilGR8y0/pqI2boR+eX0Yi5z7CV7bmq8L5ezfI=; b=Ao5JZ6CLMwiNdfIljvWtkD5SpTjfJsPnflgCU2GDIWVwbxHinarOUF+RyKxHLqNCEo XQAbgmKFmJMe9VbI8+Hul2pGndLOLGVHabc6Cj7oW/iUNtadpxeWrNxX9rQY5/AOlBXI WtXyyqdZa6tgpkYMVAU0u8FhJYEmZOZZ2YVuU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=T9w/cBSDClPLflX1NwxTwvmxkjmvqsP3abEIG9oLBg7GdXuHl4CR0icFu1CSiOmCdW zlPrmcG+Gc+JUlD3Sb1hnHgaAGx0V5cdYZ6V9782M645GGgLFh7CkmInrOpGLbvba5jh 4y6adJ9svvjVVOnzvXvh1pvupcF72kZc/x/DQ= Received: by 10.213.5.19 with SMTP id 19mr146021ebt.9.1288448795473; Sat, 30 Oct 2010 07:26:35 -0700 (PDT) Received: from localhost (ppp91-78-210-135.pppoe.mtu-net.ru [91.78.210.135]) by mx.google.com with ESMTPS id w20sm2614919eeh.0.2010.10.30.07.26.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 30 Oct 2010 07:26:34 -0700 (PDT) From: Vasiliy Kulikov To: kernel-janitors@vger.kernel.org Cc: Marcel Holtmann , "Gustavo F. Padovan" , "David S. Miller" , Jiri Kosina , Michael Poole , Bastien Nocera , linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bluetooth: hidp: fix information leak to userland Date: Sat, 30 Oct 2010 18:26:31 +0400 Message-Id: <1288448791-6009-1-git-send-email-segooon@gmail.com> X-Mailer: git-send-email 1.7.0.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Structure hidp_conninfo is copied to userland with version, product, vendor and name fields unitialized if both session->input and session->hid are NULL. It leads to leaking of contents of kernel stack memory. Signed-off-by: Vasiliy Kulikov Acked-by: Marcel Holtmann --- Compile tested. net/bluetooth/hidp/core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index c0ee8b3..29544c2 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c @@ -107,6 +107,7 @@ static void __hidp_unlink_session(struct hidp_session *session) static void __hidp_copy_session(struct hidp_session *session, struct hidp_conninfo *ci) { + memset(ci, 0, sizeof(*ci)); bacpy(&ci->bdaddr, &session->bdaddr); ci->flags = session->flags; @@ -115,7 +116,6 @@ static void __hidp_copy_session(struct hidp_session *session, struct hidp_connin ci->vendor = 0x0000; ci->product = 0x0000; ci->version = 0x0000; - memset(ci->name, 0, 128); if (session->input) { ci->vendor = session->input->id.vendor;