[ext4:fsverity 10/16] fs//verity/setup.c:612:52: error: 'PAGE_KERNEL_RO' undeclared; did you mean 'PAGE_KERNEL'?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git fsverity
head:   9eca2992eccf2f675fb25ac617cc15702552c582
commit: b7569143a772208e172c59af9f0dfc7b98acadc1 [10/16] [WIP] fs-verity: prototype implementation
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout b7569143a772208e172c59af9f0dfc7b98acadc1
        # save the attached .config to linux build tree
        make.cross ARCH=sparc64 

All errors (new ones prefixed by >>):

   fs//verity/setup.c: In function 'map_fsverity_footer':
   fs//verity/setup.c:612:13: error: implicit declaration of function 'vmap'; did you mean 'kmap'? [-Werror=implicit-function-declaration]
     ftr_virt = vmap(ftr_pages, *nr_ftr_pages, VM_MAP, PAGE_KERNEL_RO);
                ^~~~
                kmap
   fs//verity/setup.c:612:44: error: 'VM_MAP' undeclared (first use in this function); did you mean 'VM_MPX'?
     ftr_virt = vmap(ftr_pages, *nr_ftr_pages, VM_MAP, PAGE_KERNEL_RO);
                                               ^~~~~~
                                               VM_MPX
   fs//verity/setup.c:612:44: note: each undeclared identifier is reported only once for each function it appears in
>> fs//verity/setup.c:612:52: error: 'PAGE_KERNEL_RO' undeclared (first use in this function); did you mean 'PAGE_KERNEL'?
     ftr_virt = vmap(ftr_pages, *nr_ftr_pages, VM_MAP, PAGE_KERNEL_RO);
                                                       ^~~~~~~~~~~~~~
                                                       PAGE_KERNEL
   fs//verity/setup.c: In function 'unmap_fsverity_footer':
   fs//verity/setup.c:637:3: error: implicit declaration of function 'vunmap'; did you mean 'kunmap'? [-Werror=implicit-function-declaration]
      vunmap((void *)((unsigned long)ftr & PAGE_MASK));
      ^~~~~~
      kunmap
   cc1: some warnings being treated as errors

vim +612 fs//verity/setup.c

   505	
   506	/**
   507	 * map_fsverity_footer - map an inode's fs-verity footer into memory
   508	 *
   509	 * If the footer fits in one page, we use kmap; otherwise we use vmap.
   510	 * unmap_fsverity_footer() must be called to unmap it.
   511	 *
   512	 * It's assumed that the file contents cannot be modified concurrently.
   513	 * (This is guaranteed by either deny_write_access() or by the verity bit.)
   514	 *
   515	 * Return: the virtual address of the start of the footer, in virtually
   516	 * contiguous memory.  Also fills in ftr_pages and returns in *ftr_len the
   517	 * length of the footer including all extensions, and in *ftr_start the offset
   518	 * of the footer from the start of the file, in bytes.
   519	 */
   520	static const struct fsverity_footer *
   521	map_fsverity_footer(struct inode *inode, loff_t full_isize,
   522			    struct page *ftr_pages[MAX_FOOTER_PAGES],
   523			    int *nr_ftr_pages, int *ftr_len, loff_t *ftr_start)
   524	{
   525		const int last_validsize = ((full_isize - 1) & ~PAGE_MASK) + 1;
   526		const pgoff_t last_pgoff = (full_isize - 1) >> PAGE_SHIFT;
   527		struct page *last_page;
   528		const void *last_virt;
   529		pgoff_t first_pgoff;
   530		u32 ftr_reverse_offset;
   531		pgoff_t pgoff;
   532		const void *ftr_virt;
   533		int i;
   534		int err;
   535	
   536		*nr_ftr_pages = 0;
   537		*ftr_len = 0;
   538		*ftr_start = 0;
   539	
   540		if (full_isize <= 0) {
   541			pr_warn("File is empty!\n");
   542			return ERR_PTR(-EINVAL);
   543		}
   544	
   545		/*
   546		 * The footer size is given by the ftr_reverse_offset field in the last
   547		 * 4 bytes of the file.
   548		 */
   549		if (last_validsize < sizeof(__le32)) {
   550			pr_warn("Misaligned ftr_reverse_offset\n");
   551			return ERR_PTR(-EINVAL);
   552		}
   553		last_page = inode->i_sb->s_vop->read_metadata_page(inode, last_pgoff);
   554		if (IS_ERR(last_page)) {
   555			pr_warn("Error reading footer page: %ld\n", PTR_ERR(last_page));
   556			return ERR_CAST(last_page);
   557		}
   558		last_virt = kmap(last_page);
   559		ftr_reverse_offset = get_unaligned_le32(last_virt + last_validsize -
   560							sizeof(__le32));
   561		if (ftr_reverse_offset <
   562		    sizeof(struct fsverity_footer) + sizeof(__le32) ||
   563		    ftr_reverse_offset > full_isize) {
   564			pr_warn("Unexpected ftr_reverse_offset: %u\n",
   565				ftr_reverse_offset);
   566			err = -EINVAL;
   567			goto err_out;
   568		}
   569		*ftr_start = full_isize - ftr_reverse_offset;
   570		if (*ftr_start & 7) {
   571			pr_warn("fs-verity footer is misaligned (ftr_start=%lld)\n",
   572				*ftr_start);
   573			err = -EINVAL;
   574			goto err_out;
   575		}
   576	
   577		first_pgoff = *ftr_start >> PAGE_SHIFT;
   578		if (last_pgoff - first_pgoff >= MAX_FOOTER_PAGES) {
   579			pr_warn("fs-verity footer is too long (%lu pages)\n",
   580				last_pgoff - first_pgoff + 1);
   581			err = -EINVAL;
   582			goto err_out;
   583		}
   584	
   585		*ftr_len = ftr_reverse_offset - sizeof(__le32);
   586	
   587		if (first_pgoff == last_pgoff) {
   588			/* Single-page footer; just use the already-kmapped last page */
   589			ftr_pages[0] = last_page;
   590			*nr_ftr_pages = 1;
   591			return last_virt + (*ftr_start & ~PAGE_MASK);
   592		}
   593	
   594		/* Multi-page footer; map the additional pages into memory */
   595	
   596		for (pgoff = first_pgoff; pgoff < last_pgoff; pgoff++) {
   597			struct page *page;
   598	
   599			page = inode->i_sb->s_vop->read_metadata_page(inode, pgoff);
   600			if (IS_ERR(page)) {
   601				err = PTR_ERR(page);
   602				pr_warn("Error reading footer page: %d\n", err);
   603				goto err_out;
   604			}
   605			ftr_pages[(*nr_ftr_pages)++] = page;
   606		}
   607	
   608		ftr_pages[(*nr_ftr_pages)++] = last_page;
   609		kunmap(last_page);
   610		last_page = NULL;
   611	
 > 612		ftr_virt = vmap(ftr_pages, *nr_ftr_pages, VM_MAP, PAGE_KERNEL_RO);
   613		if (!ftr_virt) {
   614			err = -ENOMEM;
   615			goto err_out;
   616		}
   617	
   618		return ftr_virt + (*ftr_start & ~PAGE_MASK);
   619	
   620	err_out:
   621		for (i = 0; i < *nr_ftr_pages; i++)
   622			put_page(ftr_pages[i]);
   623		if (last_page) {
   624			kunmap(last_page);
   625			put_page(last_page);
   626		}
   627		return ERR_PTR(err);
   628	}
   629	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux