Skip to contentSkip to conversation

Something wrong with copy_from_user() function

PATCH In review Harry Wei 4 participants 5 messages Apr 30, 2011 – May 1, 2011

lore
Share & tools
lore

Harry Wei

author
#0 lore raw

PATCH 1/2 Something wrong with copy_from_user() function

Hi us,
When i was compiling 2.6.38.2 kernel. Something wrong happend to me.
It shows like following.

[...]
Warning: call to 'copy_from_user_overflow' declared with attribute warning:
copy_from_user buffer size is not provably correct.
[...]

See http://s1202.photobucket.com/albums/bb364/harrywei/Kernel/?action=view&current=report_bug.png for details.
I tried to fix this warning, but i don't know how to deal with
it. Can anyone help me.

Thanks.
Harry Wei.

#1 lore raw
Quoted 4 lines · Harry Wei

Hi us,
When i was compiling 2.6.38.2 kernel. Something wrong happend to me.
It shows like following.

Quoted 8 lines

[...]
Warning: call to 'copy_from_user_overflow' declared with attribute warning:
copy_from_user buffer size is not provably correct.
[...]

See http://s1202.photobucket.com/albums/bb364/harrywei/Kernel/?action=view&current=report_bug.png for details.
I tried to fix this warning, but i don't know how to deal with
it. Can anyone help me.

That's a bug (maybe) in drivers/staging/vt6656/wpactl.c, which is a staging driver and therefore liable to be imperfect. You could ignore it or fix it and submit a patch.

(The bug isn't in copy_from_user -- it's an intentional warning in there to indicate that something might be wrong with the caller.)

--Andy

Quoted 3 lines

Thanks.
Harry Wei.

#2 lore raw
In reply to Harry Wei
Quoted 4 lines · Harry Wei

Hi us,
When i was compiling 2.6.38.2 kernel. Something wrong happend to me.
It shows like following.

Quoted 8 lines

[...]
Warning: call to 'copy_from_user_overflow' declared with attribute warning:
copy_from_user buffer size is not provably correct.
[...]

See http://s1202.photobucket.com/albums/bb364/harrywei/Kernel/?action=view&current=report_bug.png for details.
I tried to fix this warning, but i don't know how to deal with
it. Can anyone help me.

wpa_set_keys() function (from staging drivers) in your kernel uses copy_from_user() without proper bounds checking, and thus can overflow and corrupt memory.

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
author
#3 lore raw
Quoted 6 lines · Jiri Kosina

On Sat, 30 Apr 2011, Harry Wei wrote:

wpa_set_keys() function (from staging drivers) in your kernel uses copy_from_user() without proper bounds checking, and thus can overflow and corrupt memory.

Hmmm, i see.

Thanks.
Harry Wei.

Quoted 1 line
#4 lore raw
Quoted 8 lines · Harry Wei
Quoted 6 lines · Jiri Kosina

On Sat, 30 Apr 2011, Harry Wei wrote:

wpa_set_keys() function (from staging drivers) in your kernel uses copy_from_user() without proper bounds checking, and thus can overflow and corrupt memory.

Hmmm, i see.

Patches gladly welcome to fix this :)