do_pageout: fix direct kernel-user access
Change-Id: Ie02faca93fdb0d52d72e1f2aa1384a214c84ebff Fujitsu: POSTK_DEBUG_ARCH_DEP_46
This commit is contained in:
@ -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"
|
||||||
|
|
||||||
|
|||||||
@ -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");
|
||||||
|
|||||||
Reference in New Issue
Block a user