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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <201910310006.XmSNHarx%lkp@intel.com>
Date:   Thu, 31 Oct 2019 00:29:04 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Joe Perches <joe@...ches.com>
Cc:     kbuild-all@...ts.01.org, Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        clang-built-linux@...glegroups.com
Subject: Re: [PATCH] compiler*.h: Add '__' prefix and suffix to all
 __attribute__ #defines

Hi Joe,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.4-rc5 next-20191030]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Joe-Perches/compiler-h-Add-__-prefix-and-suffix-to-all-__attribute__-defines/20191030-054036
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 23fdb198ae81f47a574296dab5167c5e136a02ba
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-dirty
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

   include/linux/mm_types.h:673:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:674:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:675:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:676:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:677:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:678:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:679:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:680:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:681:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:682:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:683:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:684:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:685:36: sparse: sparse: cast to restricted vm_fault_t
   include/linux/mm_types.h:686:36: sparse: sparse: cast to restricted vm_fault_t
   kernel/bpf/core.c:79:27: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:79:27: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:79:27: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:79:40: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:88:37: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:88:37: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:88:37: sparse: sparse: cast to restricted gfp_t
   include/linux/slab.h:690:38: sparse: sparse: cast to restricted gfp_t
   include/linux/slab.h:329:13: sparse: sparse: cast to restricted gfp_t
   include/linux/slab.h:329:13: sparse: sparse: cast to restricted gfp_t
   include/linux/slab.h:336:24: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:106:27: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:106:27: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:106:27: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:106:40: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:138:42: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:138:42: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:138:42: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:138:55: sparse: sparse: cast to restricted gfp_t
   include/linux/slab.h:629:47: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:206:49: sparse: sparse: arithmetics on pointers to functions
   kernel/bpf/core.c:219:27: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:219:27: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:219:27: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:219:40: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:320:17: sparse: sparse: cast to restricted __be64
   kernel/bpf/core.c:329:29: sparse: sparse: cast to restricted __be32
   kernel/bpf/core.c:462:37: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:462:37: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:462:37: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:462:37: sparse: sparse: cast to restricted gfp_t
>> kernel/bpf/core.c:1417:45: sparse: sparse: cast to restricted __be16
>> kernel/bpf/core.c:1417:32: sparse: sparse: cast from restricted __be16
   kernel/bpf/core.c:1420:45: sparse: sparse: cast to restricted __be32
>> kernel/bpf/core.c:1420:32: sparse: sparse: cast from restricted __be32
   kernel/bpf/core.c:1423:45: sparse: sparse: cast to restricted __be64
>> kernel/bpf/core.c:1423:32: sparse: sparse: cast from restricted __be64
>> kernel/bpf/core.c:1430:45: sparse: sparse: cast to restricted __le16
>> kernel/bpf/core.c:1430:32: sparse: sparse: cast from restricted __le16
>> kernel/bpf/core.c:1433:45: sparse: sparse: cast to restricted __le32
>> kernel/bpf/core.c:1433:32: sparse: sparse: cast from restricted __le32
>> kernel/bpf/core.c:1436:45: sparse: sparse: cast to restricted __le64
>> kernel/bpf/core.c:1436:32: sparse: sparse: cast from restricted __le64
   kernel/bpf/core.c:1447:43: sparse: sparse: arithmetics on pointers to functions
   kernel/bpf/core.c:1452:48: sparse: sparse: arithmetics on pointers to functions
   kernel/bpf/core.c:1632:77: sparse: sparse: subtraction of functions? Share your drugs
   kernel/bpf/core.c:1858:41: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:1858:41: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:1858:41: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:1858:41: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:1858:52: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:1926:56: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:1926:56: sparse: sparse: cast to restricted gfp_t
   kernel/bpf/core.c:1926:56: sparse: sparse: cast to restricted gfp_t

vim +1417 kernel/bpf/core.c

f5bffecda951b5 Alexei Starovoitov 2014-07-22  1320  
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1321  select_insn:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1322  	goto *jumptable[insn->code];
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1323  
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1324  	/* ALU */
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1325  #define ALU(OPCODE, OP)			\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1326  	ALU64_##OPCODE##_X:		\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1327  		DST = DST OP SRC;	\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1328  		CONT;			\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1329  	ALU_##OPCODE##_X:		\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1330  		DST = (u32) DST OP (u32) SRC;	\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1331  		CONT;			\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1332  	ALU64_##OPCODE##_K:		\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1333  		DST = DST OP IMM;		\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1334  		CONT;			\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1335  	ALU_##OPCODE##_K:		\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1336  		DST = (u32) DST OP (u32) IMM;	\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1337  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1338  
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1339  	ALU(ADD,  +)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1340  	ALU(SUB,  -)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1341  	ALU(AND,  &)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1342  	ALU(OR,   |)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1343  	ALU(LSH, <<)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1344  	ALU(RSH, >>)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1345  	ALU(XOR,  ^)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1346  	ALU(MUL,  *)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1347  #undef ALU
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1348  	ALU_NEG:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1349  		DST = (u32) -DST;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1350  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1351  	ALU64_NEG:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1352  		DST = -DST;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1353  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1354  	ALU_MOV_X:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1355  		DST = (u32) SRC;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1356  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1357  	ALU_MOV_K:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1358  		DST = (u32) IMM;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1359  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1360  	ALU64_MOV_X:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1361  		DST = SRC;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1362  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1363  	ALU64_MOV_K:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1364  		DST = IMM;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1365  		CONT;
02ab695bb37ee9 Alexei Starovoitov 2014-09-04  1366  	LD_IMM_DW:
02ab695bb37ee9 Alexei Starovoitov 2014-09-04  1367  		DST = (u64) (u32) insn[0].imm | ((u64) (u32) insn[1].imm) << 32;
02ab695bb37ee9 Alexei Starovoitov 2014-09-04  1368  		insn++;
02ab695bb37ee9 Alexei Starovoitov 2014-09-04  1369  		CONT;
2dc6b100f928aa Jiong Wang         2018-12-05  1370  	ALU_ARSH_X:
75672dda27bd00 Jiong Wang         2019-06-25  1371  		DST = (u64) (u32) (((s32) DST) >> SRC);
2dc6b100f928aa Jiong Wang         2018-12-05  1372  		CONT;
2dc6b100f928aa Jiong Wang         2018-12-05  1373  	ALU_ARSH_K:
75672dda27bd00 Jiong Wang         2019-06-25  1374  		DST = (u64) (u32) (((s32) DST) >> IMM);
2dc6b100f928aa Jiong Wang         2018-12-05  1375  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1376  	ALU64_ARSH_X:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1377  		(*(s64 *) &DST) >>= SRC;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1378  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1379  	ALU64_ARSH_K:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1380  		(*(s64 *) &DST) >>= IMM;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1381  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1382  	ALU64_MOD_X:
144cd91c4c2bce Daniel Borkmann    2019-01-03  1383  		div64_u64_rem(DST, SRC, &AX);
144cd91c4c2bce Daniel Borkmann    2019-01-03  1384  		DST = AX;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1385  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1386  	ALU_MOD_X:
144cd91c4c2bce Daniel Borkmann    2019-01-03  1387  		AX = (u32) DST;
144cd91c4c2bce Daniel Borkmann    2019-01-03  1388  		DST = do_div(AX, (u32) SRC);
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1389  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1390  	ALU64_MOD_K:
144cd91c4c2bce Daniel Borkmann    2019-01-03  1391  		div64_u64_rem(DST, IMM, &AX);
144cd91c4c2bce Daniel Borkmann    2019-01-03  1392  		DST = AX;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1393  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1394  	ALU_MOD_K:
144cd91c4c2bce Daniel Borkmann    2019-01-03  1395  		AX = (u32) DST;
144cd91c4c2bce Daniel Borkmann    2019-01-03  1396  		DST = do_div(AX, (u32) IMM);
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1397  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1398  	ALU64_DIV_X:
876a7ae65b86d8 Alexei Starovoitov 2015-04-27  1399  		DST = div64_u64(DST, SRC);
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1400  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1401  	ALU_DIV_X:
144cd91c4c2bce Daniel Borkmann    2019-01-03  1402  		AX = (u32) DST;
144cd91c4c2bce Daniel Borkmann    2019-01-03  1403  		do_div(AX, (u32) SRC);
144cd91c4c2bce Daniel Borkmann    2019-01-03  1404  		DST = (u32) AX;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1405  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1406  	ALU64_DIV_K:
876a7ae65b86d8 Alexei Starovoitov 2015-04-27  1407  		DST = div64_u64(DST, IMM);
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1408  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1409  	ALU_DIV_K:
144cd91c4c2bce Daniel Borkmann    2019-01-03  1410  		AX = (u32) DST;
144cd91c4c2bce Daniel Borkmann    2019-01-03  1411  		do_div(AX, (u32) IMM);
144cd91c4c2bce Daniel Borkmann    2019-01-03  1412  		DST = (u32) AX;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1413  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1414  	ALU_END_TO_BE:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1415  		switch (IMM) {
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1416  		case 16:
f5bffecda951b5 Alexei Starovoitov 2014-07-22 @1417  			DST = (__force u16) cpu_to_be16(DST);
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1418  			break;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1419  		case 32:
f5bffecda951b5 Alexei Starovoitov 2014-07-22 @1420  			DST = (__force u32) cpu_to_be32(DST);
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1421  			break;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1422  		case 64:
f5bffecda951b5 Alexei Starovoitov 2014-07-22 @1423  			DST = (__force u64) cpu_to_be64(DST);
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1424  			break;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1425  		}
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1426  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1427  	ALU_END_TO_LE:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1428  		switch (IMM) {
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1429  		case 16:
f5bffecda951b5 Alexei Starovoitov 2014-07-22 @1430  			DST = (__force u16) cpu_to_le16(DST);
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1431  			break;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1432  		case 32:
f5bffecda951b5 Alexei Starovoitov 2014-07-22 @1433  			DST = (__force u32) cpu_to_le32(DST);
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1434  			break;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1435  		case 64:
f5bffecda951b5 Alexei Starovoitov 2014-07-22 @1436  			DST = (__force u64) cpu_to_le64(DST);
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1437  			break;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1438  		}
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1439  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1440  
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1441  	/* CALL */
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1442  	JMP_CALL:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1443  		/* Function call scratches BPF_R1-BPF_R5 registers,
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1444  		 * preserves BPF_R6-BPF_R9, and stores return value
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1445  		 * into BPF_R0.
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1446  		 */
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1447  		BPF_R0 = (__bpf_call_base + insn->imm)(BPF_R1, BPF_R2, BPF_R3,
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1448  						       BPF_R4, BPF_R5);
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1449  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1450  
1ea47e01ad6ea0 Alexei Starovoitov 2017-12-14  1451  	JMP_CALL_ARGS:
1ea47e01ad6ea0 Alexei Starovoitov 2017-12-14  1452  		BPF_R0 = (__bpf_call_base_args + insn->imm)(BPF_R1, BPF_R2,
1ea47e01ad6ea0 Alexei Starovoitov 2017-12-14  1453  							    BPF_R3, BPF_R4,
1ea47e01ad6ea0 Alexei Starovoitov 2017-12-14  1454  							    BPF_R5,
1ea47e01ad6ea0 Alexei Starovoitov 2017-12-14  1455  							    insn + insn->off + 1);
1ea47e01ad6ea0 Alexei Starovoitov 2017-12-14  1456  		CONT;
1ea47e01ad6ea0 Alexei Starovoitov 2017-12-14  1457  
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1458  	JMP_TAIL_CALL: {
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1459  		struct bpf_map *map = (struct bpf_map *) (unsigned long) BPF_R2;
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1460  		struct bpf_array *array = container_of(map, struct bpf_array, map);
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1461  		struct bpf_prog *prog;
90caccdd8cc021 Alexei Starovoitov 2017-10-03  1462  		u32 index = BPF_R3;
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1463  
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1464  		if (unlikely(index >= array->map.max_entries))
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1465  			goto out;
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1466  		if (unlikely(tail_call_cnt > MAX_TAIL_CALL_CNT))
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1467  			goto out;
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1468  
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1469  		tail_call_cnt++;
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1470  
2a36f0b92eb638 Wang Nan           2015-08-06  1471  		prog = READ_ONCE(array->ptrs[index]);
1ca1cc98bf7418 Daniel Borkmann    2016-06-28  1472  		if (!prog)
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1473  			goto out;
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1474  
c4675f935399cb Daniel Borkmann    2015-07-13  1475  		/* ARG1 at this point is guaranteed to point to CTX from
c4675f935399cb Daniel Borkmann    2015-07-13  1476  		 * the verifier side due to the fact that the tail call is
c4675f935399cb Daniel Borkmann    2015-07-13  1477  		 * handeled like a helper, that is, bpf_tail_call_proto,
c4675f935399cb Daniel Borkmann    2015-07-13  1478  		 * where arg1_type is ARG_PTR_TO_CTX.
c4675f935399cb Daniel Borkmann    2015-07-13  1479  		 */
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1480  		insn = prog->insnsi;
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1481  		goto select_insn;
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1482  out:
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1483  		CONT;
04fd61ab36ec06 Alexei Starovoitov 2015-05-19  1484  	}
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1485  	JMP_JA:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1486  		insn += insn->off;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1487  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1488  	JMP_EXIT:
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1489  		return BPF_R0;
503a8865a47752 Jiong Wang         2019-01-26  1490  	/* JMP */
503a8865a47752 Jiong Wang         2019-01-26  1491  #define COND_JMP(SIGN, OPCODE, CMP_OP)				\
503a8865a47752 Jiong Wang         2019-01-26  1492  	JMP_##OPCODE##_X:					\
503a8865a47752 Jiong Wang         2019-01-26  1493  		if ((SIGN##64) DST CMP_OP (SIGN##64) SRC) {	\
503a8865a47752 Jiong Wang         2019-01-26  1494  			insn += insn->off;			\
503a8865a47752 Jiong Wang         2019-01-26  1495  			CONT_JMP;				\
503a8865a47752 Jiong Wang         2019-01-26  1496  		}						\
503a8865a47752 Jiong Wang         2019-01-26  1497  		CONT;						\
503a8865a47752 Jiong Wang         2019-01-26  1498  	JMP32_##OPCODE##_X:					\
503a8865a47752 Jiong Wang         2019-01-26  1499  		if ((SIGN##32) DST CMP_OP (SIGN##32) SRC) {	\
503a8865a47752 Jiong Wang         2019-01-26  1500  			insn += insn->off;			\
503a8865a47752 Jiong Wang         2019-01-26  1501  			CONT_JMP;				\
503a8865a47752 Jiong Wang         2019-01-26  1502  		}						\
503a8865a47752 Jiong Wang         2019-01-26  1503  		CONT;						\
503a8865a47752 Jiong Wang         2019-01-26  1504  	JMP_##OPCODE##_K:					\
503a8865a47752 Jiong Wang         2019-01-26  1505  		if ((SIGN##64) DST CMP_OP (SIGN##64) IMM) {	\
503a8865a47752 Jiong Wang         2019-01-26  1506  			insn += insn->off;			\
503a8865a47752 Jiong Wang         2019-01-26  1507  			CONT_JMP;				\
503a8865a47752 Jiong Wang         2019-01-26  1508  		}						\
503a8865a47752 Jiong Wang         2019-01-26  1509  		CONT;						\
503a8865a47752 Jiong Wang         2019-01-26  1510  	JMP32_##OPCODE##_K:					\
503a8865a47752 Jiong Wang         2019-01-26  1511  		if ((SIGN##32) DST CMP_OP (SIGN##32) IMM) {	\
503a8865a47752 Jiong Wang         2019-01-26  1512  			insn += insn->off;			\
503a8865a47752 Jiong Wang         2019-01-26  1513  			CONT_JMP;				\
503a8865a47752 Jiong Wang         2019-01-26  1514  		}						\
503a8865a47752 Jiong Wang         2019-01-26  1515  		CONT;
503a8865a47752 Jiong Wang         2019-01-26  1516  	COND_JMP(u, JEQ, ==)
503a8865a47752 Jiong Wang         2019-01-26  1517  	COND_JMP(u, JNE, !=)
503a8865a47752 Jiong Wang         2019-01-26  1518  	COND_JMP(u, JGT, >)
503a8865a47752 Jiong Wang         2019-01-26  1519  	COND_JMP(u, JLT, <)
503a8865a47752 Jiong Wang         2019-01-26  1520  	COND_JMP(u, JGE, >=)
503a8865a47752 Jiong Wang         2019-01-26  1521  	COND_JMP(u, JLE, <=)
503a8865a47752 Jiong Wang         2019-01-26  1522  	COND_JMP(u, JSET, &)
503a8865a47752 Jiong Wang         2019-01-26  1523  	COND_JMP(s, JSGT, >)
503a8865a47752 Jiong Wang         2019-01-26  1524  	COND_JMP(s, JSLT, <)
503a8865a47752 Jiong Wang         2019-01-26  1525  	COND_JMP(s, JSGE, >=)
503a8865a47752 Jiong Wang         2019-01-26  1526  	COND_JMP(s, JSLE, <=)
503a8865a47752 Jiong Wang         2019-01-26  1527  #undef COND_JMP
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1528  	/* STX and ST and LDX*/
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1529  #define LDST(SIZEOP, SIZE)						\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1530  	STX_MEM_##SIZEOP:						\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1531  		*(SIZE *)(unsigned long) (DST + insn->off) = SRC;	\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1532  		CONT;							\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1533  	ST_MEM_##SIZEOP:						\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1534  		*(SIZE *)(unsigned long) (DST + insn->off) = IMM;	\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1535  		CONT;							\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1536  	LDX_MEM_##SIZEOP:						\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1537  		DST = *(SIZE *)(unsigned long) (SRC + insn->off);	\
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1538  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1539  
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1540  	LDST(B,   u8)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1541  	LDST(H,  u16)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1542  	LDST(W,  u32)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1543  	LDST(DW, u64)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1544  #undef LDST
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1545  	STX_XADD_W: /* lock xadd *(u32 *)(dst_reg + off16) += src_reg */
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1546  		atomic_add((u32) SRC, (atomic_t *)(unsigned long)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1547  			   (DST + insn->off));
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1548  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1549  	STX_XADD_DW: /* lock xadd *(u64 *)(dst_reg + off16) += src_reg */
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1550  		atomic64_add((u64) SRC, (atomic64_t *)(unsigned long)
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1551  			     (DST + insn->off));
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1552  		CONT;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1553  
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1554  	default_label:
5e581dad4fec0e Daniel Borkmann    2018-01-26  1555  		/* If we ever reach this, we have a bug somewhere. Die hard here
5e581dad4fec0e Daniel Borkmann    2018-01-26  1556  		 * instead of just returning 0; we could be somewhere in a subprog,
5e581dad4fec0e Daniel Borkmann    2018-01-26  1557  		 * so execution could continue otherwise which we do /not/ want.
5e581dad4fec0e Daniel Borkmann    2018-01-26  1558  		 *
5e581dad4fec0e Daniel Borkmann    2018-01-26  1559  		 * Note, verifier whitelists all opcodes in bpf_opcode_in_insntable().
5e581dad4fec0e Daniel Borkmann    2018-01-26  1560  		 */
5e581dad4fec0e Daniel Borkmann    2018-01-26  1561  		pr_warn("BPF interpreter: unknown opcode %02x\n", insn->code);
5e581dad4fec0e Daniel Borkmann    2018-01-26  1562  		BUG_ON(1);
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1563  		return 0;
f5bffecda951b5 Alexei Starovoitov 2014-07-22  1564  }
f696b8f471ec98 Alexei Starovoitov 2017-05-30  1565  

:::::: The code at line 1417 was first introduced by commit
:::::: f5bffecda951b59d0d3cdd616d68952abc52bc40 net: filter: split filter.c into two files

:::::: TO: Alexei Starovoitov <ast@...mgrid.com>
:::::: CC: David S. Miller <davem@...emloft.net>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ