提交 9784bd4f 编写于 作者: H Heiko Carstens 提交者: Martin Schwidefsky

s390/vmlogrdr: fix array access in vmlogrdr_open()

Fix check within vmlogrdr_open() if the minor address is not larger
than the number of array elements.

Found with "smatch":

drivers/s390/char/vmlogrdr.c:318 vmlogrdr_open() warn:
  buffer overflow 'sys_ser' 3 <= 3
Acked-by: NStefan Weinhuber <wein@de.ibm.com>
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 0ebfd313
......@@ -313,7 +313,7 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
int ret;
dev_num = iminor(inode);
if (dev_num > MAXMINOR)
if (dev_num >= MAXMINOR)
return -ENODEV;
logptr = &sys_ser[dev_num];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册