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]
Message-Id: <1251469111.2947.12.camel@dhcp231-106.rdu.redhat.com>
Date:	Fri, 28 Aug 2009 10:18:31 -0400
From:	Eric Paris <eparis@...hat.com>
To:	Brian Rogers <brian@...w.org>
Cc:	"Eric W. Biederman" <ebiederm@...ssion.com>,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	"Rafael J. Wysocki" <rjw@...k.pl>
Subject: Re: [PATCH] inotify:  Ensure we alwasy write the terminating NULL.

On Fri, 2009-08-28 at 06:29 -0700, Brian Rogers wrote:
> Eric W. Biederman wrote:
> > Before the rewrite copy_event_to_user always wrote a terqminating '\0'
> > byte to user space after the filename.  Since the rewrite that
> > terminating byte was skipped if your filename is exactly a multiple of
> > event_size.  Ouch!
> >
> > So add one byte to name_size before we round up and use clear_user to
> > set userspace to zero like /dev/zero does instead of copying the
> > strange nul_inotify_event.  I can't quite convince myself len_to_zero
> > will never exceed 16 and even if it doesn't clear_user should be more
> > efficient and a more accurate reflection of what the code is trying to
> > do.
> >
> > Signed-off-by: Eric W. Biederman <ebiederm@...stanetworks.com>
> >   
> 
> I found that this change prevents my Ubuntu Karmic system from booting. 
> It just idles forever very early in the process. Probably a boot script 
> is waiting for an event that it doesn't receive properly.
> 
> > -	name_len = roundup(event->name_len, event_size);
> > +	name_len = roundup(event->name_len + 1, event_size);
> >   
> 
> This means the test later on will now always evaluate to true:
> > if (name_len) {
> 
> And in cases where that test previously would have failed, the code now 
> outputs a block full of zeros. Assuming that's bad and the test was 
> important, I coded the attached naive fix, which is working for me.

Thanks, I ask Linus to pull a (slightly modified) version.  Don't know
if he'll get it before he runs out on vacation.  Here's hoping.

-Eric

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