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] [day] [month] [year] [list]
Message-ID: <YgpzPru8aFA5sHOI@casper.infradead.org>
Date:   Mon, 14 Feb 2022 15:20:30 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     kernel test robot <lkp@...el.com>,
        Dan Carpenter <dan.carpenter@...cle.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: Re: [willy-pagecache:for-next 52/85] mm/page_vma_mapped.c:246
 page_vma_mapped_walk() warn: always true condition '(pvmw->nr_pages >= (1 <<
 ( - 12))) => (0-u32max >= 0)'

Hey Dan, is this an smatch bug?

On Mon, Feb 14, 2022 at 07:53:39PM +0800, kernel test robot wrote:
> tree:   git://git.infradead.org/users/willy/pagecache for-next
> head:   c267b33d0001488f1d9dad12d6a87655e174d914
> commit: 9733dd1f11d6b6f8a38fa82f0cc014f7840cbd67 [52/85] mm: Convert page_vma_mapped_walk to work on PFNs
> config: xtensa-randconfig-m031-20220213 (https://download.01.org/0day-ci/archive/20220214/202202141933.YLNzdo4f-lkp@intel.com/config)
> compiler: xtensa-linux-gcc (GCC) 11.2.0
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
> 
> smatch warnings:
> mm/page_vma_mapped.c:246 page_vma_mapped_walk() warn: always true condition '(pvmw->nr_pages >= (1 << ( - 12))) => (0-u32max >= 0)'

[...]

>    244				if ((pvmw->flags & PVMW_SYNC) &&
>    245				    transparent_hugepage_active(vma) &&
>  > 246				    (pvmw->nr_pages >= HPAGE_PMD_NR)) {
>    247					spinlock_t *ptl = pmd_lock(mm, pvmw->pmd);

The config in question doesn't enable CONFIG_TRANSPARENT_HUGEPAGE,
so this condition should turn into
	if ((pvmw->flags & PVMW_SYNC) && false && true)
and I don't think smatch should warn on the third clause of the if
being always-true when the second one is false.  Of course, it's not a
literal "false", it's:

static inline bool transparent_hugepage_active(struct vm_area_struct *vma)
{
        return false;
}

unless my debugging / understanding of this issue has gone astray.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ