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
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
Og dreams of kernels
Jens Axboe
[PATCH 31/33] Fusion: sg chaining support
Arnd Bergmann
Re: finding your own dead "CONFIG_" variables
Mark Brown
[PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset