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]
Date:   Fri, 18 Jun 2021 10:32:42 +0530
From:   "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>
To:     Nathan Chancellor <nathan@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     Matthew Wilcox <willy@...radead.org>,
        Naresh Kamboju <naresh.kamboju@...aro.org>,
        linux-next@...r.kernel.org, clang-built-linux@...glegroups.com,
        lkft-triage@...ts.linaro.org, linux-kernel@...r.kernel.org,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Arnd Bergmann <arnd@...db.de>,
        Stephen Rothwell <sfr@...b.auug.org.au>
Subject: Re: [next] [clang] x86_64-linux-gnu-ld: mm/mremap.o: in function
 `move_pgt_entry': mremap.c:(.text+0x763): undefined reference to
 `__compiletime_assert_342'

On 6/17/21 11:32 PM, Nathan Chancellor wrote:
> Rebuilt the CC list because most people were added based on the
> incorrect bisect result.
> 
> On Thu, Jun 17, 2021 at 02:51:49PM +0100, Matthew Wilcox wrote:
>> On Thu, Jun 17, 2021 at 06:15:45PM +0530, Naresh Kamboju wrote:
>>> On Thu, 17 Jun 2021 at 17:41, Naresh Kamboju <naresh.kamboju@...aro.org> wrote:
>>>> x86_64-linux-gnu-ld: mm/mremap.o: in function `move_pgt_entry':
>>>> mremap.c:(.text+0x763): undefined reference to `__compiletime_assert_342'
>>>
>>> The git bisect pointed out the first bad commit.
>>>
>>> The first bad commit:
>>> commit 928cf6adc7d60c96eca760c05c1000cda061604e
>>> Author: Stephen Boyd <swboyd@...omium.org>
>>> Date:   Thu Jun 17 15:21:35 2021 +1000
>>>      module: add printk formats to add module build ID to stacktraces
>>
>> Your git bisect probably went astray.  There's no way that commit
>> caused that regression.
> 
> My bisect landed on commit 83f85ac75855 ("mm/mremap: convert huge PUD
> move to separate helper"). flush_pud_tlb_range() evaluates to
> BUILD_BUG() when CONFIG_TRANSPARENT_HUGEPAGE is unset but this function
> is present just based on the value of
> CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD.
> 
> $ make -skj(nproc) ARCH=x86_64 CC=clang O=build/x86_64 distclean allnoconfig mm/mremap.o
> 
> $ llvm-readelf -s build/x86_64/mm/mremap.o &| rg __compiletime_assert
>      21: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND __compiletime_assert_337
> 
> $ rg TRANSPARENT_ build/x86_64/.config
> 450:CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
> 451:CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y
> 562:# CONFIG_TRANSPARENT_HUGEPAGE is not set
> 
> Not sure why this does not happen on newer clang versions, presumably
> something with inlining decisions? Still seems like a legitimate issue
> to me.
> 

gcc 10 also doesn't give a build error. I guess that is because we evaluate

      if (pud_trans_huge(*old_pud) || pud_devmap(*old_pud)) {

  to if (0) with CONFIG_TRANSPARENT_HUGEPAGE disabled.

switching that to if (1) do results in BUILD_BUG triggering.

Should we fix this ?

modified   mm/mremap.c
@@ -336,7 +336,7 @@ static inline bool move_normal_pud(struct 
vm_area_struct *vma,
  }
  #endif

-#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
+#if defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) && 
defined(CONFIG_TRANSPARENT_HUGEPAGE)
  static bool move_huge_pud(struct vm_area_struct *vma, unsigned long 
old_addr,
  			  unsigned long new_addr, pud_t *old_pud, pud_t *new_pud)
  {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ