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 53533C433F5 for ; Wed, 25 May 2022 11:19:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D4EDF8D0003; Wed, 25 May 2022 07:18:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D01DE8D0001; Wed, 25 May 2022 07:18:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C168C8D0003; Wed, 25 May 2022 07:18:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B05138D0001 for ; Wed, 25 May 2022 07:18:59 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 843B9120F45 for ; Wed, 25 May 2022 11:18:59 +0000 (UTC) X-FDA: 79504018398.29.F632AF2 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf23.hostedemail.com (Postfix) with ESMTP id C8C1C140002 for ; Wed, 25 May 2022 11:18:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653477537; x=1685013537; h=date:from:to:cc:subject:message-id:mime-version; bh=6+hWs2v9fK34D8Q06hQBJxpKZ0WO2YsiTNhUIqehE10=; b=d4EGNMD2GrkocvUDrIUzZbCTvRlWFdz/OFtzNG6pYxVI860CI2skeXfQ QPPOT6liyzBy36yDtGVXB2yCH4n+2ytngSiVcQKIsnEzdQyT/xytlLHNK 4Nzm2NREEXH43RakpLY65fuucBL5Um5XNjLGsKad5N73ZPQ+BhKeigyJa 2sr1j1tRm0DeAWdRFQcx5p61efAwJko8d7hN1vcGmoYIpOiUy9rkyEXcx 4blydN+HgyplzUptUzVyzRCQtwhRJXyCpkoTyQv3aHezTk3vMT/xomKOx wcjWO7n6lG2CBiQtSx1yrG05hz3lDWFFpTw+EXvXCKpF/ojTXbmtP5Z/F Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="273897181" X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="273897181" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2022 04:18:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="526831631" Received: from lkp-server01.sh.intel.com (HELO db63a1be7222) ([10.239.97.150]) by orsmga003.jf.intel.com with ESMTP; 25 May 2022 04:18:52 -0700 Received: from kbuild by db63a1be7222 with local (Exim 4.95) (envelope-from ) id 1ntp2R-0002yE-9j; Wed, 25 May 2022 11:18:51 +0000 Date: Wed, 25 May 2022 19:17:51 +0800 From: kernel test robot To: Palmer Dabbelt Cc: kbuild-all@lists.01.org, Linux Memory Management List , Arnd Bergmann , Guo Ren Subject: [linux-next:master 10169/14193] kernel/seccomp.c:870:9: sparse: sparse: incorrect type in argument 1 (different address spaces) Message-ID: <202205251928.GLUH4GB8-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: C8C1C140002 X-Stat-Signature: kqjrh1i19qj3kw5p9uf1shwtbydkrhpq Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=d4EGNMD2; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf23.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 192.55.52.115) smtp.mailfrom=lkp@intel.com X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1653477515-387289 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: tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 8cb8311e95e3bb58bd84d6350365f14a718faa6d commit: 4922a3ea0121fb6741bacaa7bd1b678f51f40461 [10169/14193] RISC-V: Move to generic spinlocks config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20220525/202205251928.GLUH4GB8-lkp@intel.com/config) compiler: riscv64-linux-gcc (GCC) 11.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-14-g5a0004b5-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=4922a3ea0121fb6741bacaa7bd1b678f51f40461 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 4922a3ea0121fb6741bacaa7bd1b678f51f40461 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> kernel/seccomp.c:870:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *lock @@ got struct atomic_t [noderef] __rcu * @@ kernel/seccomp.c:870:9: sparse: expected struct atomic_t [usertype] *lock kernel/seccomp.c:870:9: sparse: got struct atomic_t [noderef] __rcu * kernel/seccomp.c:1344:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/seccomp.c:1344:31: sparse: expected struct spinlock [usertype] *lock kernel/seccomp.c:1344:31: sparse: got struct spinlock [noderef] __rcu * kernel/seccomp.c:1356:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/seccomp.c:1356:33: sparse: expected struct spinlock [usertype] *lock kernel/seccomp.c:1356:33: sparse: got struct spinlock [noderef] __rcu * kernel/seccomp.c:1782:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct lockdep_map const *lock @@ got struct lockdep_map [noderef] __rcu * @@ kernel/seccomp.c:1782:9: sparse: expected struct lockdep_map const *lock kernel/seccomp.c:1782:9: sparse: got struct lockdep_map [noderef] __rcu * kernel/seccomp.c:1860:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/seccomp.c:1860:31: sparse: expected struct spinlock [usertype] *lock kernel/seccomp.c:1860:31: sparse: got struct spinlock [noderef] __rcu * kernel/seccomp.c:1878:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/seccomp.c:1878:33: sparse: expected struct spinlock [usertype] *lock kernel/seccomp.c:1878:33: sparse: got struct spinlock [noderef] __rcu * kernel/seccomp.c:2020:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/seccomp.c:2020:28: sparse: expected struct spinlock [usertype] *lock kernel/seccomp.c:2020:28: sparse: got struct spinlock [noderef] __rcu * kernel/seccomp.c:2023:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/seccomp.c:2023:38: sparse: expected struct spinlock [usertype] *lock kernel/seccomp.c:2023:38: sparse: got struct spinlock [noderef] __rcu * kernel/seccomp.c:2029:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/seccomp.c:2029:30: sparse: expected struct spinlock [usertype] *lock kernel/seccomp.c:2029:30: sparse: got struct spinlock [noderef] __rcu * kernel/seccomp.c:487:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *lock @@ got struct atomic_t [noderef] __rcu * @@ kernel/seccomp.c:487:9: sparse: expected struct atomic_t [usertype] *lock kernel/seccomp.c:487:9: sparse: got struct atomic_t [noderef] __rcu * kernel/seccomp.c:584:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *lock @@ got struct atomic_t [noderef] __rcu * @@ kernel/seccomp.c:584:9: sparse: expected struct atomic_t [usertype] *lock kernel/seccomp.c:584:9: sparse: got struct atomic_t [noderef] __rcu * kernel/seccomp.c:445:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *lock @@ got struct atomic_t [noderef] __rcu * @@ kernel/seccomp.c:445:9: sparse: expected struct atomic_t [usertype] *lock kernel/seccomp.c:445:9: sparse: got struct atomic_t [noderef] __rcu * kernel/seccomp.c:431:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *lock @@ got struct atomic_t [noderef] __rcu * @@ kernel/seccomp.c:431:9: sparse: expected struct atomic_t [usertype] *lock kernel/seccomp.c:431:9: sparse: got struct atomic_t [noderef] __rcu * kernel/seccomp.c:445:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *lock @@ got struct atomic_t [noderef] __rcu * @@ kernel/seccomp.c:445:9: sparse: expected struct atomic_t [usertype] *lock kernel/seccomp.c:445:9: sparse: got struct atomic_t [noderef] __rcu * kernel/seccomp.c:431:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *lock @@ got struct atomic_t [noderef] __rcu * @@ kernel/seccomp.c:431:9: sparse: expected struct atomic_t [usertype] *lock kernel/seccomp.c:431:9: sparse: got struct atomic_t [noderef] __rcu * kernel/seccomp.c:445:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *lock @@ got struct atomic_t [noderef] __rcu * @@ kernel/seccomp.c:445:9: sparse: expected struct atomic_t [usertype] *lock kernel/seccomp.c:445:9: sparse: got struct atomic_t [noderef] __rcu * kernel/seccomp.c: note: in included file (through include/linux/ptrace.h, include/linux/audit.h): include/linux/sched/signal.h:731:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ include/linux/sched/signal.h:731:37: sparse: expected struct spinlock [usertype] *lock include/linux/sched/signal.h:731:37: sparse: got struct spinlock [noderef] __rcu * include/linux/sched/signal.h:731:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ include/linux/sched/signal.h:731:37: sparse: expected struct spinlock [usertype] *lock include/linux/sched/signal.h:731:37: sparse: got struct spinlock [noderef] __rcu * -- kernel/fork.c:1094:19: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct [noderef] __rcu *owner @@ got struct task_struct *p @@ kernel/fork.c:1094:19: sparse: expected struct task_struct [noderef] __rcu *owner kernel/fork.c:1094:19: sparse: got struct task_struct *p kernel/fork.c:1304:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct file [noderef] __rcu *_x_ @@ got struct file *new_exe_file @@ kernel/fork.c:1304:24: sparse: expected struct file [noderef] __rcu *_x_ kernel/fork.c:1304:24: sparse: got struct file *new_exe_file kernel/fork.c:1304:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct file *[assigned] old_exe_file @@ got struct file [noderef] __rcu * @@ kernel/fork.c:1304:22: sparse: expected struct file *[assigned] old_exe_file kernel/fork.c:1304:22: sparse: got struct file [noderef] __rcu * kernel/fork.c:1635:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct refcount_struct [usertype] *r @@ got struct refcount_struct [noderef] __rcu * @@ kernel/fork.c:1635:38: sparse: expected struct refcount_struct [usertype] *r kernel/fork.c:1635:38: sparse: got struct refcount_struct [noderef] __rcu * kernel/fork.c:1644:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/fork.c:1644:31: sparse: expected struct spinlock [usertype] *lock kernel/fork.c:1644:31: sparse: got struct spinlock [noderef] __rcu * kernel/fork.c:1645:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const * @@ got struct k_sigaction [noderef] __rcu * @@ kernel/fork.c:1645:9: sparse: expected void const * kernel/fork.c:1645:9: sparse: got struct k_sigaction [noderef] __rcu * kernel/fork.c:1646:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/fork.c:1646:33: sparse: expected struct spinlock [usertype] *lock kernel/fork.c:1646:33: sparse: got struct spinlock [noderef] __rcu * >> kernel/fork.c:1739:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *lock @@ got struct atomic_t [noderef] __rcu * @@ kernel/fork.c:1739:9: sparse: expected struct atomic_t [usertype] *lock kernel/fork.c:1739:9: sparse: got struct atomic_t [noderef] __rcu * kernel/fork.c:2058:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/fork.c:2058:31: sparse: expected struct spinlock [usertype] *lock kernel/fork.c:2058:31: sparse: got struct spinlock [noderef] __rcu * kernel/fork.c:2062:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/fork.c:2062:33: sparse: expected struct spinlock [usertype] *lock kernel/fork.c:2062:33: sparse: got struct spinlock [noderef] __rcu * kernel/fork.c:2379:32: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct [noderef] __rcu *real_parent @@ got struct task_struct * @@ kernel/fork.c:2379:32: sparse: expected struct task_struct [noderef] __rcu *real_parent kernel/fork.c:2379:32: sparse: got struct task_struct * kernel/fork.c:2388:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/fork.c:2388:27: sparse: expected struct spinlock [usertype] *lock kernel/fork.c:2388:27: sparse: got struct spinlock [noderef] __rcu * kernel/fork.c:2433:54: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct list_head *head @@ got struct list_head [noderef] __rcu * @@ kernel/fork.c:2433:54: sparse: expected struct list_head *head kernel/fork.c:2433:54: sparse: got struct list_head [noderef] __rcu * kernel/fork.c:2454:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/fork.c:2454:29: sparse: expected struct spinlock [usertype] *lock kernel/fork.c:2454:29: sparse: got struct spinlock [noderef] __rcu * kernel/fork.c:2475:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/fork.c:2475:29: sparse: expected struct spinlock [usertype] *lock kernel/fork.c:2475:29: sparse: got struct spinlock [noderef] __rcu * kernel/fork.c:2502:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sighand_struct *sighand @@ got struct sighand_struct [noderef] __rcu *sighand @@ kernel/fork.c:2502:28: sparse: expected struct sighand_struct *sighand kernel/fork.c:2502:28: sparse: got struct sighand_struct [noderef] __rcu *sighand kernel/fork.c:2531:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/fork.c:2531:31: sparse: expected struct spinlock [usertype] *lock kernel/fork.c:2531:31: sparse: got struct spinlock [noderef] __rcu * kernel/fork.c:2533:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@ kernel/fork.c:2533:33: sparse: expected struct spinlock [usertype] *lock kernel/fork.c:2533:33: sparse: got struct spinlock [noderef] __rcu * kernel/fork.c:2942:24: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct *[assigned] parent @@ got struct task_struct [noderef] __rcu *real_parent @@ kernel/fork.c:2942:24: sparse: expected struct task_struct *[assigned] parent kernel/fork.c:2942:24: sparse: got struct task_struct [noderef] __rcu *real_parent kernel/fork.c:3023:43: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct refcount_struct const [usertype] *r @@ got struct refcount_struct [noderef] __rcu * @@ kernel/fork.c:3023:43: sparse: expected struct refcount_struct const [usertype] *r kernel/fork.c:3023:43: sparse: got struct refcount_struct [noderef] __rcu * kernel/fork.c:2100:22: sparse: sparse: dereference of noderef expression kernel/fork.c: note: in included file (through include/linux/ftrace.h, include/linux/perf_event.h, include/linux/trace_events.h, ...): include/linux/ptrace.h:217:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct task_struct *new_parent @@ got struct task_struct [noderef] __rcu *parent @@ include/linux/ptrace.h:217:45: sparse: expected struct task_struct *new_parent include/linux/ptrace.h:217:45: sparse: got struct task_struct [noderef] __rcu *parent include/linux/ptrace.h:217:62: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected struct cred const *ptracer_cred @@ got struct cred const [noderef] __rcu *ptracer_cred @@ include/linux/ptrace.h:217:62: sparse: expected struct cred const *ptracer_cred include/linux/ptrace.h:217:62: sparse: got struct cred const [noderef] __rcu *ptracer_cred kernel/fork.c:2431:59: sparse: sparse: dereference of noderef expression kernel/fork.c:2432:59: sparse: sparse: dereference of noderef expression kernel/fork.c:1086:23: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/fork.c:1086:23: sparse: struct task_struct [noderef] __rcu * kernel/fork.c:1086:23: sparse: struct task_struct * vim +870 kernel/seccomp.c 8e01b51a31a1e0 YiFei Zhu 2020-10-11 851 c8bee430dc52cf Kees Cook 2014-06-27 852 /** c8bee430dc52cf Kees Cook 2014-06-27 853 * seccomp_attach_filter: validate and attach filter c8bee430dc52cf Kees Cook 2014-06-27 854 * @flags: flags to change filter behavior c8bee430dc52cf Kees Cook 2014-06-27 855 * @filter: seccomp filter to add to the current process c8bee430dc52cf Kees Cook 2014-06-27 856 * dbd952127d11bb Kees Cook 2014-06-27 857 * Caller must be holding current->sighand->siglock lock. dbd952127d11bb Kees Cook 2014-06-27 858 * 7a0df7fbc14505 Tycho Andersen 2019-03-06 859 * Returns 0 on success, -ve on error, or 7a0df7fbc14505 Tycho Andersen 2019-03-06 860 * - in TSYNC mode: the pid of a thread which was either not in the correct 7a0df7fbc14505 Tycho Andersen 2019-03-06 861 * seccomp mode or did not have an ancestral seccomp filter 7a0df7fbc14505 Tycho Andersen 2019-03-06 862 * - in NEW_LISTENER mode: the fd of the new listener c8bee430dc52cf Kees Cook 2014-06-27 863 */ c8bee430dc52cf Kees Cook 2014-06-27 864 static long seccomp_attach_filter(unsigned int flags, c8bee430dc52cf Kees Cook 2014-06-27 865 struct seccomp_filter *filter) c8bee430dc52cf Kees Cook 2014-06-27 866 { c8bee430dc52cf Kees Cook 2014-06-27 867 unsigned long total_insns; c8bee430dc52cf Kees Cook 2014-06-27 868 struct seccomp_filter *walker; c8bee430dc52cf Kees Cook 2014-06-27 869 69f6a34bdeea4f Guenter Roeck 2014-08-10 @870 assert_spin_locked(¤t->sighand->siglock); dbd952127d11bb Kees Cook 2014-06-27 871 c8bee430dc52cf Kees Cook 2014-06-27 872 /* Validate resulting filter length. */ c8bee430dc52cf Kees Cook 2014-06-27 873 total_insns = filter->prog->len; c8bee430dc52cf Kees Cook 2014-06-27 874 for (walker = current->seccomp.filter; walker; walker = walker->prev) c8bee430dc52cf Kees Cook 2014-06-27 875 total_insns += walker->prog->len + 4; /* 4 instr penalty */ c8bee430dc52cf Kees Cook 2014-06-27 876 if (total_insns > MAX_INSNS_PER_PATH) c8bee430dc52cf Kees Cook 2014-06-27 877 return -ENOMEM; c8bee430dc52cf Kees Cook 2014-06-27 878 c2e1f2e30daa55 Kees Cook 2014-06-05 879 /* If thread sync has been requested, check that it is possible. */ c2e1f2e30daa55 Kees Cook 2014-06-05 880 if (flags & SECCOMP_FILTER_FLAG_TSYNC) { c2e1f2e30daa55 Kees Cook 2014-06-05 881 int ret; c2e1f2e30daa55 Kees Cook 2014-06-05 882 c2e1f2e30daa55 Kees Cook 2014-06-05 883 ret = seccomp_can_sync_threads(); 51891498f2da78 Tycho Andersen 2020-03-04 884 if (ret) { 51891498f2da78 Tycho Andersen 2020-03-04 885 if (flags & SECCOMP_FILTER_FLAG_TSYNC_ESRCH) 51891498f2da78 Tycho Andersen 2020-03-04 886 return -ESRCH; 51891498f2da78 Tycho Andersen 2020-03-04 887 else c2e1f2e30daa55 Kees Cook 2014-06-05 888 return ret; c2e1f2e30daa55 Kees Cook 2014-06-05 889 } 51891498f2da78 Tycho Andersen 2020-03-04 890 } c2e1f2e30daa55 Kees Cook 2014-06-05 891 e66a39977985b1 Tyler Hicks 2017-08-11 892 /* Set log flag, if present. */ e66a39977985b1 Tyler Hicks 2017-08-11 893 if (flags & SECCOMP_FILTER_FLAG_LOG) e66a39977985b1 Tyler Hicks 2017-08-11 894 filter->log = true; e66a39977985b1 Tyler Hicks 2017-08-11 895 c8bee430dc52cf Kees Cook 2014-06-27 896 /* c8bee430dc52cf Kees Cook 2014-06-27 897 * If there is an existing filter, make it the prev and don't drop its c8bee430dc52cf Kees Cook 2014-06-27 898 * task reference. c8bee430dc52cf Kees Cook 2014-06-27 899 */ c8bee430dc52cf Kees Cook 2014-06-27 900 filter->prev = current->seccomp.filter; 8e01b51a31a1e0 YiFei Zhu 2020-10-11 901 seccomp_cache_prepare(filter); c8bee430dc52cf Kees Cook 2014-06-27 902 current->seccomp.filter = filter; c818c03b661cd7 Kees Cook 2020-05-13 903 atomic_inc(¤t->seccomp.filter_count); c8bee430dc52cf Kees Cook 2014-06-27 904 c2e1f2e30daa55 Kees Cook 2014-06-05 905 /* Now that the new filter is in place, synchronize to all threads. */ c2e1f2e30daa55 Kees Cook 2014-06-05 906 if (flags & SECCOMP_FILTER_FLAG_TSYNC) 00a02d0c502a06 Kees Cook 2018-05-03 907 seccomp_sync_threads(flags); c2e1f2e30daa55 Kees Cook 2014-06-05 908 c8bee430dc52cf Kees Cook 2014-06-27 909 return 0; e2cfabdfd07564 Will Drewry 2012-04-12 910 } e2cfabdfd07564 Will Drewry 2012-04-12 911 :::::: The code at line 870 was first introduced by commit :::::: 69f6a34bdeea4fec50bb90619bc9602973119572 seccomp: Replace BUG(!spin_is_locked()) with assert_spin_lock :::::: TO: Guenter Roeck :::::: CC: Kees Cook -- 0-DAY CI Kernel Test Service https://01.org/lkp