mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 10:01:39 -05:00
tomoyo: Use local kmap in tomoyo_dump_page()
Replace the now deprecated kmap_atomic() with kmap_local_page(). The memcpy does not need atomic semantics, and the removed comment is now stale - this patch now makes it in sync again. Last but not least, highmem is going to be removed[0]. Link: https://lore.kernel.org/all/4ff89b72-03ff-4447-9d21-dd6a5fe1550f@app.fastmail.com/ [0] Signed-off-by: Davidlohr Bueso <dave@stgolabs.net> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
This commit is contained in:
committed by
Tetsuo Handa
parent
7d0a66e4bb
commit
a9ea3a2e08
@@ -934,17 +934,12 @@ bool tomoyo_dump_page(struct linux_binprm *bprm, unsigned long pos,
|
|||||||
#endif
|
#endif
|
||||||
if (page != dump->page) {
|
if (page != dump->page) {
|
||||||
const unsigned int offset = pos % PAGE_SIZE;
|
const unsigned int offset = pos % PAGE_SIZE;
|
||||||
/*
|
char *kaddr = kmap_local_page(page);
|
||||||
* Maybe kmap()/kunmap() should be used here.
|
|
||||||
* But remove_arg_zero() uses kmap_atomic()/kunmap_atomic().
|
|
||||||
* So do I.
|
|
||||||
*/
|
|
||||||
char *kaddr = kmap_atomic(page);
|
|
||||||
|
|
||||||
dump->page = page;
|
dump->page = page;
|
||||||
memcpy(dump->data + offset, kaddr + offset,
|
memcpy(dump->data + offset, kaddr + offset,
|
||||||
PAGE_SIZE - offset);
|
PAGE_SIZE - offset);
|
||||||
kunmap_atomic(kaddr);
|
kunmap_local(kaddr);
|
||||||
}
|
}
|
||||||
/* Same with put_arg_page(page) in fs/exec.c */
|
/* Same with put_arg_page(page) in fs/exec.c */
|
||||||
#ifdef CONFIG_MMU
|
#ifdef CONFIG_MMU
|
||||||
|
|||||||
Reference in New Issue
Block a user