All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: build failure in drivers/mfd/aat2870-core.c
@ 2011-09-28 22:10 Paul Gortmaker
       [not found] ` <D9A2FA38A1E15B4E832469E5FE40C7ABFA07D3E667@HKMAIL01.nvidia.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Gortmaker @ 2011-09-28 22:10 UTC (permalink / raw)
  To: Samuel Ortiz, jinyoungp; +Cc: linux-next

Hi folks,

I was testing an x86_64 allyesconfig in today's next tree,
and came across this compile error:

In file included from /home/paul/4.x/module.h/linux-2.6.git/arch/x86/include/asm/uaccess.h:575,
                 from /home/paul/4.x/module.h/linux-2.6.git/include/linux/uaccess.h:5,
                 from /home/paul/4.x/module.h/linux-2.6.git/drivers/mfd/aat2870-core.c:27:
In function ‘copy_from_user’,
    inlined from ‘aat2870_reg_write_file’ at /home/paul/4.x/module.h/linux-2.6.git/drivers/mfd/aat2870-core.c:304:
/home/paul/4.x/module.h/linux-2.6.git/arch/x86/include/asm/uaccess_64.h:64: error: call to ‘copy_from_user_overflow’ declared with attribute error: copy_from_user() buffer size is not provably correct
make[3]: *** [drivers/mfd/aat2870-core.o] Error 1

I wasn't sure if any of you were aware of this yet. as I didn't
see it mentioned in the recent linux-next traffic

Paul.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: build failure in drivers/mfd/aat2870-core.c
       [not found] ` <D9A2FA38A1E15B4E832469E5FE40C7ABFA07D3E667@HKMAIL01.nvidia.com>
@ 2011-09-30 11:47   ` Jin Park
  2011-09-30 15:46     ` Paul Gortmaker
  2011-10-04 10:37     ` Samuel Ortiz
  0 siblings, 2 replies; 4+ messages in thread
From: Jin Park @ 2011-09-30 11:47 UTC (permalink / raw)
  To: Paul Gortmaker, Samuel Ortiz; +Cc: linux-next

Hi, Paul

I have checked aat2870-core.c build problem when x86_64 and got the
same error with you.

This error occurred since merged below change.
----------------------------------------------------------------------------------
commit da417bacc9143b934f1a480a25d0fb2bb648a820
Author: Stephen Boyd <sboyd@codeaurora.org>
Date:   Wed Sep 28 10:50:29 2011 +1000

    x86: implement strict user copy checks for x86_64
----------------------------------------------------------------------------------
The above change is check object size and copy size for
copy_from_user() to prevent overflow.

The root cause is not matched type of size parameter for
copy_from_user() in aat2870-core.c for x86_64.
Because I just passed int type for size parameter to copy_from_user().
It has no problem for i386, but has problem for x86_64.


This is the patch for this build problem. Please review it.

mfd: aat2870: Fix build failure for x86_64

Signed-off-by: Jin Park <jinyoungp@nvidia.com>
---
 drivers/mfd/aat2870-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index 345dc65..02c4201 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -295,7 +295,7 @@ static ssize_t aat2870_reg_write_file(struct file *file,
 {
 	struct aat2870_data *aat2870 = file->private_data;
 	char buf[32];
-	int buf_size;
+	ssize_t buf_size;
 	char *start = buf;
 	unsigned long addr, val;
 	int ret;
-- 
1.7.1

Thanks,
Jin Park

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: linux-next: build failure in drivers/mfd/aat2870-core.c
  2011-09-30 11:47   ` Jin Park
@ 2011-09-30 15:46     ` Paul Gortmaker
  2011-10-04 10:37     ` Samuel Ortiz
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Gortmaker @ 2011-09-30 15:46 UTC (permalink / raw)
  To: Jin Park; +Cc: Samuel Ortiz, linux-next

On 11-09-30 07:47 AM, Jin Park wrote:
> Hi, Paul
> 
> I have checked aat2870-core.c build problem when x86_64 and got the
> same error with you.
> 
> This error occurred since merged below change.
> ----------------------------------------------------------------------------------
> commit da417bacc9143b934f1a480a25d0fb2bb648a820
> Author: Stephen Boyd <sboyd@codeaurora.org>
> Date:   Wed Sep 28 10:50:29 2011 +1000
> 
>     x86: implement strict user copy checks for x86_64
> ----------------------------------------------------------------------------------
> The above change is check object size and copy size for
> copy_from_user() to prevent overflow.
> 
> The root cause is not matched type of size parameter for
> copy_from_user() in aat2870-core.c for x86_64.
> Because I just passed int type for size parameter to copy_from_user().
> It has no problem for i386, but has problem for x86_64.
> 
> 
> This is the patch for this build problem. Please review it.

You've got good information above about how you discovered the
root cause and which pending commit triggers the issue, but then
the commit below only has a minimal shortlog and no additional
information whatsoever.  I'd suggest capturing your information
in the commit's long log, so it is there for everyone, and not
just available to the people who happen to read this thread.

Thanks,
Paul.

> 
> mfd: aat2870: Fix build failure for x86_64
> 
> Signed-off-by: Jin Park <jinyoungp@nvidia.com>
> ---
>  drivers/mfd/aat2870-core.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
> index 345dc65..02c4201 100644
> --- a/drivers/mfd/aat2870-core.c
> +++ b/drivers/mfd/aat2870-core.c
> @@ -295,7 +295,7 @@ static ssize_t aat2870_reg_write_file(struct file *file,
>  {
>  	struct aat2870_data *aat2870 = file->private_data;
>  	char buf[32];
> -	int buf_size;
> +	ssize_t buf_size;
>  	char *start = buf;
>  	unsigned long addr, val;
>  	int ret;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: build failure in drivers/mfd/aat2870-core.c
  2011-09-30 11:47   ` Jin Park
  2011-09-30 15:46     ` Paul Gortmaker
@ 2011-10-04 10:37     ` Samuel Ortiz
  1 sibling, 0 replies; 4+ messages in thread
From: Samuel Ortiz @ 2011-10-04 10:37 UTC (permalink / raw)
  To: Jin Park; +Cc: Paul Gortmaker, linux-next

Hi Jin,

On Fri, Sep 30, 2011 at 08:47:41PM +0900, Jin Park wrote:
> Hi, Paul
> 
> I have checked aat2870-core.c build problem when x86_64 and got the
> same error with you.
> 
> This error occurred since merged below change.
> ----------------------------------------------------------------------------------
> commit da417bacc9143b934f1a480a25d0fb2bb648a820
> Author: Stephen Boyd <sboyd@codeaurora.org>
> Date:   Wed Sep 28 10:50:29 2011 +1000
> 
>     x86: implement strict user copy checks for x86_64
> ----------------------------------------------------------------------------------
> The above change is check object size and copy size for
> copy_from_user() to prevent overflow.
> 
> The root cause is not matched type of size parameter for
> copy_from_user() in aat2870-core.c for x86_64.
> Because I just passed int type for size parameter to copy_from_user().
> It has no problem for i386, but has problem for x86_64.
> 
> 
> This is the patch for this build problem. Please review it.
I applied this patch and fixed the changelog to be slightly more descriptive.
Thanks a lot for the fix.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-04 10:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-28 22:10 linux-next: build failure in drivers/mfd/aat2870-core.c Paul Gortmaker
     [not found] ` <D9A2FA38A1E15B4E832469E5FE40C7ABFA07D3E667@HKMAIL01.nvidia.com>
2011-09-30 11:47   ` Jin Park
2011-09-30 15:46     ` Paul Gortmaker
2011-10-04 10:37     ` Samuel Ortiz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.