do_pageout: fix direct kernel-user access

Change-Id: Ie02faca93fdb0d52d72e1f2aa1384a214c84ebff
Fujitsu: POSTK_DEBUG_ARCH_DEP_46
This commit is contained in:
Dominique Martinet
2019-01-29 16:45:35 +09:00
parent 36d473c5b5
commit a10f4b861c
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
/* archdeps.c COPYRIGHT FUJITSU LIMITED 2016 */ /* archdeps.c COPYRIGHT FUJITSU LIMITED 2016 */
#include <linux/version.h> #include <linux/version.h>
#include <linux/kallsyms.h> #include <linux/kallsyms.h>
#include <linux/uaccess.h>
#include "../../../config.h" #include "../../../config.h"
#include "../../mcctrl.h" #include "../../mcctrl.h"

View File

@ -725,7 +725,7 @@ do_pageout(char *fname, void *buf, size_t size, int flag)
return cc; return cc;
} }
si->udata_buf = myalloc(si, UDATA_BUFSIZE); si->udata_buf = myalloc(si, UDATA_BUFSIZE);
si->swapfname = kmalloc(strlen(fname) + 1, IHK_MC_AP_NOWAIT); si->swapfname = kmalloc(strlen_user(fname) + 1, IHK_MC_AP_NOWAIT);
if (si->swapfname == NULL) { if (si->swapfname == NULL) {
kfree(si); kfree(si);
ekprintf("do_pageout: Cannot allocate working memory in kmalloc\n"); ekprintf("do_pageout: Cannot allocate working memory in kmalloc\n");