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]
Date:	Thu, 27 Mar 2008 22:36:24 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	akpm@...ux-foundation.org, linuxram@...ibm.com,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [patch 6/7] vfs: mountinfo: add /proc/<pid>/mountinfo

On Thu, Mar 27, 2008 at 01:06:25PM +0100, Miklos Szeredi wrote:
> +36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue

Works for me...

> -static int show_vfsmnt(struct seq_file *m, void *v)
> +struct proc_fs_info {

struct flag_name would be better; will do on merge.

> +static void show_type(struct seq_file *m, struct super_block *sb)
> +{
> +	mangle(m, sb->s_type->name);

BTW, do we really want to bother with quoting?  Anyway, that can live
for now...

> +static int show_mountinfo(struct seq_file *m, void *v)
> +{
> +	struct proc_mounts *p = m->private;
> +	size_t count_save = m->count;

> +		/*
> +		 * Mountpoint is outside root, rewind seq_file. Ugly,
> +		 * but necessary for race-free detection of unreachable
> +		 * mountpoints.
> +		 */
> +		m->count = count_save;
> +		return 0;
> +	}

You know, _if_ we want to go that way, let's do it right; all callers
of ->show() are in seq_file.c and all of them know the previous value
of m->count.  So let's define SEQ_SKIP as 1 and teach these 3 callers
to handle it.  And make this sucker (and anything else that might want
the same kind of things) return SEQ_SKIP instead of playing with m->count
directly.

Again, will do on merge...
--
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