From: kernel test robot <lkp@intel.com>
To: "Jason A. Donenfeld" <zx2c4@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
zx2c4@kernel.org, Elena Reshetova <elena.reshetova@intel.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Theodore Ts'o <tytso@mit.edu>
Subject: [crng-random:master 2/2] arch/x86/coco/core.c:189:2: error: call to undeclared function 'memzero_explicit'; ISO C99 and later do not support implicit function declarations
Date: Sun, 24 Mar 2024 09:15:17 +0800 [thread overview]
Message-ID: <202403240934.Nf4UUK5L-lkp@intel.com> (raw)
tree: git://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git master
head: 6fba9af4a847c5ee67715bc6f7959e9ab6394275
commit: 6fba9af4a847c5ee67715bc6f7959e9ab6394275 [2/2] x86/coco: Require seeding RNG with RDRAND on CoCo systems
config: x86_64-rhel-8.3-bpf (https://download.01.org/0day-ci/archive/20240324/202403240934.Nf4UUK5L-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240324/202403240934.Nf4UUK5L-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403240934.Nf4UUK5L-lkp@intel.com/
All errors (new ones prefixed by >>):
>> arch/x86/coco/core.c:189:2: error: call to undeclared function 'memzero_explicit'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
189 | memzero_explicit(rng_seed, sizeof(rng_seed));
| ^
1 error generated.
vim +/memzero_explicit +189 arch/x86/coco/core.c
154
155 __init void cc_random_init(void)
156 {
157 /*
158 * The seed is 32 bytes (in units of longs), which is 256 bits, which
159 * is the security level that the RNG is targeting.
160 */
161 unsigned long rng_seed[32 / sizeof(long)];
162 size_t i, longs;
163
164 if (!cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT))
165 return;
166
167 /*
168 * Since the CoCo threat model includes the host, the only reliable
169 * source of entropy that can be neither observed nor manipulated is
170 * RDRAND. Usually, RDRAND failure is considered tolerable, but since
171 * CoCo guests have no other unobservable source of entropy, it's
172 * important to at least ensure the RNG gets some initial random seeds.
173 */
174 for (i = 0; i < ARRAY_SIZE(rng_seed); i += longs) {
175 longs = arch_get_random_longs(&rng_seed[i], ARRAY_SIZE(rng_seed) - i);
176
177 /*
178 * A zero return value means that the guest doesn't have RDRAND
179 * or the CPU is physically broken, and in both cases that
180 * means most crypto inside of the CoCo instance will be
181 * broken, defeating the purpose of CoCo in the first place. So
182 * just panic here because it's absolutely unsafe to continue
183 * executing.
184 */
185 if (longs == 0)
186 panic("RDRAND is defective.");
187 }
188 add_device_randomness(rng_seed, sizeof(rng_seed));
> 189 memzero_explicit(rng_seed, sizeof(rng_seed));
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2024-03-24 1:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-24 1:15 kernel test robot [this message]
2024-03-25 12:57 ` [crng-random:master 2/2] arch/x86/coco/core.c:189:2: error: call to undeclared function 'memzero_explicit'; ISO C99 and later do not support implicit function declarations Kirill A. Shutemov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202403240934.Nf4UUK5L-lkp@intel.com \
--to=lkp@intel.com \
--cc=elena.reshetova@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tytso@mit.edu \
--cc=zx2c4@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox