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: <20121030211701.GC2616@ZenIV.linux.org.uk>
Date:	Tue, 30 Oct 2012 21:17:01 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Jeff Moyer <jmoyer@...hat.com>
Cc:	linux-kernel@...r.kernel.org, David Howells <dhowells@...hat.com>,
	Chris Mason <chris.mason@...ionio.com>,
	Steve French <sfrench@...ba.org>,
	Mark Fasheh <mfasheh@...e.com>,
	Joel Becker <jlbec@...lplan.org>,
	Matthew Wilcox <matthew@....cx>, linux-afs@...ts.infradead.org,
	linux-fsdevel@...r.kernel.org, linux-btrfs@...r.kernel.org,
	linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
	ocfs2-devel@....oracle.com
Subject: Re: [patch 05/10] vfs: pass data to alloc_inode super operation

On Tue, Oct 30, 2012 at 08:51:42PM +0000, Al Viro wrote:
> On Tue, Oct 30, 2012 at 04:14:39PM -0400, Jeff Moyer wrote:
> > This patch passes a data pointer along to the alloc_inode
> > super_operations function.  The value will initially be used by
> > bdev_alloc_inode to allocate the bdev_inode on the same numa
> > node as the device to which it is tied.
> 
> Yecchhh...
> 
> > -static struct inode *bdev_alloc_inode(struct super_block *sb)
> > +static struct inode *bdev_alloc_inode(struct super_block *sb, void *data)
> >  {
> > -	struct bdev_inode *ei = kmem_cache_alloc(bdev_cachep, GFP_KERNEL);
> > +	struct bdev_inode *ei;
> > +	int partno;
> > +	int node;
> > +
> > +	if (data) {
> > +		struct gendisk *disk;
> > +		dev_t dev = *(dev_t *)data;
> > +		disk = get_gendisk(dev, &partno);
> > +		node = disk->node_id;

BTW, speaking of other reasons this is FUBAR - mknod a block device node
for something that doesn't exist and try to open it.  struct block_device
lifetime is not limited to that of struct gendisk; it can be allocated
before gendisk is there.  Moreover, with static /dev and demand-loaded
modules this will be the normal scenario.

IOW, this is completely misguided.
--
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