提交 dc6b8450 编写于 作者: M Mauro Carvalho Chehab 提交者: Linus Torvalds

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: NMauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: NSakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Acked-by: NEduardo Valentin <edubezval@gmail.com>
Reviewed-by: NEugene Teo <eugeneteo@kernel.sg>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 524196d2
...@@ -1033,7 +1033,7 @@ static int si4713_write_econtrol_string(struct si4713_device *sdev, ...@@ -1033,7 +1033,7 @@ static int si4713_write_econtrol_string(struct si4713_device *sdev,
char ps_name[MAX_RDS_PS_NAME + 1]; char ps_name[MAX_RDS_PS_NAME + 1];
len = control->size - 1; len = control->size - 1;
if (len > MAX_RDS_PS_NAME) { if (len < 0 || len > MAX_RDS_PS_NAME) {
rval = -ERANGE; rval = -ERANGE;
goto exit; goto exit;
} }
...@@ -1057,7 +1057,7 @@ static int si4713_write_econtrol_string(struct si4713_device *sdev, ...@@ -1057,7 +1057,7 @@ static int si4713_write_econtrol_string(struct si4713_device *sdev,
char radio_text[MAX_RDS_RADIO_TEXT + 1]; char radio_text[MAX_RDS_RADIO_TEXT + 1];
len = control->size - 1; len = control->size - 1;
if (len > MAX_RDS_RADIO_TEXT) { if (len < 0 || len > MAX_RDS_RADIO_TEXT) {
rval = -ERANGE; rval = -ERANGE;
goto exit; goto exit;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册