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: <1469291232-9425-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp>
Date:	Sun, 24 Jul 2016 01:27:12 +0900
From:	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To:	kay@...y.org
Cc:	linux-kernel@...r.kernel.org,
	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Subject: [PATCH] printk: Initialize devkmsg_user->prev field.

kmemcheck complains that devkmsg_user->prev field is not initialized.
Although it is type of enum log_flags where 0 is not defined, it will be
OK to initialize with 0 as with syslog_prev and console_prev.

[ 1168.537263] WARNING: kmemcheck: Caught 32-bit read from uninitialized memory (ffff880136b7c00c)
[ 1168.540220] 00000000000000000000000000000000881300000a0000000000000000000000
[ 1168.543234]  i i i i i i i i i i i i u u u u i i i i i i i i i i i i i i i i
[ 1168.546312]                          ^
[ 1168.547565] RIP: 0010:[<ffffffff81084c3c>]  [<ffffffff81084c3c>] devkmsg_read+0x17c/0x2c0
[ 1168.550357] RSP: 0018:ffff880136b47dd8  EFLAGS: 00010046
[ 1168.552035] RAX: ffffffff8199f0f0 RBX: ffff880136b7c000 RCX: ffff880136b47f18
[ 1168.554012] RDX: 0000000000000000 RSI: 00007fff9f8c5f20 RDI: ffff880136b7c030
[ 1168.556021] RBP: ffff880136b47e48 R08: 0000000000000000 R09: 000055ca349426c0
[ 1168.557972] R10: 0000000000000000 R11: 0000000000000246 R12: ffff880136b7c048
[ 1168.560002] R13: 0000000000000000 R14: ffff880136b7c030 R15: 00007fff9f8c7f98
[ 1168.561956] FS:  00007f09e42e2880(0000) GS:ffffffff8182c000(0000) knlGS:0000000000000000
[ 1168.564615] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1168.566283] CR2: ffff880136b18f50 CR3: 0000000136aaf000 CR4: 00000000001406f0
[ 1168.568438]  [<ffffffff8114fe42>] __vfs_read+0x32/0x130
[ 1168.570089]  [<ffffffff811505d6>] vfs_read+0x86/0x130
[ 1168.571642]  [<ffffffff81151a70>] SyS_read+0x50/0xc0
[ 1168.573222]  [<ffffffff81593dd8>] entry_SYSCALL_64_fastpath+0x13/0x8f
[ 1168.575081]  [<ffffffffffffffff>] 0xffffffffffffffff

Signed-off-by: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
---
 kernel/printk/printk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index d3d4a99..d4ec169 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -945,6 +945,7 @@ static int devkmsg_open(struct inode *inode, struct file *file)
 	user->seq = log_first_seq;
 	raw_spin_unlock_irq(&logbuf_lock);
 
+	user->prev = 0;
 	file->private_data = user;
 	return 0;
 }
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ