Skip to content

Commit 9784bd4

Browse files
heicarstMartin Schwidefsky
authored andcommitted
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: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 0ebfd31 commit 9784bd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/s390/char/vmlogrdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
313313
int ret;
314314

315315
dev_num = iminor(inode);
316-
if (dev_num > MAXMINOR)
316+
if (dev_num >= MAXMINOR)
317317
return -ENODEV;
318318
logptr = &sys_ser[dev_num];
319319

0 commit comments

Comments
 (0)