Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel/relay.c: limit kmalloc size to KMALLOC_MAX_SIZE
chan->n_subbufs is set by the user and relay_create_buf() does a kmalloc() of chan->n_subbufs * sizeof(size_t *). kmalloc_slab() will generate a warning when this fails if chan->subbufs * sizeof(size_t *) > KMALLOC_MAX_SIZE. Limit chan->n_subbufs to the maximum allowed kmalloc() size. Link: http://lkml.kernel.org/r/[email protected] Fixes: f6302f1 ("relay: prevent integer overflow in relay_open()") Signed-off-by: David Rientjes <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Dave Jiang <[email protected]> Cc: Al Viro <[email protected]> Cc: Dan Carpenter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information