diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-16 23:24:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-18 12:12:21 -0400 |
commit | dc6b845044ccb7e9e6f3b7e71bd179b3cf0223b6 (patch) | |
tree | 324e094803fe8cfcb5c36010490b92d5b6a8c174 | |
parent | 524196d2ad12cfe29e15d3db7b8d678dde35b5f7 (diff) |
si4713-i2c: avoid potential buffer overflow on si4713
While compiling it with Fedora 15, I noticed this issue:
inlined from ‘si4713_write_econtrol_string’ at drivers/media/radio/si4713-i2c.c:1065:24:
arch/x86/include/asm/uaccess_32.h:211:26: error: call to ‘copy_from_user_overflow’ declared with attribute error: copy_from_user() buffer size is not provably correct
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Reviewed-by: Eugene Teo <eugeneteo@kernel.sg>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/media/radio/si4713-i2c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/radio/si4713-i2c.c b/drivers/media/radio/si4713-i2c.c index deca2e06ff22..c9f4a8e65dc4 100644 --- a/drivers/media/radio/si4713-i2c.c +++ b/drivers/media/radio/si4713-i2c.c | |||
@@ -1033,7 +1033,7 @@ static int si4713_write_econtrol_string(struct si4713_device *sdev, | |||
1033 | char ps_name[MAX_RDS_PS_NAME + 1]; | 1033 | char ps_name[MAX_RDS_PS_NAME + 1]; |
1034 | 1034 | ||
1035 | len = control->size - 1; | 1035 | len = control->size - 1; |
1036 | if (len > MAX_RDS_PS_NAME) { | 1036 | if (len < 0 || len > MAX_RDS_PS_NAME) { |
1037 | rval = -ERANGE; | 1037 | rval = -ERANGE; |
1038 | goto exit; | 1038 | goto exit; |
1039 | } | 1039 | } |
@@ -1057,7 +1057,7 @@ static int si4713_write_econtrol_string(struct si4713_device *sdev, | |||
1057 | char radio_text[MAX_RDS_RADIO_TEXT + 1]; | 1057 | char radio_text[MAX_RDS_RADIO_TEXT + 1]; |
1058 | 1058 | ||
1059 | len = control->size - 1; | 1059 | len = control->size - 1; |
1060 | if (len > MAX_RDS_RADIO_TEXT) { | 1060 | if (len < 0 || len > MAX_RDS_RADIO_TEXT) { |
1061 | rval = -ERANGE; | 1061 | rval = -ERANGE; |
1062 | goto exit; | 1062 | goto exit; |
1063 | } | 1063 | } |