diff options
author | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
commit | cb5629b10d64a8006622ce3a52bc887d91057d69 (patch) | |
tree | 7c06d8f30783115e3384721046258ce615b129c5 /fs/ubifs/commit.c | |
parent | 8920d5ad6ba74ae8ab020e90cc4d976980e68701 (diff) | |
parent | f01d1d546abb2f4028b5299092f529eefb01253a (diff) |
Merge branch 'master' into next
Conflicts:
fs/namei.c
Manually merged per:
diff --cc fs/namei.c
index 734f2b5,bbc15c2..0000000
--- a/fs/namei.c
+++ b/fs/namei.c
@@@ -860,9 -848,8 +849,10 @@@ static int __link_path_walk(const char
nd->flags |= LOOKUP_CONTINUE;
err = exec_permission_lite(inode);
if (err == -EAGAIN)
- err = vfs_permission(nd, MAY_EXEC);
+ err = inode_permission(nd->path.dentry->d_inode,
+ MAY_EXEC);
+ if (!err)
+ err = ima_path_check(&nd->path, MAY_EXEC);
if (err)
break;
@@@ -1525,14 -1506,9 +1509,14 @@@ int may_open(struct path *path, int acc
flag &= ~O_TRUNC;
}
- error = vfs_permission(nd, acc_mode);
+ error = inode_permission(inode, acc_mode);
if (error)
return error;
+
- error = ima_path_check(&nd->path,
++ error = ima_path_check(path,
+ acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC));
+ if (error)
+ return error;
/*
* An append-only file must be opened in append mode for writing.
*/
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/ubifs/commit.c')
-rw-r--r-- | fs/ubifs/commit.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/ubifs/commit.c b/fs/ubifs/commit.c index b49884c8c10e..f3a7945527fb 100644 --- a/fs/ubifs/commit.c +++ b/fs/ubifs/commit.c | |||
@@ -470,12 +470,12 @@ int dbg_old_index_check_init(struct ubifs_info *c, struct ubifs_zbranch *zroot) | |||
470 | { | 470 | { |
471 | struct ubifs_idx_node *idx; | 471 | struct ubifs_idx_node *idx; |
472 | int lnum, offs, len, err = 0; | 472 | int lnum, offs, len, err = 0; |
473 | struct ubifs_debug_info *d = c->dbg; | ||
473 | 474 | ||
474 | c->old_zroot = *zroot; | 475 | d->old_zroot = *zroot; |
475 | 476 | lnum = d->old_zroot.lnum; | |
476 | lnum = c->old_zroot.lnum; | 477 | offs = d->old_zroot.offs; |
477 | offs = c->old_zroot.offs; | 478 | len = d->old_zroot.len; |
478 | len = c->old_zroot.len; | ||
479 | 479 | ||
480 | idx = kmalloc(c->max_idx_node_sz, GFP_NOFS); | 480 | idx = kmalloc(c->max_idx_node_sz, GFP_NOFS); |
481 | if (!idx) | 481 | if (!idx) |
@@ -485,8 +485,8 @@ int dbg_old_index_check_init(struct ubifs_info *c, struct ubifs_zbranch *zroot) | |||
485 | if (err) | 485 | if (err) |
486 | goto out; | 486 | goto out; |
487 | 487 | ||
488 | c->old_zroot_level = le16_to_cpu(idx->level); | 488 | d->old_zroot_level = le16_to_cpu(idx->level); |
489 | c->old_zroot_sqnum = le64_to_cpu(idx->ch.sqnum); | 489 | d->old_zroot_sqnum = le64_to_cpu(idx->ch.sqnum); |
490 | out: | 490 | out: |
491 | kfree(idx); | 491 | kfree(idx); |
492 | return err; | 492 | return err; |
@@ -509,6 +509,7 @@ int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot) | |||
509 | { | 509 | { |
510 | int lnum, offs, len, err = 0, uninitialized_var(last_level), child_cnt; | 510 | int lnum, offs, len, err = 0, uninitialized_var(last_level), child_cnt; |
511 | int first = 1, iip; | 511 | int first = 1, iip; |
512 | struct ubifs_debug_info *d = c->dbg; | ||
512 | union ubifs_key lower_key, upper_key, l_key, u_key; | 513 | union ubifs_key lower_key, upper_key, l_key, u_key; |
513 | unsigned long long uninitialized_var(last_sqnum); | 514 | unsigned long long uninitialized_var(last_sqnum); |
514 | struct ubifs_idx_node *idx; | 515 | struct ubifs_idx_node *idx; |
@@ -525,9 +526,9 @@ int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot) | |||
525 | UBIFS_IDX_NODE_SZ; | 526 | UBIFS_IDX_NODE_SZ; |
526 | 527 | ||
527 | /* Start at the old zroot */ | 528 | /* Start at the old zroot */ |
528 | lnum = c->old_zroot.lnum; | 529 | lnum = d->old_zroot.lnum; |
529 | offs = c->old_zroot.offs; | 530 | offs = d->old_zroot.offs; |
530 | len = c->old_zroot.len; | 531 | len = d->old_zroot.len; |
531 | iip = 0; | 532 | iip = 0; |
532 | 533 | ||
533 | /* | 534 | /* |
@@ -560,11 +561,11 @@ int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot) | |||
560 | if (first) { | 561 | if (first) { |
561 | first = 0; | 562 | first = 0; |
562 | /* Check root level and sqnum */ | 563 | /* Check root level and sqnum */ |
563 | if (le16_to_cpu(idx->level) != c->old_zroot_level) { | 564 | if (le16_to_cpu(idx->level) != d->old_zroot_level) { |
564 | err = 2; | 565 | err = 2; |
565 | goto out_dump; | 566 | goto out_dump; |
566 | } | 567 | } |
567 | if (le64_to_cpu(idx->ch.sqnum) != c->old_zroot_sqnum) { | 568 | if (le64_to_cpu(idx->ch.sqnum) != d->old_zroot_sqnum) { |
568 | err = 3; | 569 | err = 3; |
569 | goto out_dump; | 570 | goto out_dump; |
570 | } | 571 | } |