public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+7536f77535e5210a5c76@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] Re: [syzbot] [tomoyo?] WARNING in tomoyo_write_control
Date: Sun, 15 Dec 2024 23:19:10 -0800	[thread overview]
Message-ID: <675fd46e.050a0220.37aaf.0117.GAE@google.com> (raw)
In-Reply-To: <675f4ea7.050a0220.37aaf.0105.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: Re: [syzbot] [tomoyo?] WARNING in tomoyo_write_control
Author: lizhi.xu@windriver.com

User input a too large avail length 0xfffffdeful.

#syz test

diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 5c7b059a332a..d25752eb8790 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -2656,6 +2656,9 @@ ssize_t tomoyo_write_control(struct tomoyo_io_buffer *head,
 		return -EINVAL;
 	if (mutex_lock_interruptible(&head->io_sem))
 		return -EINTR;
+	if (avail_len << PAGE_SHIFT > MAX_PAGE_ORDER)
+		return -EINVAL;
+
 	cp0 = head->write_buf;
 	head->read_user_buf_avail = 0;
 	idx = tomoyo_read_lock();

  parent reply	other threads:[~2024-12-16  7:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-15 21:48 [syzbot] [tomoyo?] WARNING in tomoyo_write_control syzbot
2024-12-16  2:14 ` [PATCH] tomoyo: Reject excessively long lines Leo Stone
2024-12-16  7:19 ` syzbot [this message]
2024-12-16  7:20 ` [syzbot] Re: [syzbot] [tomoyo?] WARNING in tomoyo_write_control syzbot
2024-12-16  8:19 ` [PATCH] tomoyo: prevent bad buffer size in tracing_cpumask_write Lizhi Xu
2024-12-16 10:06   ` Tetsuo Handa
2024-12-16 10:45 ` [PATCH] tomoyo: don't emit warning in tomoyo_write_control() Tetsuo Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=675fd46e.050a0220.37aaf.0117.GAE@google.com \
    --to=syzbot+7536f77535e5210a5c76@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox