Re: [patch] to add device+inode check to ipt_owner.c - HACKED UP

From: Luke Kenneth Casson Leighton
Date: Wed Sep 08 2004 - 09:56:45 EST


hello, hello, thank you v. much for responding.

On Wed, Sep 08, 2004 at 11:47:39AM +0100, viro@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx wrote:

> On Wed, Sep 08, 2004 at 11:39:22AM +0100, Luke Kenneth Casson Leighton wrote:
> > +static int
> > +match_inode(const struct sk_buff *skb, const char *devname, unsigned long i_num)
> > +{
> > + struct task_struct *g, *p;
> > + struct files_struct *files;
> > + /*
> > + struct inode *inode;
> > + struct super_block *sb;
> > + struct block_device *bd;
> > + */
> > + int i;
> > + read_lock(&tasklist_lock);
> > +
> > + /* lkcl: these are fairly obvious (just obtuse): hunt for the
> > + * filesystem device, then its superblock, then the inode is
> > + * relevant to that superblock, _then_ we can find the inode.
> > + bd = bdget(dev);
>
>
> ... the hell? Where does that "dev" come from?

it's code commented out that i put in there when i _really_ wasn't
sure what i was doing.

it might come in handy so i haven't deleted it yet.

basically in an earlier experiment, i put the device (dev_t)
major/minor number into ipt_owner.h.

then i discovered that fs/proc/base.c could look up a vfsmount
struct, which according to struct vfsmount contains the _name_
of the device.

i'm counting on that actually working.

if it doesn't work, then it's back to the drawing board and uncommenting
the stuff that you have noticed is all commented out, above.

l.


--
--
Truth, honesty and respect are rare commodities that all spring from
the same well: Love. If you love yourself and everyone and everything
around you, funnily and coincidentally enough, life gets a lot better.
--
<a href="http://lkcl.net";> lkcl.net </a> <br />
<a href="mailto:lkcl@xxxxxxxx";> lkcl@xxxxxxxx </a> <br />

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/