mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: Casey Schaufler <casey@schaufler-ca.com>,
	Sabyrzhan Tasbolatov <snovitoll@gmail.com>
Cc: jmorris@namei.org, serge@hallyn.com, andreyknvl@google.com,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	syzbot+a71a442385a0b2815497@syzkaller.appspotmail.com,
	Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH] smackfs: restrict bytes count in smackfs write functions
Date: Tue, 26 Jan 2021 07:42:12 +0900	[thread overview]
Message-ID: <3c35f7cc-1c8d-2fa0-6bc9-bde4e96017ce@i-love.sakura.ne.jp> (raw)
In-Reply-To: <3f33d3a2-c84c-081f-c1c4-424e5eeeb8d2@schaufler-ca.com>

On 2021/01/26 3:08, Casey Schaufler wrote:
> On 1/24/2021 6:36 AM, Sabyrzhan Tasbolatov wrote:
>> syzbot found WARNINGs in several smackfs write operations where
>> bytes count is passed to memdup_user_nul which exceeds
>> GFP MAX_ORDER. Check count size if bigger SMK_LONGLABEL,
>> for smk_write_syslog if bigger than PAGE_SIZE - 1.
>>
>> Reported-by: syzbot+a71a442385a0b2815497@syzkaller.appspotmail.com
>> Signed-off-by: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
> 
> Thank you for the patch. Unfortunately, SMK_LONGLABEL isn't
> the right value in some of these cases. 
> 

Since it uses sscanf(), I think that whitespaces must be excluded from upper limit
check. I'm proposing adding __GFP_NOWARM on the memdup_user_nul() side at
https://lkml.kernel.org/r/20210120103436.11830-1-penguin-kernel@I-love.SAKURA.ne.jp .

  reply	other threads:[~2021-01-25 22:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-24 14:36 Sabyrzhan Tasbolatov
2021-01-25 18:08 ` Casey Schaufler
2021-01-25 22:42   ` Tetsuo Handa [this message]
2021-01-28 11:58     ` [PATCH v2] " Sabyrzhan Tasbolatov
2021-01-28 12:59       ` Tetsuo Handa
2021-01-28 13:27         ` Sabyrzhan Tasbolatov
2021-01-28 14:24           ` Tetsuo Handa
2021-01-29  2:10             ` Casey Schaufler
2021-02-02 19:13               ` Sabyrzhan Tasbolatov
2021-02-02 19:33                 ` Casey Schaufler

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=3c35f7cc-1c8d-2fa0-6bc9-bde4e96017ce@i-love.sakura.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=andreyknvl@google.com \
    --cc=casey@schaufler-ca.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=serge@hallyn.com \
    --cc=snovitoll@gmail.com \
    --cc=syzbot+a71a442385a0b2815497@syzkaller.appspotmail.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

all inboxes | Powered by JetHome®