linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov@parallels.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kbuild-all@01.org, Andres Lagar-Cavilla <andreslc@google.com>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [linux-next:master 3983/4215] fs/proc/page.c:453:8: note: in expansion of macro 'get_user'
Date: Fri, 24 Jul 2015 14:05:28 +0300	[thread overview]
Message-ID: <20150724110528.GA8100@esperanza> (raw)
In-Reply-To: <201507241406.rvBr5f4Q%fengguang.wu@intel.com>

On Fri, Jul 24, 2015 at 02:43:07PM +0800, kbuild test robot wrote:

>    In file included from include/linux/linkage.h:4:0,
>                     from include/linux/preempt.h:9,
>                     from include/linux/spinlock.h:50,
>                     from include/linux/mmzone.h:7,
>                     from include/linux/bootmem.h:7,
>                     from fs/proc/page.c:1:
>    fs/proc/page.c: In function 'kpageidle_write':
> >> include/linux/compiler.h:447:38: error: call to '__compiletime_assert_453' declared with attribute error: BUILD_BUG failed
>      _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
>                                          ^
>    include/linux/compiler.h:430:4: note: in definition of macro '__compiletime_assert'
>        prefix ## suffix();    \
>        ^
>    include/linux/compiler.h:447:2: note: in expansion of macro '_compiletime_assert'
>      _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
>      ^
>    include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
>     #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
>                                         ^
>    include/linux/bug.h:84:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
>     #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
>                         ^
> >> arch/parisc/include/asm/uaccess.h:43:26: note: in expansion of macro 'BUILD_BUG'
>     #define LDD_KERNEL(ptr)  BUILD_BUG()
>                              ^
> >> arch/parisc/include/asm/uaccess.h:93:14: note: in expansion of macro 'LDD_KERNEL'
>          case 8: LDD_KERNEL(ptr); break;   \
>                  ^
> >> arch/parisc/include/asm/uaccess.h:40:18: note: in expansion of macro '__get_user'
>     #define get_user __get_user
>                      ^
> >> fs/proc/page.c:453:8: note: in expansion of macro 'get_user'
>        if (get_user(idle_bitmap, in)) {

The following patch should fix this issue, as well as another
kbuild-test-robot report:

  [linux-next:master 3983/4215] fs/proc/page.o:undefined reference to `__user_bad'

From: Vladimir Davydov <vdavydov@parallels.com>
Subject: [PATCH] proc: kpageidle_write: use copy_from_user instead of get_user

Not all architectures support 8-byte get_user.

Fixes: proc-add-kpageidle-file
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>

diff --git a/fs/proc/page.c b/fs/proc/page.c
index 9daa6e92450f..4191ddb79b84 100644
--- a/fs/proc/page.c
+++ b/fs/proc/page.c
@@ -464,7 +464,7 @@ static ssize_t kpageidle_write(struct file *file, const char __user *buf,
 	for (; pfn < end_pfn; pfn++) {
 		bit = pfn % KPMBITS;
 		if (bit == 0) {
-			if (get_user(idle_bitmap, in)) {
+			if (copy_from_user(&idle_bitmap, in, sizeof(u64))) {
 				ret = -EFAULT;
 				break;
 			}

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2015-07-24 11:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24  6:43 kbuild test robot
2015-07-24 11:05 ` Vladimir Davydov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150724110528.GA8100@esperanza \
    --to=vdavydov@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreslc@google.com \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox