Skip to content

Commit

Permalink
s390/vmlogrdr: fix array access in vmlogrdr_open()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Oct 15, 2013
1 parent 0ebfd31 commit 9784bd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/s390/char/vmlogrdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit 9784bd4

Please sign in to comment.