[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9d3b4454-a12c-7578-c079-80338ccfbc2a@schaufler-ca.com>
Date: Tue, 11 May 2021 09:07:01 -0700
From: Casey Schaufler <casey@...aufler-ca.com>
To: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Cc: jmorris@...ei.org, linux-kernel@...r.kernel.org, serge@...lyn.com,
linux-security-module@...r.kernel.org,
syzbot <syzbot+77c53db50c9fff774e8e@...kaller.appspotmail.com>,
syzkaller-bugs@...glegroups.com,
Casey Schaufler <casey@...aufler-ca.com>
Subject: Re: [syzbot] WARNING in smk_set_cipso (2)
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@...kaller.appspotmail.com>
> Signed-off-by: Tetsuo Handa <penguin-kernel@...ove.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))
Powered by blists - more mailing lists