linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
To: mhocko@suse.com
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	penguin-kernel@i-love.sakura.ne.jp, snovitoll@gmail.com,
	viro@zeniv.linux.org.uk
Subject: Re: [PATCH v2] mm: memdup_user*() should use same gfp flags
Date: Tue, 26 Jan 2021 17:13:15 +0600	[thread overview]
Message-ID: <20210126111315.858994-1-snovitoll@gmail.com> (raw)
In-Reply-To: <20210125154455.GO827@dhcp22.suse.cz>

> > Hmm, Sabyrzhan already proposed a patch that adds size check to the caller, but it seems
> > that that patch missed smk_write_ambient()/smk_write_onlycap()/smk_write_unconfined() etc.
> > Oh, bug-prone approach. Why not handle at memdup_user_nul() side?

> I am sorry I do not follow.

Tetsuo refers to this smackfs patch [1], where I've added a length check before
memdup_user_nul().

There are currently 39 references to this function, where length > PAGE_SIZE - 1
or similar sanity check already presents.

So I can't comment on handling it without __GFP_NOWARN at memdup_user_nul() side.

> > Hmm, Sabyrzhan already proposed a patch that adds size check to the caller, but it seems
> > that that patch missed smk_write_ambient()/smk_write_onlycap()/smk_write_unconfined() etc.

Thanks, I will prepare PATCH v2 with a length check for smk_write_* smackfs
functions in [1] patch set.

[1] https://lore.kernel.org/linux-security-module/20210124143627.582115-1-snovitoll@gmail.com/


  reply	other threads:[~2021-01-26 11:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20  4:18 [PATCH] mm: add __GFP_NOWARN to memdup_user_nul() Tetsuo Handa
2021-01-20 10:34 ` [PATCH v2] mm: memdup_user*() should use same gfp flags Tetsuo Handa
2021-01-22  1:35   ` Andrew Morton
2021-01-22 10:47     ` Tetsuo Handa
2021-01-25 13:32       ` Michal Hocko
2021-01-25 14:20         ` Tetsuo Handa
2021-01-25 15:44           ` Michal Hocko
2021-01-26 11:13             ` Sabyrzhan Tasbolatov [this message]
2021-01-27 10:55               ` [PATCH v3] " Tetsuo Handa
2021-01-27 11:59                 ` Michal Hocko
2021-01-27 12:17                   ` Michal Hocko
     [not found]                     ` <3e01b180-0a5b-f2aa-6247-1c3bbcabe1ed@i-love.sakura.ne.jp>
2021-01-27 23:19                       ` Andrew Morton
2021-01-27 23:27                         ` Casey Schaufler
2021-01-28  7:42                           ` Tetsuo Handa
2021-01-28  8:06                         ` Michal Hocko

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=20210126111315.858994-1-snovitoll@gmail.com \
    --to=snovitoll@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=viro@zeniv.linux.org.uk \
    /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).