Skip to content

Commit a9ea3a2

Browse files
Davidlohr BuesoTetsuo Handa
authored andcommitted
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>
1 parent 7d0a66e commit a9ea3a2

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

security/tomoyo/domain.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -934,17 +934,12 @@ bool tomoyo_dump_page(struct linux_binprm *bprm, unsigned long pos,
934934
#endif
935935
if (page != dump->page) {
936936
const unsigned int offset = pos % PAGE_SIZE;
937-
/*
938-
* Maybe kmap()/kunmap() should be used here.
939-
* But remove_arg_zero() uses kmap_atomic()/kunmap_atomic().
940-
* So do I.
941-
*/
942-
char *kaddr = kmap_atomic(page);
937+
char *kaddr = kmap_local_page(page);
943938

944939
dump->page = page;
945940
memcpy(dump->data + offset, kaddr + offset,
946941
PAGE_SIZE - offset);
947-
kunmap_atomic(kaddr);
942+
kunmap_local(kaddr);
948943
}
949944
/* Same with put_arg_page(page) in fs/exec.c */
950945
#ifdef CONFIG_MMU

0 commit comments

Comments
 (0)