login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
November
»
15
Re: [PATCH v2] fs: select: fix information leak to userspace
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Andrew Morton
Subject:
Re: [PATCH v2] fs: select: fix information leak to userspace
Date: Sunday, November 14, 2010 - 7:06 pm
On Sun, 14 Nov 2010 12:25:33 +0300 Vasiliy Kulikov <segoon@openwall.com> wrote:
quoted text
> On some architectures __kernel_suseconds_t is int. On these archs > struct timeval has padding bytes at the end. This struct is copied to > userspace with these padding bytes uninitialized. This leads to leaking > of contents of kernel stack memory. > > Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> > --- > Patch v1 used memset(), it was waste of cycles on almost all archs. > > Compile tested. > > fs/select.c | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/fs/select.c b/fs/select.c > index b7b10aa..43d4805 100644 > --- a/fs/select.c > +++ b/fs/select.c > @@ -288,7 +288,6 @@ static int poll_select_copy_remaining(struct timespec *end_time, void __user *p, > int timeval, int ret) > { > struct timespec rts; > - struct timeval rtv; > > if (!p) > return ret; > @@ -306,8 +305,10 @@ static int poll_select_copy_remaining(struct timespec *end_time, void __user *p, > rts.tv_sec = rts.tv_nsec = 0; > > if (timeval) { > - rtv.tv_sec = rts.tv_sec; > - rtv.tv_usec = rts.tv_nsec / NSEC_PER_USEC; > + struct timeval rtv = { > + .tv_sec = rts.tv_sec, > + .tv_usec = rts.tv_nsec / NSEC_PER_USEC > + }; > > if (!copy_to_user(p, &rtv, sizeof(rtv))) > return ret;
Please check the assembly code - this will still leave four bytes of uninitalised stack data in 'rtv', surely. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] fs: select: fix information leak to userspace
, Vasiliy Kulikov
, (Wed Nov 10, 1:38 pm)
Re: [PATCH] fs: select: fix information leak to userspace
, Andrew Morton
, (Fri Nov 12, 1:08 pm)
Re: [PATCH] fs: select: fix information leak to userspace
, Andreas Dilger
, (Sat Nov 13, 2:38 pm)
[PATCH v2] fs: select: fix information leak to userspace
, Vasiliy Kulikov
, (Sun Nov 14, 2:25 am)
Re: [PATCH] fs: select: fix information leak to userspace
, Andrew Morton
, (Sun Nov 14, 7:05 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Andrew Morton
, (Sun Nov 14, 7:06 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Boaz Harrosh
, (Tue Nov 16, 4:19 am)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Andrew Morton
, (Mon Nov 22, 4:50 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Eric Dumazet
, (Mon Nov 22, 5:20 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Andrew Morton
, (Mon Nov 22, 5:32 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Dan Carpenter
, (Mon Nov 22, 10:12 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Américo Wang
, (Tue Nov 23, 7:01 am)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Américo Wang
, (Tue Nov 23, 8:23 am)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Andreas Dilger
, (Tue Nov 23, 11:02 am)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Andrew Morton
, (Tue Nov 23, 1:18 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, David Miller
, (Tue Nov 23, 1:22 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Andreas Dilger
, (Tue Nov 23, 5:24 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Pádraig Brady
, (Wed Nov 24, 3:44 am)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Américo Wang
, (Wed Nov 24, 4:05 am)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Pádraig Brady
, (Wed Nov 24, 4:46 am)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Américo Wang
, (Wed Nov 24, 5:32 am)
Re: [PATCH v2] fs: select: fix information leak to userspace
, walter harms
, (Wed Nov 24, 9:06 am)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Valdis.Kletnieks
, (Wed Nov 24, 10:54 am)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Andreas Dilger
, (Wed Dec 15, 1:30 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Julia Lawall
, (Wed Dec 15, 1:33 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Eric Dumazet
, (Wed Dec 15, 1:52 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Andreas Dilger
, (Wed Dec 15, 3:19 pm)
Re: [PATCH v2] fs: select: fix information leak to userspace
, Boaz Harrosh
, (Thu Dec 16, 2:39 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Mr. James W. Laferriere
Re: Linux 2.6.25-rc1 , syntax error near unexpected token `;'
Linus Torvalds
Linux 2.6.34-rc4
Colin Cross
[PATCH 12/21] ARM: tegra: Add suspend and hotplug support
Chuck Ebbert
Re: PCI: Unable to reserve mem region problem
git
:
Fredrik Kuivinen
Re: fatal: unable to create '.git/index': File exists
Wink Saville
How-to combine several separate git repos?
Emily Ren
How to pull remote branch with specified commit id?
Denis Bueno
Git clone error
pradeep singh
git-update-server-info may be required,cannot clone and pull from a remote reposit...
linux-netdev
:
Jamie Lokier
Re: POHMELFS high performance network filesystem. Transactions, failover, performa...
Timo Teräs
ip xfrm policy semantics
Jarek Poplawski
Re: socket api problem: can't bind an ipv6 socket to ::ffff:0.0.0.0
Michael S. Tsirkin
[PATCH 3/3] vhost: fix get_user_pages_fast error handling
Jeff Garzik
Re: [0/3] POHMELFS high performance network filesystem. First steps in parallel pr...
openbsd-misc
:
Sevan / Venture37
Re: This is what Linus Torvalds calls openBSD crowd
Netmaffia.hu
Tini Lányok AKCIÓBAN OTTHON
Siju George
This is what Linus Torvalds calls openBSD crowd
Darrin Chandler
Re: OT: Python (was Re: vi in /bin)
frantisek holop
Re: splassert: vwakeup: and friends
git-commits-head
:
Linux Kernel Mailing List
ASoC: fix registration of the SoC card in the Freescale MPC8610 drivers
Linux Kernel Mailing List
drivers/acpi: use kasprintf
Linux Kernel Mailing List
powerpc/fsl_msi: enable msi allocation in all banks
Linux Kernel Mailing List
bnx2x: Moving includes
Linux Kernel Mailing List
nfsd41: sanity check client drc maxreqs
Colocation donated by:
Syndicate