projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nilfs2: use refcount_dec_and_lock() to fix potential UAF
[linux-2.6-microblaze.git]
/
mm
/
rmap.c
diff --git
a/mm/rmap.c
b/mm/rmap.c
index
b9eb5c1
..
b2cebf3
100644
(file)
--- a/
mm/rmap.c
+++ b/
mm/rmap.c
@@
-1230,11
+1230,13
@@
void page_add_file_rmap(struct page *page, bool compound)
nr_pages);
} else {
if (PageTransCompound(page) && page_mapping(page)) {
nr_pages);
} else {
if (PageTransCompound(page) && page_mapping(page)) {
+ struct page *head = compound_head(page);
+
VM_WARN_ON_ONCE(!PageLocked(page));
VM_WARN_ON_ONCE(!PageLocked(page));
- SetPageDoubleMap(
compound_head(page)
);
+ SetPageDoubleMap(
head
);
if (PageMlocked(page))
if (PageMlocked(page))
- clear_page_mlock(
compound_head(page)
);
+ clear_page_mlock(
head
);
}
if (!atomic_inc_and_test(&page->_mapcount))
goto out;
}
if (!atomic_inc_and_test(&page->_mapcount))
goto out;