Re: [PATCH 7/7] Create generated/random_init.h, used by random driver
Hi Sandy, [auto build test ERROR on: char-misc/char-misc-testing] [also build test ERROR on: v4.3 next-20151106] url: https://github.com/0day-ci/linux/commits/Sandy-Harris/A-couple-of-generated-files/20151107-223540 config: mips-allyesconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=mips All errors (new ones prefixed by >>): >> /bin/sh: scripts/gen_random: cannot execute binary file: Exec format error make[2]: *** [include/generated/random_init.h] Error 126 make[2]: Target '__build' not remade because of errors. make[1]: *** [prepare0] Error 2 make[1]: Target 'prepare' not remade because of errors. make: *** [sub-make] Error 2 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
[PATCH 7/7] Create generated/random_init.h, used by random driver
Signed-off-by: Sandy Harris--- Kbuild | 21 + scripts/Makefile | 1 + 2 files changed, 22 insertions(+) diff --git a/Kbuild b/Kbuild index f55cefd..494c665 100644 --- a/Kbuild +++ b/Kbuild @@ -5,6 +5,7 @@ # 2) Generate timeconst.h # 3) Generate asm-offsets.h (may need bounds.h and timeconst.h) # 4) Check for missing system calls +# 5) Generate random_init.h # Default sed regexp - multiline due to syntax constraints define sed-y @@ -98,3 +99,23 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE # Keep these three files during make clean no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file) + +# +# 5) Generate random_init.h + +ifdef CONFIG_RANDOM_INIT +init-file := include/generated/random_init.h +used-file := scripts/gen_random +source-file := $(used-file).c +always += $(init-file) +targets += $(init-file) +$(init-file) : $(used-file) + $(Q) $(used-file) > $(init-file) +ifdef CONFIG_RANDOM_GCM +$(used-file) : $(source-file) + $(CC) $< -DCONFIG_RANDOM_GCM -o $@ +else +$(used-file) : $(source-file) + $(CC) $< -o $@ +endif +endif diff --git a/scripts/Makefile b/scripts/Makefile index 1b26617..3cea546 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -18,6 +18,7 @@ hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable hostprogs-$(CONFIG_ASN1)+= asn1_compiler hostprogs-$(CONFIG_MODULE_SIG) += sign-file hostprogs-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert +hostprogs-$(CONFIG_RANDOM_INIT) += gen_random HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/7] Create generated/random_init.h, used by random driver
Hi Sandy, [auto build test ERROR on: char-misc/char-misc-testing] [also build test ERROR on: v4.3 next-20151106] url: https://github.com/0day-ci/linux/commits/Sandy-Harris/A-couple-of-generated-files/20151107-223540 config: x86_64-allmodconfig (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All error/warnings (new ones prefixed by >>): drivers/char/random_gcm.c:2366:28: sparse: non-ANSI function declaration of function 'mix_const_all' drivers/char/random_gcm.c:2379:21: sparse: non-ANSI function declaration of function 'big_mix' drivers/char/random_gcm.c:2443:21: sparse: non-ANSI function declaration of function 'top_mix' drivers/char/random_gcm.c:2518:26: sparse: non-ANSI function declaration of function 'clear_addmul' drivers/char/random_gcm.c:3208:25: sparse: non-ANSI function declaration of function 'init_random' drivers/char/random_gcm.c:3571:26: sparse: non-ANSI function declaration of function 'counter_any' drivers/char/random_gcm.c:3652:23: sparse: non-ANSI function declaration of function 'load_input' drivers/char/random_gcm.c:3702:27: sparse: non-ANSI function declaration of function 'load_constants' drivers/char/random_gcm.c:477:14: sparse: undefined identifier 'constants' drivers/char/random_gcm.c:478:14: sparse: undefined identifier 'constants' drivers/char/random_gcm.c:496:14: sparse: undefined identifier 'constants' drivers/char/random_gcm.c:497:14: sparse: undefined identifier 'constants' drivers/char/random_gcm.c:514:14: sparse: undefined identifier 'constants' drivers/char/random_gcm.c:515:14: sparse: undefined identifier 'constants' drivers/char/random_gcm.c:530:14: sparse: undefined identifier 'constants' drivers/char/random_gcm.c:531:14: sparse: undefined identifier 'constants' drivers/char/random_gcm.c:3471:25: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3474:25: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3477:25: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3488:25: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3495:25: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3496:25: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3497:25: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3517:9: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3541:9: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3547:17: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3555:24: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3555:58: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3555:51: sparse: cast from unknown type drivers/char/random_gcm.c:3560:17: sparse: undefined identifier 'counter' drivers/char/random_gcm.c:3709:58: sparse: undefined identifier 'ARRAY_WORDS' drivers/char/random_gcm.c:3709:25: sparse: undefined identifier 'constants' drivers/char/random_gcm.c:2371:19: sparse: undefined identifier 'constants' drivers/char/random_gcm.c:2652:38: sparse: undefined identifier 'counter' >> drivers/char/random_gcm.c:477:7: error: 'constants' undeclared here (not in >> a function) .A = constants, ^ drivers/char/random_gcm.c: In function 'mix_first': >> drivers/char/random_gcm.c:2652:31: error: 'counter' undeclared (first use in >> this function) addmul( (u8 *) accum, (u8 *) counter, 16, (u8 *) r->B) ; ^ drivers/char/random_gcm.c:2652:31: note: each undeclared identifier is reported only once for each function it appears in drivers/char/random_gcm.c: In function 'count': drivers/char/random_gcm.c:3471:4: error: 'counter' undeclared (first use in this function) counter[1] += counter[3] ; ^ drivers/char/random_gcm.c: In function 'buffer2counter': drivers/char/random_gcm.c:3541:2: error: 'counter' undeclared (first use in this function) counter[0] ^= jiffies ; ^ drivers/char/random_gcm.c: In function 'load_constants': >> drivers/char/random_gcm.c:3709:27: warning: left-hand operand of comma >> expression has no effect [-Wunused-value] for( i = 0, p = constants, ret = 1 ; ret && (i < ARRAY_WORDS) ; i++, p++ ) { ^ >> drivers/char/random_gcm.c:3709:51: error: 'ARRAY_WORDS' undeclared (first >> use in this function) for( i = 0, p = constants, ret = 1 ; ret && (i < ARRAY_WORDS) ; i++, p++ ) { ^ sparse warnings: (new ones prefixed by >>) drivers/char/random_gcm.c:2366:28: sparse: non-ANSI function declaration of function 'mix_const_all' drivers/char/random_gcm.c:2379:21: sparse: non-ANSI function declaration of function 'big_mix' drivers/char/random_gcm.c:2443:21: sparse: non-ANSI function declaration of
Re: [PATCH 7/7] Create generated/random_init.h, used by random driver
Hi Sandy, [auto build test ERROR on: char-misc/char-misc-testing] [also build test ERROR on: v4.3 next-20151106] url: https://github.com/0day-ci/linux/commits/Sandy-Harris/A-couple-of-generated-files/20151107-223540 config: sh-allyesconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=sh All errors (new ones prefixed by >>): >> scripts/gen_random.c:61:19: fatal error: stdio.h: No such file or directory compilation terminated. make[2]: *** [scripts/gen_random] Error 1 :1229:2: warning: #warning syscall sched_setattr not implemented [-Wcpp] :1232:2: warning: #warning syscall sched_getattr not implemented [-Wcpp] :1235:2: warning: #warning syscall renameat2 not implemented [-Wcpp] :1238:2: warning: #warning syscall seccomp not implemented [-Wcpp] :1241:2: warning: #warning syscall getrandom not implemented [-Wcpp] :1244:2: warning: #warning syscall memfd_create not implemented [-Wcpp] :1247:2: warning: #warning syscall bpf not implemented [-Wcpp] :1250:2: warning: #warning syscall execveat not implemented [-Wcpp] :1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp] :1301:2: warning: #warning syscall membarrier not implemented [-Wcpp] make[2]: Target '__build' not remade because of errors. make[1]: *** [prepare0] Error 2 make[1]: Target 'prepare' not remade because of errors. make: *** [sub-make] Error 2 vim +61 scripts/gen_random.c 06038f35 Sandy Harris 2015-11-07 45 * This is certainly done early enough and the data is random 06038f35 Sandy Harris 2015-11-07 46 * enough, but it is not necessarily secret enough. 06038f35 Sandy Harris 2015-11-07 47 * 06038f35 Sandy Harris 2015-11-07 48 * In some cases -- for example, a firewall machine that compiles 06038f35 Sandy Harris 2015-11-07 49 * its own kernel -- this alone might be enough to ensure secure 06038f35 Sandy Harris 2015-11-07 50 * initialisation, since only an enemy who already has root could 06038f35 Sandy Harris 2015-11-07 51 * discover this data. Of course even in those cases it should not 06038f35 Sandy Harris 2015-11-07 52 * be used alone, only as one layer of a defense in depth. 06038f35 Sandy Harris 2015-11-07 53 * 06038f35 Sandy Harris 2015-11-07 54 * In other cases -- a kernel that is compiled once then used in 06038f35 Sandy Harris 2015-11-07 55 * a Linux distro or installed on many devices -- this is likely 06038f35 Sandy Harris 2015-11-07 56 * of very little value. It complicates an attack somewhat, but 06038f35 Sandy Harris 2015-11-07 57 * it clearly will not stop a serious attacker and may not even 06038f35 Sandy Harris 2015-11-07 58 * slow them down much. 06038f35 Sandy Harris 2015-11-07 59 */ 06038f35 Sandy Harris 2015-11-07 60 06038f35 Sandy Harris 2015-11-07 @61 #include 06038f35 Sandy Harris 2015-11-07 62 #include 06038f35 Sandy Harris 2015-11-07 63 #include 06038f35 Sandy Harris 2015-11-07 64 #include 06038f35 Sandy Harris 2015-11-07 65 #include 06038f35 Sandy Harris 2015-11-07 66 #include 06038f35 Sandy Harris 2015-11-07 67 06038f35 Sandy Harris 2015-11-07 68 /* 06038f35 Sandy Harris 2015-11-07 69 * Configuration information :: The code at line 61 was first introduced by commit :: 06038f35641185897feb14917d89d03fab1710ba Produces generated/random_init.h for random driver :: TO: Sandy Harris:: CC: 0day robot --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data