[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <afaa721e-f86c-9b49-acd1-54c9017fb269@oracle.com>
Date: Thu, 27 Aug 2020 14:51:01 -0700
From: Mike Kravetz <mike.kravetz@...cle.com>
To: Muchun Song <songmuchun@...edance.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, ak@...ux.intel.com,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [External] Re: [PATCH] mm/hugetlb: Fix a race between hugetlb
sysctl handlers
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
Powered by blists - more mailing lists