From: Mike Kravetz <mike.kravetz@oracle.com>
To: Muchun Song <songmuchun@bytedance.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
ak@linux.intel.com,
Linux Memory Management List <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [External] Re: [PATCH] mm/hugetlb: Fix a race between hugetlb sysctl handlers
Date: Thu, 27 Aug 2020 14:51:01 -0700 [thread overview]
Message-ID: <afaa721e-f86c-9b49-acd1-54c9017fb269@oracle.com> (raw)
In-Reply-To: <CAMZfGtWj5_Uh2KFAy4DGc0vzrNm4+Nge7rOBDAFQhh2aN7wOqA@mail.gmail.com>
On 8/25/20 7:47 PM, Muchun Song wrote:
>
> CPU0: CPU1:
> proc_sys_write
> hugetlb_sysctl_handler proc_sys_call_handler
> hugetlb_sysctl_handler_common hugetlb_sysctl_handler
> table->data = &tmp; hugetlb_sysctl_handler_common
> table->data = &tmp;
> proc_doulongvec_minmax
> do_proc_doulongvec_minmax sysctl_head_finish
> __do_proc_doulongvec_minmax
> i = table->data;
> *i = val; // corrupt CPU1 stack
Thanks Muchun!
Can you please add this to the commit message.
Also, when looking closer at the patch I do not think setting table->maxlen
is necessary in these routines. maxlen is set when the hugetlb ctl_table
entries are defined and initialized. This is not something you introduced.
The unnecessary assignments are in the existing code. However, there is no
need to carry them forward.
--
Mike Kravetz
next prev parent reply other threads:[~2020-08-27 21:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-22 9:53 [PATCH] mm/hugetlb: Fix a race between hugetlb sysctl handlers Muchun Song
2020-08-24 20:59 ` Andrew Morton
2020-08-24 21:19 ` Mike Kravetz
2020-08-25 3:01 ` [External] " Muchun Song
2020-08-26 0:01 ` Mike Kravetz
2020-08-26 2:47 ` Muchun Song
2020-08-27 21:51 ` Mike Kravetz [this message]
2020-08-28 2:33 ` Muchun Song
2020-08-25 2:42 ` Muchun Song
2020-08-25 15:25 ` Andi Kleen
2020-08-26 2:34 ` [Phishing Risk] [External] " Muchun Song
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=afaa721e-f86c-9b49-acd1-54c9017fb269@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=songmuchun@bytedance.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).