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: <202212171240.YQeGtMVy-lkp@intel.com>
Date:   Sat, 17 Dec 2022 12:10:04 +0800
From:   kernel test robot <lkp@...el.com>
To:     Baoquan He <bhe@...hat.com>, linux-kernel@...r.kernel.org
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        linux-mm@...ck.org, urezki@...il.com, stephen.s.brennan@...cle.com,
        willy@...radead.org, akpm@...ux-foundation.org, hch@...radead.org,
        Baoquan He <bhe@...hat.com>
Subject: Re: [PATCH v2 3/7] mm/vmalloc.c: allow vread() to read out
 vm_map_ram areas

Hi Baoquan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/Baoquan-He/mm-vmalloc-c-allow-vread-to-read-out-vm_map_ram-areas/20221217-095615
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20221217015435.73889-4-bhe%40redhat.com
patch subject: [PATCH v2 3/7] mm/vmalloc.c: allow vread() to read out vm_map_ram areas
config: powerpc-randconfig-r031-20221216
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 98b13979fb05f3ed288a900deb843e7b27589e58)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/368cd65be8fedd1642e53393dc3f28ff8726122d
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Baoquan-He/mm-vmalloc-c-allow-vread-to-read-out-vm_map_ram-areas/20221217-095615
        git checkout 368cd65be8fedd1642e53393dc3f28ff8726122d
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=powerpc olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> mm/vmalloc.c:3563:35: warning: operator '<<' has lower precedence than '-'; '-' will be evaluated first [-Wshift-op-parentheses]
                   n = (re - rs + 1) << PAGE_SHIFT - offset;
                                     ~~ ~~~~~~~~~~~^~~~~~~~
   mm/vmalloc.c:3563:35: note: place parentheses around the '-' expression to silence this warning
                   n = (re - rs + 1) << PAGE_SHIFT - offset;
                                        ~~~~~~~~~~~^~~~~~~~
   1 warning generated.


vim +3563 mm/vmalloc.c

  3533	
  3534	static void vb_vread(char *buf, char *addr, int count)
  3535	{
  3536		char *start;
  3537		struct vmap_block *vb;
  3538		unsigned long offset;
  3539		unsigned int rs, re, n;
  3540	
  3541		vb = xa_load(&vmap_blocks, addr_to_vb_idx((unsigned long)addr));
  3542	
  3543		spin_lock(&vb->lock);
  3544		if (bitmap_empty(vb->used_map, VMAP_BBMAP_BITS)) {
  3545			spin_unlock(&vb->lock);
  3546			memset(buf, 0, count);
  3547			return;
  3548		}
  3549		for_each_set_bitrange(rs, re, vb->used_map, VMAP_BBMAP_BITS) {
  3550			if (!count)
  3551				break;
  3552			start = vmap_block_vaddr(vb->va->va_start, rs);
  3553			if (addr < start) {
  3554				if (count == 0)
  3555					break;
  3556				*buf = '\0';
  3557				buf++;
  3558				addr++;
  3559				count--;
  3560			}
  3561			/*it could start reading from the middle of used region*/
  3562			offset = offset_in_page(addr);
> 3563			n = (re - rs + 1) << PAGE_SHIFT - offset;
  3564			if (n > count)
  3565				n = count;
  3566			aligned_vread(buf, start+offset, n);
  3567	
  3568			buf += n;
  3569			addr += n;
  3570			count -= n;
  3571		}
  3572		spin_unlock(&vb->lock);
  3573	
  3574		/* zero-fill the left dirty or free regions */
  3575		if (count)
  3576			memset(buf, 0, count);
  3577	}
  3578	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (148472 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ