The patch titled
revoke: only revoke mappings for the given inode
has been removed from the -mm tree. Its filename was
revoke-core-code-fix-shared-mapping-revoke-revoke-only-revoke-mappings-for-the-given-inode.patch
This patch was dropped because it was folded into revoke-core-code.patch
------------------------------------------------------
Subject: revoke: only revoke mappings for the given inode
From: Pekka Enberg <[EMAIL PROTECTED]>
This fixes a bug that was introduced when we switched to rescanning all the
vmas of a mm. We need to check that the vma host file points to the same
inode we are revoking; otherwise we end up revoking all shared mappings.
Signed-off-by: Pekka Enberg <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
fs/revoke.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff -puN
fs/revoke.c~revoke-core-code-fix-shared-mapping-revoke-revoke-only-revoke-mappings-for-the-given-inode
fs/revoke.c
---
a/fs/revoke.c~revoke-core-code-fix-shared-mapping-revoke-revoke-only-revoke-mappings-for-the-given-inode
+++ a/fs/revoke.c
@@ -161,15 +161,24 @@ static int revoke_fds(struct task_struct
}
static inline bool need_revoke(struct vm_area_struct *vma,
+ struct inode *inode,
struct file *to_exclude)
{
+ struct file *file = vma->vm_file;
+
if (vma->vm_flags & VM_REVOKED)
return false;
+ if (!file)
+ return false;
+
+ if (file->f_path.dentry->d_inode != inode)
+ return false;
+
if (!(vma->vm_flags & VM_SHARED))
return false;
- return vma->vm_file != to_exclude;
+ return file != to_exclude;
}
/*
@@ -227,7 +236,7 @@ static int revoke_mm(struct mm_struct *m
goto out;
}
for (vma = mm->mmap; vma != NULL; vma = vma->vm_next) {
- if (!need_revoke(vma, to_exclude))
+ if (!need_revoke(vma, mapping->host, to_exclude))
continue;
err = revoke_vma(vma, &details);
@@ -253,7 +262,7 @@ static void revoke_mapping_tree(struct a
vma_prio_tree_foreach(vma, &iter, &mapping->i_mmap, 0, ULONG_MAX) {
int err;
- if (likely(!need_revoke(vma, to_exclude)))
+ if (likely(!need_revoke(vma, mapping->host, to_exclude)))
continue;
err = revoke_mm(vma->vm_mm, mapping, to_exclude);
@@ -283,7 +292,7 @@ static void revoke_mapping_list(struct a
list_for_each_entry(vma, &mapping->i_mmap_nonlinear,
shared.vm_set.list) {
int err;
- if (likely(!need_revoke(vma, to_exclude)))
+ if (likely(!need_revoke(vma, mapping->host, to_exclude)))
continue;
err = revoke_mm(vma->vm_mm, mapping, to_exclude);
_
Patches currently in -mm which might be from [EMAIL PROTECTED] are
origin.patch
krealloc-fix-kerneldoc-comments.patch
slab-use-cpu_lock_.patch
separate-freezer-from-pm-code-rev-2.patch
introduce-freezer-flags-rev-2.patch
unionfs-fix-slab-abuses-with-krealloc.patch
revoke-special-mmap-handling.patch
revoke-special-mmap-handling-vs-fault-vs-invalidate.patch
revoke-core-code.patch
revoke-core-code-fix-shared-mapping-revoke-revoke-only-revoke-mappings-for-the-given-inode.patch
revoke-core-code-break-cow-for-private-mappings.patch
revoke-core-code-generic_file_revoke-stub-for-nommu.patch
revoke-core-code-break-cow-fixes.patch
revoke-core-code-mapping-revocation.patch
revoke-core-code-only-fput-unused-files.patch
revoke-core-code-rename-to-can_revoke_filevma.patch
revoke-core-code-change-revoke_table-to-fileset-and-revoke_details.patch
revoke-core-code-do_revoke-error-handling.patch
revoke-support-for-ext2-and-ext3.patch
revoke-add-documentation.patch
revoke-wire-up-i386-system-calls.patch
slab-leaks3-default-y.patch
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html