From: Oliver Hartkopp <socketcan-fJ+pQTUTwRTk1uMJSBkQmQ@public•gmane.org>
To: "Németh Márton" <nm127-Y8qEzhMunLyT9ig0jae3mg@public•gmane.org>,
"Eric Dumazet"
<eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org>
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public•gmane.org,
Network Development
<netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org>,
Oliver Hartkopp
<oliver.hartkopp-l29pVbxQd1IUtdQbppsyvg@public•gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public•gmane.org>,
Urs Thuermann
<urs.thuermann-l29pVbxQd1IUtdQbppsyvg@public•gmane.org>
Subject: Re: Linux 2.6.34-rc3 + CAN build problem
Date: Sat, 10 Apr 2010 14:36:48 +0200 [thread overview]
Message-ID: <4BC070E0.6070601@hartkopp.net> (raw)
In-Reply-To: <4BC054AE.7040303-Y8qEzhMunLyT9ig0jae3mg@public.gmane.org>
Németh Márton wrote:
> Eric Dumazet írta:
>> Le samedi 10 avril 2010 à 10:13 +0200, Németh Márton a écrit :
>>> Hi,
>>>
>>> I have some problem building Liunux kernel 2.6.34-rc3 with the attached .config:
>>>
>>> $ make clean bzImage modules
>>> [...]
>>> CC net/socket.o
>>> LD net/802/built-in.o
>>> LD net/can/built-in.o
>>> CC [M] net/can/bcm.o
>>> CC [M] net/can/raw.o
>>> In file included from /mnt/store/nmarci/src/linux-2.6.34-rc3/arch/x86/include/asm/uaccess.h:571,
>>> from include/net/checksum.h:25,
>>> from include/linux/skbuff.h:28,
>>> from include/linux/if_ether.h:124,
>>> from include/linux/netdevice.h:29,
>>> from net/can/raw.c:48:
>>> In function ‘copy_from_user’,
>>> inlined from ‘raw_setsockopt’ at net/can/raw.c:447:
>>> /mnt/store/nmarci/src/linux-2.6.34-rc3/arch/x86/include/asm/uaccess_32.h:212: error: call to ‘copy_from_user_overflow’ declared with attribute error:
>>> copy_from_user() buffer size is not provably correct
>>> make[2]: *** [net/can/raw.o] Error 1
>>> make[1]: *** [net/can] Error 2
>>> make: *** [net] Error 2
>>>
>>>
>> Could you give us your compiler version ?
>
> $ gcc --version
> gcc (Debian 4.4.2-9) 4.4.3 20100108 (prerelease)
> Copyright (C) 2009 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
>> Code is fine, but compiler a bit dumb :(
>>
>> [PATCH] can: avoids a false warning
>>
>> At this point optlen == sizeof(sfilter) but some compilers are dumb.
>>
>> Reported-by: Németh Márton <nm127@freemail•h
>> Signed-off-by: Eric Dumazet <eric.dumazet@gmail•com>
Acked-by: Oliver Hartkopp <oliver@hartkopp•net>
Btw. i'm using the same compiler here (Debian Squeeze), and i did not have any
build problems with 2.6.24-rc3 and the following kernels like the currently
running 2.6.34-rc3-00288-gab195c5:
$ cat /proc/version
Linux version 2.6.34-rc3-00288-gab195c5 (hartko@vwagwolkf320) (gcc version
4.4.3 20100108 (prerelease) (Debian 4.4.2-9) ) #70 SMP Tue Apr 6 19:14:52 CEST
2010
So i wonder why Nemeth trapped into this problem ... probably an include file
mix-up?
Regards,
Oliver
>> ---
>> diff --git a/net/can/raw.c b/net/can/raw.c
>> index 3a7dffb..da99cf1 100644
>> --- a/net/can/raw.c
>> +++ b/net/can/raw.c
>> @@ -445,7 +445,7 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
>> return -EFAULT;
>> }
>> } else if (count == 1) {
>> - if (copy_from_user(&sfilter, optval, optlen))
>> + if (copy_from_user(&sfilter, optval, sizeof(sfilter)))
>> return -EFAULT;
>> }
>>
_______________________________________________
Socketcan-core mailing list
Socketcan-core@lists•berlios.de
https://lists.berlios.de/mailman/listinfo/socketcan-core
next prev parent reply other threads:[~2010-04-10 12:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-10 8:13 Linux 2.6.34-rc3 + CAN build problem Németh Márton
2010-04-10 9:47 ` Eric Dumazet
2010-04-10 10:36 ` Németh Márton
[not found] ` <4BC054AE.7040303-Y8qEzhMunLyT9ig0jae3mg@public.gmane.org>
2010-04-10 12:36 ` Oliver Hartkopp [this message]
2010-04-10 22:50 ` David Miller
2010-04-11 5:14 ` Németh Márton
2010-04-11 5:16 ` David Miller
[not found] ` <20100410.155009.66184583.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2010-04-11 18:53 ` Oliver Hartkopp
2010-04-11 20:19 ` David Miller
2010-04-10 22:48 ` David Miller
2010-04-13 10:09 ` David Miller
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=4BC070E0.6070601@hartkopp.net \
--to=socketcan-fj+pqtutwrtk1umjsbkqmq@public$(echo .)gmane.org \
--cc=eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public$(echo .)gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
--cc=nm127-Y8qEzhMunLyT9ig0jae3mg@public$(echo .)gmane.org \
--cc=oliver.hartkopp-l29pVbxQd1IUtdQbppsyvg@public$(echo .)gmane.org \
--cc=socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public$(echo .)gmane.org \
--cc=urs.thuermann-l29pVbxQd1IUtdQbppsyvg@public$(echo .)gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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