linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: jmorris@namei.org, linux-kernel@vger.kernel.org,
	serge@hallyn.com, linux-security-module@vger.kernel.org,
	syzbot <syzbot+77c53db50c9fff774e8e@syzkaller.appspotmail.com>,
	syzkaller-bugs@googlegroups.com,
	Casey Schaufler <casey@schaufler-ca.com>
Subject: Re: [syzbot] WARNING in smk_set_cipso (2)
Date: Tue, 11 May 2021 09:07:01 -0700	[thread overview]
Message-ID: <9d3b4454-a12c-7578-c079-80338ccfbc2a@schaufler-ca.com> (raw)
In-Reply-To: <d1d73239-c549-c6c0-5b24-5d701b69e3f1@i-love.sakura.ne.jp>

On 4/12/2021 6:28 AM, Tetsuo Handa wrote:
> Commit 7ef4c19d245f3dc2 ("smackfs: restrict bytes count in smackfs write
> functions") missed that count > SMK_CIPSOMAX check applies to only
> format == SMK_FIXED24_FMT case.
>
> Reported-by: syzbot <syzbot+77c53db50c9fff774e8e@syzkaller.appspotmail.com>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>

Added to smack-next. Thank you.

> ---
>  security/smack/smackfs.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
> index 22ded2c26089..1ad7d0d1ea62 100644
> --- a/security/smack/smackfs.c
> +++ b/security/smack/smackfs.c
> @@ -855,6 +855,8 @@ static ssize_t smk_set_cipso(struct file *file, const char __user *buf,
>  	if (format == SMK_FIXED24_FMT &&
>  	    (count < SMK_CIPSOMIN || count > SMK_CIPSOMAX))
>  		return -EINVAL;
> +	if (count > PAGE_SIZE)
> +		return -EINVAL;
>  
>  	data = memdup_user_nul(buf, count);
>  	if (IS_ERR(data))

      reply	other threads:[~2021-05-11 16:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-12  7:00 [syzbot] WARNING in smk_set_cipso (2) syzbot
2021-04-12 13:28 ` Tetsuo Handa
2021-05-11 16:07   ` Casey Schaufler [this message]

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=9d3b4454-a12c-7578-c079-80338ccfbc2a@schaufler-ca.com \
    --to=casey@schaufler-ca.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=serge@hallyn.com \
    --cc=syzbot+77c53db50c9fff774e8e@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /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;
as well as URLs for NNTP newsgroup(s).