lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181025150044.urvklakbzd6jauyb@ca-dmjordan1.us.oracle.com>
Date:   Thu, 25 Oct 2018 08:00:44 -0700
From:   Daniel Jordan <daniel.m.jordan@...cle.com>
To:     "Huang, Ying" <ying.huang@...el.com>
Cc:     Daniel Jordan <daniel.m.jordan@...cle.com>,
        Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Michal Hocko <mhocko@...nel.org>,
        Johannes Weiner <hannes@...xchg.org>,
        Shaohua Li <shli@...nel.org>, Hugh Dickins <hughd@...gle.com>,
        Minchan Kim <minchan@...nel.org>,
        Rik van Riel <riel@...hat.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
        Zi Yan <zi.yan@...rutgers.edu>
Subject: Re: [PATCH -V6 06/21] swap: Support PMD swap mapping when splitting
 huge PMD

On Thu, Oct 25, 2018 at 08:54:16AM +0800, Huang, Ying wrote:
> Daniel Jordan <daniel.m.jordan@...cle.com> writes:
> 
> > On Wed, Oct 10, 2018 at 03:19:09PM +0800, Huang Ying wrote:
> >> +#ifdef CONFIG_THP_SWAP
> >> +/*
> >> + * The corresponding page table shouldn't be changed under us, that
> >> + * is, the page table lock should be held.
> >> + */
> >> +int split_swap_cluster_map(swp_entry_t entry)
> >> +{
> >> +	struct swap_info_struct *si;
> >> +	struct swap_cluster_info *ci;
> >> +	unsigned long offset = swp_offset(entry);
> >> +
> >> +	VM_BUG_ON(!IS_ALIGNED(offset, SWAPFILE_CLUSTER));
> >> +	si = _swap_info_get(entry);
> >> +	if (!si)
> >> +		return -EBUSY;
> >
> > I think this return value doesn't get used anywhere?
> 
> Yes.  And the error is only possible if page table is corrupted.  So
> maybe add a VM_BUG_ON() in it caller __split_huge_swap_pmd()?

Taking a second look at this, I see we'd get some nice pr_err message in this
case, so VM_BUG_ON doesn't seem necessary.

Still odd there's an unchecked return value, but it could be useful to future
callers.  Just my nitpick, feel free to leave as is.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ