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>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 09 May 2013 10:11:56 -0700
From:	Davidlohr Bueso <davidlohr.bueso@...com>
To:	Li Zefan <lizefan@...wei.com>
Cc:	Dave Jones <davej@...hat.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Linux Kernel <linux-kernel@...r.kernel.org>, riel@...hat.com,
	viro@...iv.linux.org.uk,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Subject: Re: SHM oops in newseg()

On Thu, 2013-05-09 at 15:08 +0800, Li Zefan wrote:
> Cc: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
> 
> On 2013/5/9 12:35, Dave Jones wrote:
> > Just saw this on v3.9-11789-ge0fd9af while fuzz-testing.
> > 
> > [  163.917836] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
> > [  163.918984] IP: [<ffffffff812c48ed>] newseg+0x10d/0x390
> 
> The patch below should fix it.
> 
> ===========================
> 
> [PATCH] shm: fix null pointer deref when userspace specifies invalid hugepage size
> 
> Dave reported an oops triggered by trinity:
> 
> [  163.917836] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
> [  163.918984] IP: [<ffffffff812c48ed>] newseg+0x10d/0x390
> [  163.919705] PGD cf8c1067 PUD cf8c2067 PMD 0
> [  163.920326] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
> [  163.929949] CPU: 2 PID: 7636 Comm: trinity-child2 Not tainted 3.9.0+#67
> ...
> [  163.953629] Call Trace:
> [  163.957706]  [<ffffffff812be322>] ipcget+0x182/0x380
> [  163.962123]  [<ffffffff810b99a5>] ?trace_hardirqs_on_caller+0x115/0x1e0
> [  163.966752]  [<ffffffff812c559a>] SyS_shmget+0x5a/0x60
> [  163.971163]  [<ffffffff812c47e0>] ? shm_close+0x140/0x140
> [  163.975590]  [<ffffffff812c3e60>] ? shm_release+0x50/0x50
> [  163.979991]  [<ffffffff812c3df0>] ? shm_get_unmapped_area+0x20/0x20
> [  163.984499]  [<ffffffff816caa14>] tracesys+0xdd/0xe2
> 
> This bug was introduced by commit af73e4d9506d3b797509f3c030e7dcd554f7d9c4
> ("hugetlbfs: fix mmap failure in unaligned size request").
> 
> Reported-by: Dave Jones <davej@...hat.com>
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Li Zefan <lizfan@...wei.com>
> ---
> 
> Previously it would return -ENODEV, but seems -EINVAL is more appropriate.

Should the user in fs/hugetlbfs/inode.c be updated as well?
get_hstate_idx() is just returning -1 and it's only caller,
hugetlb_file_setup(), returns -ENODEV.

Thanks,
Davidlohr

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