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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070503170447.8520da9c.akpm@linux-foundation.org>
Date:	Thu, 3 May 2007 17:04:47 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Pekka J Enberg <penberg@...helsinki.fi>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] revoke: change revoke_table to fileset and
 revoke_details

On Thu, 3 May 2007 23:32:28 +0300 (EEST)
Pekka J Enberg <penberg@...helsinki.fi> wrote:

> On Thu, 3 May 2007, Andrew Morton wrote:
> > > +/**
> > > + * fileset - an array of file pointers.
> > > + * @files:    the array of file pointers
> > > + * @nr:               number of elements in the array
> > > + * @end:      index to next unused file pointer
> > > + */
> > > +struct fileset {
> > > +	struct file	**files;
> > > +	unsigned long	nr;
> > > +	unsigned long	end;
> > > +};
> > 
> > What's the locking protocol for all this?
> 
> What do you mean? There is no concurrent access going on here.

Well that's the "locking" protocol then: each instance of this structure is
only ever touched by a single thread, yes?

> On Thu, 3 May 2007, Andrew Morton wrote:
> > > +static void free_fset(struct fileset *fset)
> > > +{
> > > +      int i;
> > > +
> > > +      for (i = fset->end; i < fset->nr; i++)
> > > +              fput(fset->files[i]);
> > > +
> > > +      kfree(fset->files);
> > > +      kfree(fset);
> > > +}
> > 
> > Confused.  Shouldn't it be
> > 
> > 	for (i = 0; i < fset->end; i++)
> 
> No. The fset->end is an index to the first _unused_ file pointer. All 
> entries before that are in use by revoked file descriptors so we don't 
> want to fput() them.
> 

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