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-next>] [day] [month] [year] [list]
Date:	Wed, 08 Aug 2007 19:16:22 +0200
From:	Andreas Gruenbacher <agruen@...e.de>
To:	linux-kernel@...r.kernel.org
Cc:	John Johansen <jjohansen@...e.de>, Jan Blunck <jblunck@...e.de>,
	Erez Zadok <ezk@...sunysb.edu>,
	Josef 'Jeff' Sipek <jsipek@...sunysb.edu>
Subject: [RFC 00/10] Split up struct nameidata (take 3)

In several places where no nameidata object is available, we are
currently passing NULL instead of constructing a temporary nameidata
object.  This is because struct nameidata is big, and constructing
temporary nameidata objects is not efficient.  Here is another shot at
splitting up struct nameidata: struct vfs_lookup is similar to struct
nameidata but leaves out the fields required only while walking an
actual pathname.  It fits in 24 bytes as opposed to 80 on x86.

This allows to construct temporary vfs_lookup objects where needed
instead of the NULL passing, which gets rid of the associated NULL
checking, and ensures that struct vfsmnt and the lookup intent are
passed down consistently.

In addition, the dentry and vfsmnt in struct vfs_lookup (before: struct
nameidata) are put inside a struct path. This allows to use
path{get,put} instead of mnt{get,put} plus d{get,put}, resulting in more
consistent code. The path{get,put} functions seemingly were suggested by
Erez Zadok / Josef 'Jeff' Sipek; Jan Blunck has been working on this
recently as well.


This proposal consists of the following patches:

nameidata-split.diff

	Introduce struct vfs_lookup and change struct nameidata to
	embed a struct vfs_lookup.  (Requires the next patch to build.)

nameidata-split-2.diff

	Update all nameidata users.

permission-args.diff

	Switch from struct nameidata to struct vfs_lookup in the
	permission inode operation and related functions.

file_permission.diff

	Create a temporary vfs_lookup object in file_permission().

sys_fchdir.diff
do_path_lookup.diff

	Use vfs_permission() instead of file_permission().

create-args.diff

	Switch from struct nameidata to struct vfs_lookup in the
	create inode operation and related functions.

vfs_create-nameidata.diff

	Fix all users of vfs_create() to never pass it a NULL
	vfs_lookup.  Get rid of the NULL checks.

d_revalidate-args.diff

	Switch from struct nameidata to struct vfs_lookup in the
	d_revalidate dentry operation and related functions.

lookup-args.diff

	Switch from struct nameidata to struct vfs_lookup in the
	lookup inode operation and related functions.


Ultimately, it would be nice to get rid of all the NULL nameidata /
vfs_lookup passing, particularly to the permission inode operation. At
that point, permission() could be replaced entirely by vfs_permission().
Other vfs functions like vfs_create() can be cleaned up in a similar
way.


Andreas

-
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