lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1262879823-23438-1-git-send-email-a.beregalov@gmail.com>
Date:	Thu,  7 Jan 2010 18:57:03 +0300
From:	Alexander Beregalov <a.beregalov@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	Alexander Beregalov <a.beregalov@...il.com>,
	Jeff Dike <jdike@...toit.com>
Subject: [PATCH] uml: line.c: avoid NULL pointer dereference

Assign tty only if line is not NULL.

Cc: Jeff Dike <jdike@...toit.com>
Signed-off-by: Alexander Beregalov <a.beregalov@...il.com>
---
 arch/um/drivers/line.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index cf8a97f..4a46253 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -18,10 +18,12 @@ static irqreturn_t line_interrupt(int irq, void *data)
 {
 	struct chan *chan = data;
 	struct line *line = chan->line;
-	struct tty_struct *tty = line->tty;
+	struct tty_struct *tty;
 
-	if (line)
+	if (line) {
+		tty = line->tty;
 		chan_interrupt(&line->chan_list, &line->task, tty, irq);
+	}
 	return IRQ_HANDLED;
 }
 
-- 
1.6.6

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ