[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200824135924.b485e000d358cee817c4f05c@linux-foundation.org>
Date: Mon, 24 Aug 2020 13:59:24 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Muchun Song <songmuchun@...edance.com>
Cc: mike.kravetz@...cle.com, npiggin@...e.de, agl@...ibm.com,
ak@...ux.intel.com, nacc@...ibm.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/hugetlb: Fix a race between hugetlb sysctl handlers
On Sat, 22 Aug 2020 17:53:28 +0800 Muchun Song <songmuchun@...edance.com> wrote:
> There is a race between the assignment of `table->data` and write value
> to the pointer of `table->data` in the __do_proc_doulongvec_minmax().
Where does __do_proc_doulongvec_minmax() write to table->data?
I think you're saying that there is a race between the assignment of
ctl_table->table in hugetlb_sysctl_handler_common() and the assignment
of the same ctl_table->table in hugetlb_overcommit_handler()?
Or not, maybe I'm being thick. Can you please describe the race more
carefully and completely?
> Fix this by duplicating the `table`, and only update the duplicate of
> it. And introduce a helper of proc_hugetlb_doulongvec_minmax() to
> simplify the code.
>
Powered by blists - more mailing lists