From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17EF9C433EF for ; Sat, 2 Jul 2022 03:47:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 750B56B0074; Fri, 1 Jul 2022 23:47:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 700436B0075; Fri, 1 Jul 2022 23:47:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A04F6B0078; Fri, 1 Jul 2022 23:47:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 45AD96B0074 for ; Fri, 1 Jul 2022 23:47:46 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3025334BC1 for ; Sat, 2 Jul 2022 03:47:45 +0000 (UTC) X-FDA: 79640775690.16.55B9730 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf18.hostedemail.com (Postfix) with ESMTP id 66F7F1C004A for ; Sat, 2 Jul 2022 03:47:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656733662; x=1688269662; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=s7gxfjYQsd6MtZPF4yT+zAgM5+7h7c3Qp07e9V9VfAQ=; b=MCs1/7LEEtDMCRzCSeBjyfEaZ8m8o31YNgBFPRmt8wi+6p+fTxtFC4+/ Nf3qNI/RWORAzawkTknyYTOajQFPNAD8fPPh0Wrez37pBmpvdLzCNbDx4 stvESOxSqDajDpkSAJ17DHW3c3CpquYT/j/4B+zw9su0YQPgAyCi9Mad+ t36XPsgkeOTT+A4se/IWU0ZZ9MiXhbRJx9KZT3AqxdU97GuGmStCBwQ4P 6ejP5/izDYQmhITqbOVTNoknyjVSB4ABqEyH9xHVtcUp/cn40jdkJV/jF tTZD0YHxcKiwUZ7RJuaCpsLf44UPavkiB19CmcyJTKz/19+2iUA4slvsq A==; X-IronPort-AV: E=McAfee;i="6400,9594,10395"; a="280346991" X-IronPort-AV: E=Sophos;i="5.92,239,1650956400"; d="scan'208";a="280346991" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2022 20:47:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,239,1650956400"; d="scan'208";a="541931950" Received: from lkp-server01.sh.intel.com (HELO 68b931ab7ac1) ([10.239.97.150]) by orsmga003.jf.intel.com with ESMTP; 01 Jul 2022 20:47:33 -0700 Received: from kbuild by 68b931ab7ac1 with local (Exim 4.95) (envelope-from ) id 1o7U6W-000Emk-PD; Sat, 02 Jul 2022 03:47:32 +0000 Date: Sat, 2 Jul 2022 11:47:25 +0800 From: kernel test robot To: Alexander Potapenko Cc: kbuild-all@lists.01.org, Alexander Viro , Alexei Starovoitov , Andrew Morton , Linux Memory Management List , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Marco Elver , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner Subject: Re: [PATCH v4 04/45] x86: asm: instrument usercopy in get_user() and __put_user_size() Message-ID: <202207021129.palrTLrL-lkp@intel.com> References: <20220701142310.2188015-5-glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220701142310.2188015-5-glider@google.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656733663; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=iOQy9mdTk60uiP3tnKsA9kdIZXZkNO821/Bolc8BePg=; b=R4BW1MUkcQqhrMDzAMe0CZVYYyuQGnWICfRmAAgDfkyoyFN7wb37dwRgXrr5Sl3VIKAnaV yK8xYwXR6i13niaSeeSQ+mPiFIlxhDpwgzfuKpxzl5pBxFonQ5EPnSdu8YUsB6/e9YY8YN +wJ/OdeiuaAZJLqrgOFA0Ju+1UG+84I= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656733663; a=rsa-sha256; cv=none; b=tw/MpYTjX0VXEpc1XvI1D/Hd8DeosQp9y2MZvXH390tQg02xxo+GPwlw48UlZIH7zoq3Cp rM7vDs6q8mqYZI+2ffgaNAUwLk77f6nmnIaFTSvhpkBHBnJVVDTjmd4/HspyulNmBFJziA zNlb/QvKw/5Ik8lIW0FkBBS2lzAH+8E= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="MCs1/7LE"; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf18.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 192.55.52.93) smtp.mailfrom=lkp@intel.com X-Stat-Signature: i3qdugqwcwkmqazwqn9j1cbn9ebqo1p8 X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="MCs1/7LE"; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf18.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 192.55.52.93) smtp.mailfrom=lkp@intel.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 66F7F1C004A X-HE-Tag: 1656733662-281011 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Alexander, I love your patch! Perhaps something to improve: [auto build test WARNING on masahiroy-kbuild/for-next] [also build test WARNING on linus/master v5.19-rc4 next-20220701] [cannot apply to tip/x86/core tip/x86/mm] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/intel-lab-lkp/linux/commits/Alexander-Potapenko/Add-KernelMemorySanitizer-infrastructure/20220701-222712 base: https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git for-next config: i386-randconfig-s002 (https://download.01.org/0day-ci/archive/20220702/202207021129.palrTLrL-lkp@intel.com/config) compiler: gcc-11 (Debian 11.3.0-3) 11.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://github.com/intel-lab-lkp/linux/commit/0ca0e4029535365a65588446ba55a952ca186079 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Alexander-Potapenko/Add-KernelMemorySanitizer-infrastructure/20220701-222712 git checkout 0ca0e4029535365a65588446ba55a952ca186079 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/kernel/ mm/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long long [usertype] * @@ arch/x86/kernel/signal.c:360:9: sparse: expected void const volatile [noderef] __user *ptr arch/x86/kernel/signal.c:360:9: sparse: got unsigned long long [usertype] * arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression >> arch/x86/kernel/signal.c:360:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got unsigned long long [usertype] * @@ arch/x86/kernel/signal.c:360:9: sparse: expected void [noderef] __user *to arch/x86/kernel/signal.c:360:9: sparse: got unsigned long long [usertype] * arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long long [usertype] * @@ arch/x86/kernel/signal.c:420:9: sparse: expected void const volatile [noderef] __user *ptr arch/x86/kernel/signal.c:420:9: sparse: got unsigned long long [usertype] * arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got unsigned long long [usertype] * @@ arch/x86/kernel/signal.c:420:9: sparse: expected void [noderef] __user *to arch/x86/kernel/signal.c:420:9: sparse: got unsigned long long [usertype] * arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:953:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct lockdep_map const *lock @@ got struct lockdep_map [noderef] __rcu * @@ arch/x86/kernel/signal.c:953:9: sparse: expected struct lockdep_map const *lock arch/x86/kernel/signal.c:953:9: sparse: got struct lockdep_map [noderef] __rcu * vim +360 arch/x86/kernel/signal.c 75779f05264b996 arch/x86/kernel/signal.c Hiroshi Shimamoto 2009-02-27 325 7e907f48980d666 arch/x86/kernel/signal_32.c Ingo Molnar 2008-03-06 326 static int 235b80226b986da arch/x86/kernel/signal.c Al Viro 2012-11-09 327 __setup_frame(int sig, struct ksignal *ksig, sigset_t *set, 7e907f48980d666 arch/x86/kernel/signal_32.c Ingo Molnar 2008-03-06 328 struct pt_regs *regs) ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 329 { ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 330 struct sigframe __user *frame; 7e907f48980d666 arch/x86/kernel/signal_32.c Ingo Molnar 2008-03-06 331 void __user *restorer; b00d8f8f0b2b392 arch/x86/kernel/signal.c Al Viro 2020-02-15 332 void __user *fp = NULL; ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 333 b00d8f8f0b2b392 arch/x86/kernel/signal.c Al Viro 2020-02-15 334 frame = get_sigframe(&ksig->ka, regs, sizeof(*frame), &fp); ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 335 5c1f178094631e8 arch/x86/kernel/signal.c Al Viro 2020-02-15 336 if (!user_access_begin(frame, sizeof(*frame))) 3d0aedd9538e6be arch/x86/kernel/signal_32.c Hiroshi Shimamoto 2008-09-12 337 return -EFAULT; ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 338 5c1f178094631e8 arch/x86/kernel/signal.c Al Viro 2020-02-15 339 unsafe_put_user(sig, &frame->sig, Efault); b00d8f8f0b2b392 arch/x86/kernel/signal.c Al Viro 2020-02-15 340 unsafe_put_sigcontext(&frame->sc, fp, regs, set, Efault); 5c1f178094631e8 arch/x86/kernel/signal.c Al Viro 2020-02-15 341 unsafe_put_user(set->sig[1], &frame->extramask[0], Efault); 1a3e4ca41c5a389 arch/x86/kernel/signal_32.c Roland McGrath 2008-04-09 342 if (current->mm->context.vdso) 6f121e548f83674 arch/x86/kernel/signal.c Andy Lutomirski 2014-05-05 343 restorer = current->mm->context.vdso + 0a6d1fa0d2b48fb arch/x86/kernel/signal.c Andy Lutomirski 2015-10-05 344 vdso_image_32.sym___kernel_sigreturn; 9fbbd4dd17d0712 arch/i386/kernel/signal.c Andi Kleen 2007-02-13 345 else ade1af77129dea6 arch/x86/kernel/signal_32.c Jan Engelhardt 2008-01-30 346 restorer = &frame->retcode; 235b80226b986da arch/x86/kernel/signal.c Al Viro 2012-11-09 347 if (ksig->ka.sa.sa_flags & SA_RESTORER) 235b80226b986da arch/x86/kernel/signal.c Al Viro 2012-11-09 348 restorer = ksig->ka.sa.sa_restorer; ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 349 ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 350 /* Set up to return from userspace. */ 5c1f178094631e8 arch/x86/kernel/signal.c Al Viro 2020-02-15 351 unsafe_put_user(restorer, &frame->pretcode, Efault); ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 352 ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 353 /* 7e907f48980d666 arch/x86/kernel/signal_32.c Ingo Molnar 2008-03-06 354 * This is popl %eax ; movl $__NR_sigreturn, %eax ; int $0x80 ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 355 * ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 356 * WE DO NOT USE IT ANY MORE! It's only left here for historical ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 357 * reasons and because gdb uses it as a signature to notice ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 358 * signal handler stack frames. ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 359 */ 5c1f178094631e8 arch/x86/kernel/signal.c Al Viro 2020-02-15 @360 unsafe_put_user(*((u64 *)&retcode), (u64 *)frame->retcode, Efault); 5c1f178094631e8 arch/x86/kernel/signal.c Al Viro 2020-02-15 361 user_access_end(); ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 362 ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 363 /* Set up registers for signal handler */ 65ea5b034990358 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 364 regs->sp = (unsigned long)frame; 235b80226b986da arch/x86/kernel/signal.c Al Viro 2012-11-09 365 regs->ip = (unsigned long)ksig->ka.sa.sa_handler; 65ea5b034990358 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 366 regs->ax = (unsigned long)sig; 92bc2056855b325 arch/x86/kernel/signal_32.c Harvey Harrison 2008-02-08 367 regs->dx = 0; 92bc2056855b325 arch/x86/kernel/signal_32.c Harvey Harrison 2008-02-08 368 regs->cx = 0; ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 369 65ea5b034990358 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 370 regs->ds = __USER_DS; 65ea5b034990358 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 371 regs->es = __USER_DS; 65ea5b034990358 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 372 regs->ss = __USER_DS; 65ea5b034990358 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 373 regs->cs = __USER_CS; ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 374 283828f3c19ceb3 arch/i386/kernel/signal.c David Howells 2006-01-18 375 return 0; b00d8f8f0b2b392 arch/x86/kernel/signal.c Al Viro 2020-02-15 376 b00d8f8f0b2b392 arch/x86/kernel/signal.c Al Viro 2020-02-15 377 Efault: b00d8f8f0b2b392 arch/x86/kernel/signal.c Al Viro 2020-02-15 378 user_access_end(); b00d8f8f0b2b392 arch/x86/kernel/signal.c Al Viro 2020-02-15 379 return -EFAULT; ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 380 } ^1da177e4c3f415 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 381 -- 0-DAY CI Kernel Test Service https://01.org/lkp