CC: [email protected] CC: [email protected] TO: Thomas Gleixner <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/fpu-kvm head: dc3cd5721cdb0d3116a2feb84755427d1522477a commit: 62016e4cc41716b33da890ad43145b646f9db51d [86/88] x86/fpu: Extend prctl() with guest permissions :::::: branch date: 9 days ago :::::: commit date: 9 days ago config: x86_64-randconfig-m001-20211019 (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> New smatch warnings: arch/x86/kernel/fpu/xstate.c:1622 __xstate_request_perm() error: uninitialized symbol 'ret'. Old smatch warnings: arch/x86/kernel/fpu/xstate.c:375 os_xrstor_booting() warn: mask and shift to zero vim +/ret +1622 arch/x86/kernel/fpu/xstate.c cdf2ff477461d9 Chang S. Bae 2021-10-01 1582 62016e4cc41716 Thomas Gleixner 2021-10-17 1583 static int __xstate_request_perm(u64 permitted, u64 requested, bool guest) cdf2ff477461d9 Chang S. Bae 2021-10-01 1584 { cdf2ff477461d9 Chang S. Bae 2021-10-01 1585 /* cdf2ff477461d9 Chang S. Bae 2021-10-01 1586 * This deliberately does not exclude !XSAVES as we still might cdf2ff477461d9 Chang S. Bae 2021-10-01 1587 * decide to optionally context switch XCR0 or talk the silicon 1c31bd942ba476 Chang S. Bae 2021-10-06 1588 * vendors into extending XFD for the pre AMX states, especially 1c31bd942ba476 Chang S. Bae 2021-10-06 1589 * AVX512. cdf2ff477461d9 Chang S. Bae 2021-10-01 1590 */ cdf2ff477461d9 Chang S. Bae 2021-10-01 1591 bool compacted = cpu_feature_enabled(X86_FEATURE_XSAVES); cdf2ff477461d9 Chang S. Bae 2021-10-01 1592 struct fpu *fpu = ¤t->group_leader->thread.fpu; 62016e4cc41716 Thomas Gleixner 2021-10-17 1593 struct fpu_state_perm *perm; cdf2ff477461d9 Chang S. Bae 2021-10-01 1594 unsigned int ksize, usize; cdf2ff477461d9 Chang S. Bae 2021-10-01 1595 u64 mask; cdf2ff477461d9 Chang S. Bae 2021-10-01 1596 int ret; cdf2ff477461d9 Chang S. Bae 2021-10-01 1597 cdf2ff477461d9 Chang S. Bae 2021-10-01 1598 /* Check whether fully enabled */ cdf2ff477461d9 Chang S. Bae 2021-10-01 1599 if ((permitted & requested) == requested) cdf2ff477461d9 Chang S. Bae 2021-10-01 1600 return 0; cdf2ff477461d9 Chang S. Bae 2021-10-01 1601 cdf2ff477461d9 Chang S. Bae 2021-10-01 1602 /* Calculate the resulting kernel state size */ cdf2ff477461d9 Chang S. Bae 2021-10-01 1603 mask = permitted | requested; cdf2ff477461d9 Chang S. Bae 2021-10-01 1604 ksize = xstate_calculate_size(mask, compacted); cdf2ff477461d9 Chang S. Bae 2021-10-01 1605 cdf2ff477461d9 Chang S. Bae 2021-10-01 1606 /* Calculate the resulting user state size */ cdf2ff477461d9 Chang S. Bae 2021-10-01 1607 mask &= XFEATURE_MASK_USER_SUPPORTED; cdf2ff477461d9 Chang S. Bae 2021-10-01 1608 usize = xstate_calculate_size(mask, false); cdf2ff477461d9 Chang S. Bae 2021-10-01 1609 62016e4cc41716 Thomas Gleixner 2021-10-17 1610 if (!guest) { cdf2ff477461d9 Chang S. Bae 2021-10-01 1611 ret = validate_sigaltstack(usize); cdf2ff477461d9 Chang S. Bae 2021-10-01 1612 if (ret) cdf2ff477461d9 Chang S. Bae 2021-10-01 1613 return ret; 62016e4cc41716 Thomas Gleixner 2021-10-17 1614 } cdf2ff477461d9 Chang S. Bae 2021-10-01 1615 62016e4cc41716 Thomas Gleixner 2021-10-17 1616 perm = guest ? &fpu->guest_perm : &fpu->perm; cdf2ff477461d9 Chang S. Bae 2021-10-01 1617 /* Pairs with the READ_ONCE() in xstate_get_group_perm() */ 62016e4cc41716 Thomas Gleixner 2021-10-17 1618 WRITE_ONCE(perm->__state_perm, requested); cdf2ff477461d9 Chang S. Bae 2021-10-01 1619 /* Protected by sighand lock */ 62016e4cc41716 Thomas Gleixner 2021-10-17 1620 perm->__state_size = ksize; 62016e4cc41716 Thomas Gleixner 2021-10-17 1621 perm->__user_state_size = usize; cdf2ff477461d9 Chang S. Bae 2021-10-01 @1622 return ret; cdf2ff477461d9 Chang S. Bae 2021-10-01 1623 } cdf2ff477461d9 Chang S. Bae 2021-10-01 1624 :::::: The code at line 1622 was first introduced by commit :::::: cdf2ff477461d9bfdeb7eac39d61ffbe1e323322 x86/arch_prctl: Add controls for dynamic XSTATE components :::::: TO: Chang S. Bae <[email protected]> :::::: CC: Thomas Gleixner <[email protected]> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
