diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index 5c7b059a332a..65458b4059ab 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c @@ -2654,6 +2654,8 @@ ssize_t tomoyo_write_control(struct tomoyo_io_buffer *head, if (!head->write) return -EINVAL; + if (avail_len << PAGE_SHIFT > MAX_PAGE_ORDER) + return -EINVAL; if (mutex_lock_interruptible(&head->io_sem)) return -EINTR; cp0 = head->write_buf;