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: <202210221808.ipZTGcTL-lkp@intel.com>
Date:   Sat, 22 Oct 2022 18:20:14 +0800
From:   kernel test robot <lkp@...el.com>
To:     katrinzhou <katrinzhou@...cent.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Eric Dumazet <edumazet@...gle.com>,
        David Ahern <dsahern@...nel.org>,
        Jakub Kicinski <kuba@...nel.org>
Subject: [linux-stable-rc:linux-4.19.y 3257/4191] net/ipv6/sit.c:349: Error:
 unrecognized opcode `csrs sstatus,a4'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
head:   4ec4267bf1664d39d405503898b86aa40e8a9219
commit: 2e837e1d22dbdc4fb7cd2c3fa7d57d913b2ab9e8 [3257/4191] ipv6/sit: fix ipip6_tunnel_get_prl return value
config: riscv-randconfig-c023-20221019
compiler: riscv64-linux-gcc (GCC) 12.1.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
        # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=2e837e1d22dbdc4fb7cd2c3fa7d57d913b2ab9e8
        git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
        git fetch --no-tags linux-stable-rc linux-4.19.y
        git checkout 2e837e1d22dbdc4fb7cd2c3fa7d57d913b2ab9e8
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash net/ipv6/

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

All errors (new ones prefixed by >>):

   net/ipv6/sit.c: Assembler messages:
>> net/ipv6/sit.c:349: Error: unrecognized opcode `csrs sstatus,a4'
>> net/ipv6/sit.c:349: Error: unrecognized opcode `csrc sstatus,a4'
   arch/riscv/include/asm/irqflags.h:42: Error: unrecognized opcode `csrrc a5,sstatus,2'
   arch/riscv/include/asm/irqflags.h:60: Error: unrecognized opcode `csrs sstatus,a5'
   arch/riscv/include/asm/irqflags.h:42: Error: unrecognized opcode `csrrc a5,sstatus,2'
   arch/riscv/include/asm/irqflags.h:60: Error: unrecognized opcode `csrs sstatus,a5'


vim +349 net/ipv6/sit.c

fadf6bf0606913 Templin, Fred L   2008-03-11  295  
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16  296  static int ipip6_tunnel_get_prl(struct ip_tunnel *t,
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16  297  				struct ip_tunnel_prl __user *a)
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  298  {
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16  299  	struct ip_tunnel_prl kprl, *kp;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  300  	struct ip_tunnel_prl_entry *prl;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  301  	unsigned int cmax, c = 0, ca, len;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  302  	int ret = 0;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  303  
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16  304  	if (copy_from_user(&kprl, a, sizeof(kprl)))
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16  305  		return -EFAULT;
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16  306  	cmax = kprl.datalen / sizeof(kprl);
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16  307  	if (cmax > 1 && kprl.addr != htonl(INADDR_ANY))
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  308  		cmax = 1;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  309  
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  310  	/* For simple GET or for root users,
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  311  	 * we try harder to allocate.
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  312  	 */
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  313  	kp = (cmax <= 1 || capable(CAP_NET_ADMIN)) ?
0ccc22f425e56c WANG Cong         2017-06-22  314  		kcalloc(cmax, sizeof(*kp), GFP_KERNEL | __GFP_NOWARN) :
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  315  		NULL;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  316  
c4829dc5ce1ce5 kernel test robot 2021-03-27  317  	ca = min(t->prl_count, cmax);
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  318  
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  319  	if (!kp) {
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  320  		/* We don't try hard to allocate much memory for
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  321  		 * non-root users.
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  322  		 * For root users, retry allocating enough memory for
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  323  		 * the answer.
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  324  		 */
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  325  		kp = kcalloc(ca, sizeof(*kp), GFP_ATOMIC);
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  326  		if (!kp) {
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  327  			ret = -ENOMEM;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  328  			goto out;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  329  		}
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  330  	}
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  331  
2e837e1d22dbdc katrinzhou        2022-06-28  332  	rcu_read_lock();
ef9a9d1183b36f Eric Dumazet      2009-10-23  333  	for_each_prl_rcu(t->prl) {
298bf12ddb2584 Sascha Hlusiak    2009-09-29  334  		if (c >= cmax)
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  335  			break;
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16  336  		if (kprl.addr != htonl(INADDR_ANY) && prl->addr != kprl.addr)
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  337  			continue;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  338  		kp[c].addr = prl->addr;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  339  		kp[c].flags = prl->flags;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  340  		c++;
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16  341  		if (kprl.addr != htonl(INADDR_ANY))
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  342  			break;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  343  	}
2e837e1d22dbdc katrinzhou        2022-06-28  344  
ef9a9d1183b36f Eric Dumazet      2009-10-23  345  	rcu_read_unlock();
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  346  
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  347  	len = sizeof(*kp) * c;
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16  348  	ret = 0;
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16 @349  	if ((len && copy_to_user(a + 1, kp, len)) || put_user(len, &a->datalen))
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16  350  		ret = -EFAULT;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  351  
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  352  	kfree(kp);
2e837e1d22dbdc katrinzhou        2022-06-28  353  out:
2b4743bd6be9fe YOSHIFUJI Hideaki 2008-06-16  354  	return ret;
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  355  }
300aaeeaab5f44 YOSHIFUJI Hideaki 2008-03-24  356  

:::::: The code at line 349 was first introduced by commit
:::::: 2b4743bd6be9fedaa560f8c6dc3997e9ec21b99b ipv6 sit: Avoid extra need for compat layer in PRL management.

:::::: TO: YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
:::::: CC: David S. Miller <davem@...emloft.net>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (128009 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ