tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: d31958b30ea3b7b6e522d6bf449427748ad45822
commit: 628a164a8dbe75ab0a60883e64956d4229c34306 [7218/7247] Merge branch
'akpm-current/current'
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
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
git checkout 628a164a8dbe75ab0a60883e64956d4229c34306
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/arm64/kernel/mte.c: In function '__access_remote_tags':
> arch/arm64/kernel/mte.c:224:31: error: passing argument 1 of
'get_user_pages_remote' from incompatible pointer type
[-Werror=incompatible-pointer-types]
224 | ret = get_user_pages_remote(tsk,
mm, addr, 1, gup_flags,
| ^~~
| |
| struct task_struct *
In file included from arch/arm64/kernel/mte.c:8:
include/linux/mm.h:1704:46: note: expected 'struct mm_struct *' but argument is
of type 'struct task_struct *'
1704 | long get_user_pages_remote(struct mm_struct *mm,
| ~~~~~~~~~~~~~~~~~~^~
arch/arm64/kernel/mte.c:224:36: warning: passing argument 2 of
'get_user_pages_remote' makes integer from pointer without a cast
[-Wint-conversion]
224 | ret = get_user_pages_remote(tsk, mm, addr, 1, gup_flags,
| ^~
| |
| struct mm_struct *
In file included from arch/arm64/kernel/mte.c:8:
include/linux/mm.h:1705:22: note: expected 'long unsigned int' but argument is
of type 'struct mm_struct *'
1705 | unsigned long start, unsigned long nr_pages,
| ~~~~~~~~~~~~~~^~~~~
arch/arm64/kernel/mte.c:224:49: warning: passing argument 5 of
'get_user_pages_remote' makes pointer from integer without a cast
[-Wint-conversion]
224 | ret = get_user_pages_remote(tsk, mm, addr, 1, gup_flags,
| ^~~~~~~~~
| |
| unsigned int
In file included from arch/arm64/kernel/mte.c:8:
include/linux/mm.h:1706:46: note: expected 'struct page **' but argument is of
type 'unsigned int'
1706 | unsigned int gup_flags, struct page **pages,
| ~~~~~~~~~~~~~~^~~~~
arch/arm64/kernel/mte.c:225:10: error: passing argument 6 of
'get_user_pages_remote' from incompatible pointer type
[-Werror=incompatible-pointer-types]
225 | &page, &vma, NULL);
| ^~~~~
| |
| struct page **
In file included from arch/arm64/kernel/mte.c:8:
include/linux/mm.h:1707:32: note: expected 'struct vm_area_struct **' but
argument is of type 'struct page **'
1707 | struct vm_area_struct **vmas, int *locked);
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
arch/arm64/kernel/mte.c:225:17: error: passing argument 7 of
'get_user_pages_remote' from incompatible pointer type
[-Werror=incompatible-pointer-types]
225 | &page, &vma, NULL);
| ^~~~
| |
| struct vm_area_struct **
In file included from arch/arm64/kernel/mte.c:8:
include/linux/mm.h:1707:43: note: expected 'int *' but argument is of type
'struct vm_area_struct **'
1707 | struct vm_area_struct **vmas, int *locked);
| ~~~~~^~~~~~
> arch/arm64/kernel/mte.c:224:9: error: too many arguments to
function 'get_user_pages_remote'
224 | ret =
get_user_pages_remote(tsk, mm, addr, 1, gup_flags,
| ^~~~~~~~~~~~~~~~~~~~~
In file included from arch/arm64/kernel/mte.c:8:
include/linux/mm.h:1704:6: note: declared here
1704 | long get_user_pages_remote(struct mm_struct *mm,
| ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/get_user_pages_remote +224 arch/arm64/kernel/mte.c
e76b573f11d1c5 Catalin Marinas 2020-03-30 197
e76b573f11d1c5 Catalin Marinas 2020-03-30 198 /*
e76b573f11d1c5 Catalin Marinas 2020-03-30 199 * Access MTE tags in another process'
address space as given in mm. Update
e76b573f11d1c5 Catalin Marinas 2020-03-30 200 * the number of tags copied. Return 0 if
any tags copied, error otherwise.
e76b573f11d1c5 Catalin Marinas 2020-03-30 201 * Inspired by __access_remote_vm().
e76b573f11d1c5 Catalin Marinas 2020-03-30 202 */
e76b573f11d1c5 Catalin Marinas 2020-03-30 203 static int __access_remote_tags(struct
task_struct *tsk, struct mm_struct *mm,
e76b573f11d1c5 Catalin Marinas 2020-03-30 204 unsigned long addr, struct iovec
*kiov,
e76b573f11d1c5 Catalin Marinas 2020-03-30 205 unsigned int gup_flags)
e76b573f11d1c5 Catalin Marinas 2020-03-30 206 {
e76b573f11d1c5 Catalin Marinas 2020-03-30 207 struct vm_area_struct *vma;
e76b573f11d1c5 Catalin Marinas 2020-03-30 208 void __user *buf = kiov->iov_base;
e76b573f11d1c5 Catalin Marinas 2020-03-30 209 size_t len = kiov->iov_len;
e76b573f11d1c5 Catalin Marinas 2020-03-30 210 int ret;
e76b573f11d1c5 Catalin Marinas 2020-03-30 211 int write = gup_flags & FOLL_WRITE;
e76b573f11d1c5 Catalin Marinas 2020-03-30 212
e76b573f11d1c5 Catalin Marinas 2020-03-30 213 if (!access_ok(buf, len))
e76b573f11d1c5 Catalin Marinas 2020-03-30 214 return -EFAULT;
e76b573f11d1c5 Catalin Marinas 2020-03-30 215
e76b573f11d1c5 Catalin Marinas 2020-03-30 216 if (mmap_read_lock_killable(mm))
e76b573f11d1c5 Catalin Marinas 2020-03-30 217 return -EIO;
e76b573f11d1c5 Catalin Marinas 2020-03-30 218
e76b573f11d1c5 Catalin Marinas 2020-03-30 219 while (len) {
e76b573f11d1c5 Catalin Marinas 2020-03-30 220 unsigned long tags, offset;
e76b573f11d1c5 Catalin Marinas 2020-03-30 221 void *maddr;
e76b573f11d1c5 Catalin Marinas 2020-03-30 222 struct page *page = NULL;
e76b573f11d1c5 Catalin Marinas 2020-03-30 223
e76b573f11d1c5 Catalin Marinas 2020-03-30 @224 ret = get_user_pages_remote(tsk, mm,
addr, 1, gup_flags,
e76b573f11d1c5 Catalin Marinas 2020-03-30 225 &page, &vma, NULL);
e76b573f11d1c5 Catalin Marinas 2020-03-30 226 if (ret <= 0)
e76b573f11d1c5 Catalin Marinas 2020-03-30 227 break;
e76b573f11d1c5 Catalin Marinas 2020-03-30 228
e76b573f11d1c5 Catalin Marinas 2020-03-30 229 /*
e76b573f11d1c5 Catalin Marinas 2020-03-30 230 * Only copy tags if the page has been
mapped as PROT_MTE
e76b573f11d1c5 Catalin Marinas 2020-03-30 231 * (PG_mte_tagged set). Otherwise the
tags are not valid and
e76b573f11d1c5 Catalin Marinas 2020-03-30 232 * not accessible to user. Moreover, an
mprotect(PROT_MTE)
e76b573f11d1c5 Catalin Marinas 2020-03-30 233 * would cause the existing tags to be
cleared if the page
e76b573f11d1c5 Catalin Marinas 2020-03-30 234 * was never mapped with PROT_MTE.
e76b573f11d1c5 Catalin Marinas 2020-03-30 235 */
e76b573f11d1c5 Catalin Marinas 2020-03-30 236 if (!test_bit(PG_mte_tagged,
&page->flags)) {
e76b573f11d1c5 Catalin Marinas 2020-03-30 237 ret = -EOPNOTSUPP;
e76b573f11d1c5 Catalin Marinas 2020-03-30 238 put_page(page);
e76b573f11d1c5 Catalin Marinas 2020-03-30 239 break;
e76b573f11d1c5 Catalin Marinas 2020-03-30 240 }
e76b573f11d1c5 Catalin Marinas 2020-03-30 241
e76b573f11d1c5 Catalin Marinas 2020-03-30 242 /* limit access to the end of the page
*/
e76b573f11d1c5 Catalin Marinas 2020-03-30 243 offset = offset_in_page(addr);
e76b573f11d1c5 Catalin Marinas 2020-03-30 244 tags = min(len, (PAGE_SIZE - offset) /
MTE_GRANULE_SIZE);
e76b573f11d1c5 Catalin Marinas 2020-03-30 245
e76b573f11d1c5 Catalin Marinas 2020-03-30 246 maddr = page_address(page);
e76b573f11d1c5 Catalin Marinas 2020-03-30 247 if (write) {
e76b573f11d1c5 Catalin Marinas 2020-03-30 248 tags = mte_copy_tags_from_user(maddr +
offset, buf, tags);
e76b573f11d1c5 Catalin Marinas 2020-03-30 249 set_page_dirty_lock(page);
e76b573f11d1c5 Catalin Marinas 2020-03-30 250 } else {
e76b573f11d1c5 Catalin Marinas 2020-03-30 251 tags = mte_copy_tags_to_user(buf, maddr
+ offset, tags);
e76b573f11d1c5 Catalin Marinas 2020-03-30 252 }
e76b573f11d1c5 Catalin Marinas 2020-03-30 253 put_page(page);
e76b573f11d1c5 Catalin Marinas 2020-03-30 254
e76b573f11d1c5 Catalin Marinas 2020-03-30 255 /* error accessing the tracer's
buffer */
e76b573f11d1c5 Catalin Marinas 2020-03-30 256 if (!tags)
e76b573f11d1c5 Catalin Marinas 2020-03-30 257 break;
e76b573f11d1c5 Catalin Marinas 2020-03-30 258
e76b573f11d1c5 Catalin Marinas 2020-03-30 259 len -= tags;
e76b573f11d1c5 Catalin Marinas 2020-03-30 260 buf += tags;
e76b573f11d1c5 Catalin Marinas 2020-03-30 261 addr += tags * MTE_GRANULE_SIZE;
e76b573f11d1c5 Catalin Marinas 2020-03-30 262 }
e76b573f11d1c5 Catalin Marinas 2020-03-30 263 mmap_read_unlock(mm);
e76b573f11d1c5 Catalin Marinas 2020-03-30 264
e76b573f11d1c5 Catalin Marinas 2020-03-30 265 /* return an error if no tags copied */
e76b573f11d1c5 Catalin Marinas 2020-03-30 266 kiov->iov_len = buf -
kiov->iov_base;
e76b573f11d1c5 Catalin Marinas 2020-03-30 267 if (!kiov->iov_len) {
e76b573f11d1c5 Catalin Marinas 2020-03-30 268 /* check for error accessing the
tracee's address space */
e76b573f11d1c5 Catalin Marinas 2020-03-30 269 if (ret <= 0)
e76b573f11d1c5 Catalin Marinas 2020-03-30 270 return -EIO;
e76b573f11d1c5 Catalin Marinas 2020-03-30 271 else
e76b573f11d1c5 Catalin Marinas 2020-03-30 272 return -EFAULT;
e76b573f11d1c5 Catalin Marinas 2020-03-30 273 }
e76b573f11d1c5 Catalin Marinas 2020-03-30 274
e76b573f11d1c5 Catalin Marinas 2020-03-30 275 return 0;
e76b573f11d1c5 Catalin Marinas 2020-03-30 276 }
e76b573f11d1c5 Catalin Marinas 2020-03-30 277
:::::: The code at line 224 was first introduced by commit
:::::: e76b573f11d1c560e3dfcf8e66702a8ed7c0c70d arm64: mte: Add PTRACE_{PEEK,POKE}MTETAGS
support
:::::: TO: Catalin Marinas <catalin.marinas(a)arm.com>
:::::: CC: Catalin Marinas <catalin.marinas(a)arm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org