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:	Wed, 4 Feb 2009 18:26:55 -0600
From:	"Serge E. Hallyn" <serue@...ibm.com>
To:	Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
Cc:	Alan Cox <alan@...rguk.ukuu.org.uk>, hpa@...or.com, hch@....de,
	sukadev@...ibm.com, Containers <containers@...ts.osdl.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [v2][PATCH 3/5] Move common mknod_ptmx() calls into caller

Quoting Sukadev Bhattiprolu (sukadev@...ux.vnet.ibm.com):
> 
> From: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
> Date: Wed, 28 Jan 2009 18:54:25 -0800
> Subject: [v2][PATCH 3/5] Move common mknod_ptmx() calls into caller
> 
> We create 'ptmx' node in both single-instance and multiple-instance
> mounts. So devpts_get_sb() can call mknod_ptmx() once rather than
> have both modes calling mknod_ptmx() separately.
> 
> Signed-off-by: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>

Acked-by: Serge Hallyn <serue@...ibm.com>

And now I see, you could get rid of update_ptmx() because
mknod_ptmx() will be called again anyway.  So if you
haven't replied yet pls ignore my previous email where I
asked about that :)

thanks,
-serge

> ---
>  fs/devpts/inode.c |   36 +++++++++++++++++-------------------
>  1 files changed, 17 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
> index 9b24de8..f7e887c 100644
> --- a/fs/devpts/inode.c
> +++ b/fs/devpts/inode.c
> @@ -343,17 +343,7 @@ static int new_pts_mount(struct file_system_type *fs_type, int flags,
>  	fsi = DEVPTS_SB(mnt->mnt_sb);
>  	memcpy(&fsi->mount_opts, opts, sizeof(opts));
> 
> -	err = mknod_ptmx(mnt->mnt_sb);
> -	if (err)
> -		goto fail;
> -
>  	return 0;
> -
> -fail:
> -	dput(mnt->mnt_sb->s_root);
> -	up_write(&mnt->mnt_sb->s_umount);
> -	deactivate_super(mnt->mnt_sb);
> -	return err;
>  }
> 
>  /*
> @@ -421,13 +411,6 @@ static int init_pts_mount(struct file_system_type *fs_type, int flags,
>  	if (err)
>  		return err;
> 
> -	err = mknod_ptmx(mnt->mnt_sb);
> -	if (err) {
> -		dput(mnt->mnt_sb->s_root);
> -		up_write(&mnt->mnt_sb->s_umount);
> -		deactivate_super(mnt->mnt_sb);
> -	}
> -
>  	return err;
>  }
> 
> @@ -445,9 +428,24 @@ static int devpts_get_sb(struct file_system_type *fs_type,
>  	}
> 
>  	if (opts.newinstance)
> -		return new_pts_mount(fs_type, flags, data, &opts, mnt);
> +		error = new_pts_mount(fs_type, flags, data, &opts, mnt);
>  	else
> -		return init_pts_mount(fs_type, flags, data, &opts, mnt);
> +		error = init_pts_mount(fs_type, flags, data, &opts, mnt);
> +
> +	if (error)
> +		return error;
> +
> +	error = mknod_ptmx(mnt->mnt_sb);
> +	if (error)
> +		goto out_dput;
> +
> +	return 0;
> +
> +out_dput:
> +	dput(mnt->mnt_sb->s_root);
> +	up_write(&mnt->mnt_sb->s_umount);
> +	deactivate_super(mnt->mnt_sb);
> +	return error;
>  }
> 
>  #else
> -- 
> 1.5.2.5
--
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