kernel/ksyms.c | 1
12 files changed, 558 insertions(+), 128 deletions(-)
-Index: linux-2.4.21-suse2/fs/dcache.c
+Index: linux-2.4.21-x86_64/fs/dcache.c
===================================================================
---- linux-2.4.21-suse2.orig/fs/dcache.c 2003-10-28 21:33:59.000000000 +0300
-+++ linux-2.4.21-suse2/fs/dcache.c 2004-01-10 12:15:41.000000000 +0300
+--- linux-2.4.21-x86_64.orig/fs/dcache.c 2003-10-28 10:33:59.000000000 -0800
++++ linux-2.4.21-x86_64/fs/dcache.c 2004-04-12 19:57:36.000000000 -0700
@@ -186,6 +186,13 @@
spin_unlock(&dcache_lock);
return 0;
}
#define do_switch(x,y) do { \
-Index: linux-2.4.21-suse2/fs/exec.c
+Index: linux-2.4.21-x86_64/fs/exec.c
===================================================================
---- linux-2.4.21-suse2.orig/fs/exec.c 2003-10-28 21:34:17.000000000 +0300
-+++ linux-2.4.21-suse2/fs/exec.c 2004-01-10 12:15:41.000000000 +0300
+--- linux-2.4.21-x86_64.orig/fs/exec.c 2003-10-28 10:34:17.000000000 -0800
++++ linux-2.4.21-x86_64/fs/exec.c 2004-04-12 19:57:36.000000000 -0700
@@ -112,8 +112,10 @@
struct file * file;
struct nameidata nd;
goto close_fail;
retval = binfmt->core_dump(signr, regs, file);
-Index: linux-2.4.21-suse2/fs/namei.c
+Index: linux-2.4.21-x86_64/fs/namei.c
===================================================================
---- linux-2.4.21-suse2.orig/fs/namei.c 2004-01-10 12:06:40.000000000 +0300
-+++ linux-2.4.21-suse2/fs/namei.c 2004-01-10 12:55:09.000000000 +0300
+--- linux-2.4.21-x86_64.orig/fs/namei.c 2003-10-28 10:34:18.000000000 -0800
++++ linux-2.4.21-x86_64/fs/namei.c 2004-04-12 19:58:44.000000000 -0700
@@ -94,6 +94,13 @@
* XEmacs seems to be relying on it...
*/
break;
}
goto return_base;
-@@ -643,6 +680,25 @@
+@@ -643,6 +680,27 @@
* Check the cached dentry for staleness.
*/
dentry = nd->dentry;
+ if (!dentry->d_op->d_revalidate_it(dentry, 0, it)) {
+ struct dentry *new;
+ err = permission(dentry->d_parent->d_inode,
-+ MAY_EXEC);
++ MAY_EXEC);
+ if (err)
+ break;
+ new = real_lookup(dentry->d_parent,
-+ &dentry->d_name, 0, NULL);
-+ d_invalidate(dentry);
-+ dput(dentry);
++ &dentry->d_name, 0, it);
+ if (IS_ERR(new)) {
+ err = PTR_ERR(new);
+ break;
+ }
++ d_invalidate(dentry);
++ dput(dentry);
+ nd->dentry = new;
+ }
++ if (!nd->dentry->d_inode)
++ goto no_inode;
+ } else
if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
err = -ESTALE;
if (!dentry->d_op->d_revalidate(dentry, lookup_flags & LOOKUP_PARENT)) {
-@@ -656,6 +712,8 @@
+@@ -656,6 +714,8 @@
dput(dentry);
break;
}
-+ if (err)
-+ intent_release(it);
++ if (err)
++ intent_release(it);
path_release(nd);
return_err:
return err;
-@@ -663,13 +721,13 @@
+@@ -663,13 +723,13 @@
int link_path_walk(const char * name, struct nameidata *nd)
{
}
int path_walk(const char * name, struct nameidata *nd)
-@@ -677,6 +735,12 @@
+@@ -677,6 +737,12 @@
return __path_walk(name, nd);
}
/* SMP-safe */
/* returns 1 if everything is done */
static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
-@@ -759,6 +823,17 @@
+@@ -759,6 +825,17 @@
}
/* SMP-safe */
int path_lookup(const char *path, unsigned flags, struct nameidata *nd)
{
int error = 0;
-@@ -773,6 +848,7 @@
+@@ -773,6 +850,7 @@
{
nd->last_type = LAST_ROOT; /* if there are only slashes... */
nd->flags = flags;
if (*name=='/')
return walk_init_root(name,nd);
read_lock(¤t->fs->lock);
-@@ -787,7 +863,8 @@
+@@ -787,7 +865,8 @@
* needs parent already locked. Doesn't follow mounts.
* SMP-safe.
*/
{
struct dentry * dentry;
struct inode *inode;
-@@ -810,13 +887,16 @@
+@@ -810,13 +889,16 @@
goto out;
}
dentry = inode->i_op->lookup(inode, new);
unlock_kernel();
if (!dentry)
-@@ -828,6 +908,12 @@
+@@ -828,6 +910,12 @@
return dentry;
}
/* SMP-safe */
struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
{
-@@ -849,7 +935,7 @@
+@@ -849,7 +937,7 @@
}
this.hash = end_name_hash(hash);
access:
return ERR_PTR(-EACCES);
}
-@@ -880,6 +966,23 @@
+@@ -880,6 +968,23 @@
return err;
}
/*
* It's inline, so penalty for filesystems that don't use sticky bit is
* minimal.
-@@ -977,7 +1080,8 @@
+@@ -977,7 +1082,8 @@
return retval;
}
{
int error;
-@@ -990,12 +1094,15 @@
+@@ -990,12 +1096,15 @@
goto exit_lock;
error = -EACCES; /* shouldn't it be ENOSYS? */
unlock_kernel();
exit_lock:
up(&dir->i_zombie);
-@@ -1004,6 +1111,11 @@
+@@ -1004,6 +1113,11 @@
return error;
}
/*
* open_namei()
*
-@@ -1018,7 +1130,8 @@
+@@ -1018,7 +1132,8 @@
* for symlinks (where the permissions are checked later).
* SMP-safe
*/
{
int acc_mode, error = 0;
struct inode *inode;
-@@ -1028,11 +1141,14 @@
+@@ -1028,11 +1143,14 @@
acc_mode = ACC_MODE(flag);
if (error)
return error;
dentry = nd->dentry;
-@@ -1042,6 +1158,10 @@
+@@ -1042,6 +1160,10 @@
/*
* Create - we need to know the parent.
*/
error = path_lookup(pathname, LOOKUP_PARENT, nd);
if (error)
return error;
-@@ -1057,7 +1177,7 @@
+@@ -1057,7 +1179,7 @@
dir = nd->dentry;
down(&dir->d_inode->i_sem);
do_last:
error = PTR_ERR(dentry);
-@@ -1066,11 +1186,12 @@
+@@ -1066,11 +1188,12 @@
goto exit;
}
up(&dir->d_inode->i_sem);
#ifndef DENTRY_WASTE_RAM
if (error)
-@@ -1178,7 +1299,7 @@
+@@ -1178,7 +1301,7 @@
if (!error) {
DQUOT_INIT(inode);
}
put_write_access(inode);
if (error)
-@@ -1190,8 +1311,10 @@
+@@ -1190,8 +1313,10 @@
return 0;
exit_dput:
path_release(nd);
return error;
-@@ -1210,7 +1333,10 @@
+@@ -1210,7 +1335,10 @@
* are done. Procfs-like symlinks just set LAST_BIND.
*/
UPDATE_ATIME(dentry->d_inode);
dput(dentry);
if (error)
return error;
-@@ -1232,13 +1358,20 @@
+@@ -1232,13 +1360,20 @@
}
dir = nd->dentry;
down(&dir->d_inode->i_sem);
{
struct dentry *dentry;
-@@ -1246,7 +1379,7 @@
+@@ -1246,7 +1381,7 @@
dentry = ERR_PTR(-EEXIST);
if (nd->last_type != LAST_NORM)
goto fail;
if (IS_ERR(dentry))
goto fail;
if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode)
-@@ -1302,7 +1435,16 @@
+@@ -1302,7 +1437,20 @@
error = path_lookup(tmp, LOOKUP_PARENT, &nd);
if (error)
goto out;
- dentry = lookup_create(&nd, 0);
+
++ if (nd.last_type != LAST_NORM) {
++ error = -EEXIST;
++ goto out2;
++ }
+ if (nd.dentry->d_inode->i_op->mknod_raw) {
+ struct inode_operations *op = nd.dentry->d_inode->i_op;
+ error = op->mknod_raw(&nd, mode, dev);
error = PTR_ERR(dentry);
if (!IS_POSIXACL(nd.dentry->d_inode))
-@@ -1324,6 +1466,7 @@
+@@ -1324,6 +1472,7 @@
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
path_release(&nd);
out:
putname(tmp);
-@@ -1371,7 +1514,14 @@
+@@ -1371,7 +1520,18 @@
error = path_lookup(tmp, LOOKUP_PARENT, &nd);
if (error)
goto out;
- dentry = lookup_create(&nd, 1);
++ if (nd.last_type != LAST_NORM) {
++ error = -EEXIST;
++ goto out2;
++ }
+ if (nd.dentry->d_inode->i_op->mkdir_raw) {
+ struct inode_operations *op = nd.dentry->d_inode->i_op;
+ error = op->mkdir_raw(&nd, mode);
error = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
if (!IS_POSIXACL(nd.dentry->d_inode))
-@@ -1380,6 +1530,7 @@
+@@ -1380,6 +1540,7 @@
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
path_release(&nd);
out:
putname(tmp);
-@@ -1480,8 +1631,16 @@
+@@ -1480,8 +1641,16 @@
error = -EBUSY;
goto exit1;
}
error = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
error = vfs_rmdir(nd.dentry->d_inode, dentry);
-@@ -1539,8 +1698,15 @@
+@@ -1539,8 +1708,15 @@
error = -EISDIR;
if (nd.last_type != LAST_NORM)
goto exit1;
error = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
/* Why not before? Because we want correct error value */
-@@ -1607,15 +1773,23 @@
+@@ -1607,15 +1783,27 @@
error = path_lookup(to, LOOKUP_PARENT, &nd);
if (error)
goto out;
- dentry = lookup_create(&nd, 0);
++ if (nd.last_type != LAST_NORM) {
++ error = -EEXIST;
++ goto out2;
++ }
+ if (nd.dentry->d_inode->i_op->symlink_raw) {
+ struct inode_operations *op = nd.dentry->d_inode->i_op;
+ error = op->symlink_raw(&nd, from);
putname(to);
}
putname(from);
-@@ -1691,7 +1865,14 @@
+@@ -1691,7 +1879,18 @@
error = -EXDEV;
if (old_nd.mnt != nd.mnt)
goto out_release;
- new_dentry = lookup_create(&nd, 0);
++ if (nd.last_type != LAST_NORM) {
++ error = -EEXIST;
++ goto out_release;
++ }
+ if (nd.dentry->d_inode->i_op->link_raw) {
+ struct inode_operations *op = nd.dentry->d_inode->i_op;
+ error = op->link_raw(&old_nd, &nd);
error = PTR_ERR(new_dentry);
if (!IS_ERR(new_dentry)) {
error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry);
-@@ -1735,7 +1916,7 @@
+@@ -1735,7 +1934,7 @@
* locking].
*/
int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
{
int error;
struct inode *target;
-@@ -1814,7 +1995,7 @@
+@@ -1814,7 +2013,7 @@
}
int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
{
int error;
-@@ -1902,9 +2083,18 @@
+@@ -1902,9 +2101,18 @@
if (newnd.last_type != LAST_NORM)
goto exit2;
error = PTR_ERR(old_dentry);
if (IS_ERR(old_dentry))
goto exit3;
-@@ -1920,16 +2110,16 @@
+@@ -1920,16 +2128,16 @@
if (newnd.last.name[newnd.last.len])
goto exit4;
}
dput(new_dentry);
exit4:
dput(old_dentry);
-@@ -1980,20 +2170,26 @@
+@@ -1980,20 +2188,26 @@
}
static inline int
out:
if (current->link_count || res || nd->last_type!=LAST_NORM)
return res;
-@@ -2017,7 +2213,13 @@
+@@ -2017,7 +2231,13 @@
int vfs_follow_link(struct nameidata *nd, const char *link)
{
}
/* get the link contents into pagecache */
-@@ -2059,7 +2261,7 @@
+@@ -2059,7 +2279,7 @@
{
struct page *page = NULL;
char *s = page_getlink(dentry, &page);
if (page) {
kunmap(page);
page_cache_release(page);
-Index: linux-2.4.21-suse2/fs/namespace.c
+Index: linux-2.4.21-x86_64/fs/namespace.c
===================================================================
---- linux-2.4.21-suse2.orig/fs/namespace.c 2003-10-28 21:34:12.000000000 +0300
-+++ linux-2.4.21-suse2/fs/namespace.c 2004-01-10 12:15:41.000000000 +0300
+--- linux-2.4.21-x86_64.orig/fs/namespace.c 2003-10-28 10:34:12.000000000 -0800
++++ linux-2.4.21-x86_64/fs/namespace.c 2004-04-12 19:57:36.000000000 -0700
@@ -98,6 +98,7 @@
{
old_nd->dentry = mnt->mnt_mountpoint;
int retval = 0;
int mnt_flags = 0;
-@@ -725,10 +732,11 @@
+@@ -725,9 +732,11 @@
flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV);
/* ... and get the mountpoint */
+ if (retval) {
+ intent_release(&it);
return retval;
--
+ }
+
if (flags & MS_REMOUNT)
retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags,
- data_page);
@@ -739,6 +747,8 @@
else
retval = do_add_mount(&nd, type_page, flags, mnt_flags,
path_release(&new_nd);
out0:
unlock_kernel();
-Index: linux-2.4.21-suse2/fs/open.c
+Index: linux-2.4.21-x86_64/fs/open.c
===================================================================
---- linux-2.4.21-suse2.orig/fs/open.c 2003-10-28 21:33:59.000000000 +0300
-+++ linux-2.4.21-suse2/fs/open.c 2004-01-10 12:55:39.000000000 +0300
+--- linux-2.4.21-x86_64.orig/fs/open.c 2003-10-28 10:33:59.000000000 -0800
++++ linux-2.4.21-x86_64/fs/open.c 2004-04-12 19:57:36.000000000 -0700
@@ -19,6 +19,8 @@
#include <asm/uaccess.h>
- error = __user_walk(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
- LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
+ error = __user_walk_it(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
-+ LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd, &it);
++ LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd, &it);
if (error)
goto out;
/*
* Find an empty file descriptor entry, and mark it busy.
*/
-Index: linux-2.4.21-suse2/fs/stat.c
+Index: linux-2.4.21-x86_64/fs/stat.c
===================================================================
---- linux-2.4.21-suse2.orig/fs/stat.c 2003-10-28 21:33:58.000000000 +0300
-+++ linux-2.4.21-suse2/fs/stat.c 2004-01-10 12:15:41.000000000 +0300
-@@ -17,10 +17,14 @@
+--- linux-2.4.21-x86_64.orig/fs/stat.c 2003-10-28 10:33:58.000000000 -0800
++++ linux-2.4.21-x86_64/fs/stat.c 2004-04-12 19:58:44.000000000 -0700
+@@ -17,10 +17,12 @@
* Revalidate the inode. This is required for proper NFS attribute caching.
*/
static __inline__ int
{
struct inode * inode = dentry->d_inode;
- if (inode->i_op && inode->i_op->revalidate)
-+ if (!inode)
-+ return -ENOENT;
+ if (inode->i_op && inode->i_op->revalidate_it)
+ return inode->i_op->revalidate_it(dentry, it);
+ else if (inode->i_op && inode->i_op->revalidate)
return inode->i_op->revalidate(dentry);
return 0;
}
-@@ -141,13 +145,15 @@
+@@ -141,13 +143,15 @@
asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf)
{
struct nameidata nd;
path_release(&nd);
}
return error;
-@@ -157,13 +163,15 @@
+@@ -157,13 +161,15 @@
asmlinkage long sys_newstat(char * filename, struct stat * statbuf)
{
struct nameidata nd;
path_release(&nd);
}
return error;
-@@ -178,13 +186,15 @@
+@@ -178,13 +184,15 @@
asmlinkage long sys_lstat(char * filename, struct __old_kernel_stat * statbuf)
{
struct nameidata nd;
path_release(&nd);
}
return error;
-@@ -195,13 +205,15 @@
+@@ -195,13 +203,15 @@
asmlinkage long sys_newlstat(char * filename, struct stat * statbuf)
{
struct nameidata nd;
path_release(&nd);
}
return error;
-@@ -222,7 +234,7 @@
+@@ -222,7 +232,7 @@
if (f) {
struct dentry * dentry = f->f_dentry;
if (!err)
err = cp_old_stat(dentry->d_inode, statbuf);
fput(f);
-@@ -241,7 +253,7 @@
+@@ -241,7 +251,7 @@
if (f) {
struct dentry * dentry = f->f_dentry;
if (!err)
err = cp_new_stat(dentry->d_inode, statbuf);
fput(f);
-@@ -263,7 +275,7 @@
+@@ -263,7 +273,7 @@
error = -EINVAL;
if (inode->i_op && inode->i_op->readlink &&
UPDATE_ATIME(inode);
error = inode->i_op->readlink(nd.dentry, buf, bufsiz);
}
-@@ -339,12 +351,14 @@
+@@ -339,12 +349,14 @@
{
struct nameidata nd;
int error;
path_release(&nd);
}
return error;
-@@ -354,12 +368,14 @@
+@@ -354,12 +366,14 @@
{
struct nameidata nd;
int error;
path_release(&nd);
}
return error;
-@@ -374,7 +390,7 @@
+@@ -374,7 +388,7 @@
if (f) {
struct dentry * dentry = f->f_dentry;
if (!err)
err = cp_new_stat64(dentry->d_inode, statbuf);
fput(f);
-Index: linux-2.4.21-suse2/include/linux/dcache.h
+Index: linux-2.4.21-x86_64/include/linux/dcache.h
===================================================================
---- linux-2.4.21-suse2.orig/include/linux/dcache.h 2003-11-11 03:44:28.000000000 +0300
-+++ linux-2.4.21-suse2/include/linux/dcache.h 2004-01-10 12:48:36.000000000 +0300
+--- linux-2.4.21-x86_64.orig/include/linux/dcache.h 2003-11-10 16:44:28.000000000 -0800
++++ linux-2.4.21-x86_64/include/linux/dcache.h 2004-04-12 19:57:36.000000000 -0700
@@ -7,6 +7,51 @@
#include <linux/gdb.h>
#include <linux/mount.h>
extern spinlock_t dcache_lock;
-Index: linux-2.4.21-suse2/include/linux/fs.h
+Index: linux-2.4.21-x86_64/include/linux/fs.h
===================================================================
---- linux-2.4.21-suse2.orig/include/linux/fs.h 2004-01-10 11:28:05.000000000 +0300
-+++ linux-2.4.21-suse2/include/linux/fs.h 2004-01-10 12:48:36.000000000 +0300
+--- linux-2.4.21-x86_64.orig/include/linux/fs.h 2004-04-12 19:57:33.000000000 -0700
++++ linux-2.4.21-x86_64/include/linux/fs.h 2004-04-12 19:57:36.000000000 -0700
@@ -74,6 +74,7 @@
#define FMODE_READ 1
#define ATTR_ATTR_FLAG 1024
+#define ATTR_RAW 0x0800 /* file system, not vfs will massage attrs */
+#define ATTR_FROM_OPEN 0x1000 /* called from open path, ie O_TRUNC */
-+#define ATTR_CTIME_SET 0x2000
++#define ATTR_CTIME_SET 0x2000
/*
* This is the Inode Attributes structure, used for notify_change(). It
extern int page_readlink(struct dentry *, char *, int);
extern int page_follow_link(struct dentry *, struct nameidata *);
extern struct inode_operations page_symlink_inode_operations;
-Index: linux-2.4.21-suse2/include/linux/fs_struct.h
+Index: linux-2.4.21-x86_64/include/linux/fs_struct.h
===================================================================
---- linux-2.4.21-suse2.orig/include/linux/fs_struct.h 2001-07-14 02:10:44.000000000 +0400
-+++ linux-2.4.21-suse2/include/linux/fs_struct.h 2004-01-10 12:15:41.000000000 +0300
+--- linux-2.4.21-x86_64.orig/include/linux/fs_struct.h 2001-07-13 15:10:44.000000000 -0700
++++ linux-2.4.21-x86_64/include/linux/fs_struct.h 2004-04-12 19:57:36.000000000 -0700
@@ -34,10 +34,12 @@
write_lock(&fs->lock);
old_root = fs->root;
dput(old_pwd);
mntput(old_pwdmnt);
}
-Index: linux-2.4.21-suse2/kernel/exit.c
+Index: linux-2.4.21-x86_64/kernel/exit.c
===================================================================
---- linux-2.4.21-suse2.orig/kernel/exit.c 2003-10-28 21:34:13.000000000 +0300
-+++ linux-2.4.21-suse2/kernel/exit.c 2004-01-10 12:15:41.000000000 +0300
+--- linux-2.4.21-x86_64.orig/kernel/exit.c 2003-10-28 10:34:13.000000000 -0800
++++ linux-2.4.21-x86_64/kernel/exit.c 2004-04-12 19:57:36.000000000 -0700
@@ -288,11 +288,14 @@
{
/* No need to hold fs->lock if we are killing it */
dput(fs->altroot);
mntput(fs->altrootmnt);
}
-Index: linux-2.4.21-suse2/kernel/fork.c
+Index: linux-2.4.21-x86_64/kernel/fork.c
===================================================================
---- linux-2.4.21-suse2.orig/kernel/fork.c 2003-10-28 21:34:17.000000000 +0300
-+++ linux-2.4.21-suse2/kernel/fork.c 2004-01-10 12:15:41.000000000 +0300
+--- linux-2.4.21-x86_64.orig/kernel/fork.c 2003-10-28 10:34:17.000000000 -0800
++++ linux-2.4.21-x86_64/kernel/fork.c 2004-04-12 19:57:36.000000000 -0700
@@ -461,10 +461,13 @@
fs->umask = old->umask;
read_lock(&old->lock);
fs->altrootmnt = mntget(old->altrootmnt);
fs->altroot = dget(old->altroot);
} else {
-Index: linux-2.4.21-suse2/kernel/ksyms.c
+Index: linux-2.4.21-x86_64/kernel/ksyms.c
===================================================================
---- linux-2.4.21-suse2.orig/kernel/ksyms.c 2004-01-10 11:28:05.000000000 +0300
-+++ linux-2.4.21-suse2/kernel/ksyms.c 2004-01-10 12:15:41.000000000 +0300
+--- linux-2.4.21-x86_64.orig/kernel/ksyms.c 2004-04-12 19:57:33.000000000 -0700
++++ linux-2.4.21-x86_64/kernel/ksyms.c 2004-04-12 19:57:36.000000000 -0700
@@ -327,6 +327,7 @@
EXPORT_SYMBOL(set_page_dirty);
EXPORT_SYMBOL(vfs_readlink);