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>] [day] [month] [year] [list]
Message-ID: <202112211124.akx29yxL-lkp@intel.com>
Date:   Tue, 21 Dec 2021 12:06:21 +0800
From:   kernel test robot <lkp@...el.com>
To:     David Hildenbrand <david@...hat.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Andrea Arcangeli <aarcange@...hat.com>,
        Peter Xu <peterx@...hat.com>
Subject: [davidhildenbrand:unshare_new 3/4] mm/gup.c:39:6: error: conflicting
 types for 'gup_must_unshare'

tree:   git://github.com/davidhildenbrand/linux unshare_new
head:   0b0d58f51fe2675e4dcfb11263ad4cbec053711f
commit: d3eb6d68346c3d9e89ae68461e0eabb5bc7def17 [3/4] mm: gup: trigger unsharing via FAULT_FLAG_UNSHARE when required (!hugetlb)
config: um-i386_defconfig (https://download.01.org/0day-ci/archive/20211221/202112211124.akx29yxL-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/davidhildenbrand/linux/commit/d3eb6d68346c3d9e89ae68461e0eabb5bc7def17
        git remote add davidhildenbrand git://github.com/davidhildenbrand/linux
        git fetch --no-tags davidhildenbrand unshare_new
        git checkout d3eb6d68346c3d9e89ae68461e0eabb5bc7def17
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=um SUBARCH=i386 SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

   In file included from mm/gup.c:7:
   include/linux/mm.h: In function 'page_needs_cow_for_dma':
   include/linux/mm.h:1384:24: error: implicit declaration of function 'PageAnonUnshared' [-Werror=implicit-function-declaration]
    1384 |  if (PageAnon(page) && PageAnonUnshared(page)) {
         |                        ^~~~~~~~~~~~~~~~
   include/linux/mm.h:1386:4: error: implicit declaration of function 'ClearPageAnonUnshared' [-Werror=implicit-function-declaration]
    1386 |    ClearPageAnonUnshared(page);
         |    ^~~~~~~~~~~~~~~~~~~~~
   mm/gup.c: At top level:
>> mm/gup.c:39:6: error: conflicting types for 'gup_must_unshare'
      39 | bool gup_must_unshare(unsigned int flags, struct page *page)
         |      ^~~~~~~~~~~~~~~~
   In file included from mm/gup.c:7:
   include/linux/mm.h:3086:13: note: previous declaration of 'gup_must_unshare' was here
    3086 | extern bool gup_must_unshare(unsigned int flags, struct page *page,
         |             ^~~~~~~~~~~~~~~~
   mm/gup.c: In function 'follow_page_pte':
   mm/gup.c:595:7: error: implicit declaration of function 'mark_anon_page_exclusive' [-Werror=implicit-function-declaration]
     595 |   if (mark_anon_page_exclusive(page, pte_write(pte))) {
         |       ^~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/gup_must_unshare +39 mm/gup.c

     6	
   > 7	#include <linux/mm.h>
     8	#include <linux/memremap.h>
     9	#include <linux/pagemap.h>
    10	#include <linux/rmap.h>
    11	#include <linux/swap.h>
    12	#include <linux/swapops.h>
    13	#include <linux/secretmem.h>
    14	
    15	#include <linux/sched/signal.h>
    16	#include <linux/rwsem.h>
    17	#include <linux/hugetlb.h>
    18	#include <linux/migrate.h>
    19	#include <linux/mm_inline.h>
    20	#include <linux/sched/mm.h>
    21	
    22	#include <asm/mmu_context.h>
    23	#include <asm/tlbflush.h>
    24	
    25	#include "internal.h"
    26	
    27	struct follow_page_context {
    28		struct dev_pagemap *pgmap;
    29		unsigned int page_mask;
    30	};
    31	
    32	/*
    33	 * Indicates for which pages we have to trigger unsharing first to make
    34	 * anonymous pages exclusive to the MM. Once exlusive, only fork() can
    35	 * turn the pages !exclusive -- and only if there are no additional references.
    36	 *
    37	 * This function is safe to be called in IRQ context.
    38	 */
  > 39	bool gup_must_unshare(unsigned int flags, struct page *page)
    40	{
    41		if (flags & FOLL_NOUNSHARE)
    42			return false;
    43		else if (!(flags & FOLL_UNSHARE)) {
    44			/*
    45			 * As a default, unshare only for FOLL_PIN. The corner cases
    46			 * that cannot use FOLL_PIN right now and have to use FOLL_GET
    47			 * (i.e., O_DIRECT), although they are reading/writing page
    48			 * content should manually set FOLL_UNSHARE with FOLL_GET.
    49			 */
    50			if (!(flags & FOLL_PIN))
    51				return false;
    52		}
    53		/*
    54		 * All of the following properties should be stable also during
    55		 * gup-fast-only, whereby we hold a reference to the compound page.
    56		 * (similarly to the page_is_secretmem() check) and require a proper
    57		 * sync on unmap from the page table to avoid use-after-free.
    58		 */
    59		if (!PageAnon(page))
    60			return false;
    61		if (PageKsm(page))
    62			return false;
    63		if (PageHuge(page))
    64			/* TODO: handle hugetlb as well. */
    65			return false;
    66		/*
    67		 * Without the mmap_lock, this can change during fork(). gup-fast-only
    68		 * is handled properly via the mm->write_protect_seq and undos the
    69		 * pinning in case we detect that fork() might have changed this.
    70		 */
    71		return !PageAnonExclusive(page);
    72	}
    73	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ