From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756925Ab0IGOAr (ORCPT ); Tue, 7 Sep 2010 10:00:47 -0400 Received: from www.tglx.de ([62.245.132.106]:58761 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756888Ab0IGOAc (ORCPT ); Tue, 7 Sep 2010 10:00:32 -0400 Message-Id: <20100907111349.884798010@linutronix.de> User-Agent: quilt/0.47-1 Date: Tue, 07 Sep 2010 14:00:04 -0000 From: Thomas Gleixner To: LKML Cc: Al Viro , Peter Zijlstra , Andrew Morton , Eric Paris Subject: [patch 2/3] audit: Do not send uninitialized data for AUDIT_TTY_GET References: <20100907111326.202980881@linutronix.de> Content-Disposition: inline; filename=audit-do-not-send-uninitialized-data-for-audit_tty_get.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org audit_receive_msg() sends uninitialized data for AUDIT_TTY_GET when the task was not found. Send reply only when task was found. Signed-off-by: Thomas Gleixner Cc: Al Viro Cc: Eric Paris Cc: Peter Zijlstra --- kernel/audit.c | 6 ++++-- kernel/audit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Index: linux-2.6/kernel/audit.c =================================================================== --- linux-2.6.orig/kernel/audit.c +++ linux-2.6/kernel/audit.c @@ -884,8 +884,10 @@ static int audit_receive_msg(struct sk_b spin_unlock_irq(&tsk->sighand->siglock); } read_unlock(&tasklist_lock); - audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_TTY_GET, 0, 0, - &s, sizeof(s)); + + if (!err) + audit_send_reply(NETLINK_CB(skb).pid, seq, + AUDIT_TTY_GET, 0, 0, &s, sizeof(s)); break; } case AUDIT_TTY_SET: {