login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
November
»
15
Re: [PATCH] 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] fs: select: fix information leak to userspace
Date: Sunday, November 14, 2010 - 7:05 pm
On Sat, 13 Nov 2010 14:38:19 -0700 Andreas Dilger <adilger.kernel@dilger.ca> wrote:
quoted text
> On 2010-11-12, at 13:08, Andrew Morton wrote: > > On Wed, 10 Nov 2010 23:38:02 +0300 > > Vasiliy Kulikov <segooon@gmail.com> wrote: > >> On some architectures __kernel_suseconds_t is int. > > > > On sparc and parisc. On all other architectures this patch is a waste > > of cycles. > > > > --- a/fs/select.c~fs-select-fix-information-leak-to-userspace-fix > > +++ a/fs/select.c > > @@ -306,7 +306,8 @@ static int poll_select_copy_remaining(st > > rts.tv_sec = rts.tv_nsec = 0; > > > > if (timeval) { > > - memset(&rtv, 0, sizeof(rtv)); > > + if (sizeof(rtv) > sizeof(rtv.tv_sec) + sizeof(rtv.tv_usec)) > > + memset(&rtv, 0, sizeof(rtv)); > > rtv.tv_sec = rts.tv_sec; > > rtv.tv_usec = rts.tv_nsec / NSEC_PER_USEC; > > > > _ > > > > > > The `if' gets eliminated at compile time. With this approach we add > > four bytes of text to the sparc64 build and zero bytes of text to the > > x86_64 build. > > It's nice to have comments (or at least a good commit message) for unusual code like this, so that in the future it is clear when this kind of workaround can be removed (e.g. if the time_t is changed to always be a 64-bit value for Y2038 issues, even on 32-bit arches). >
Well, I'm the resident comment fanatic, but I thought this was all sufficiently obvious to not need one. But I'll add one ;) --
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