From: kernel test robot <lkp@intel.com>
To: hungkien05 <nguyenhunghnuekt@gmail.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [jcmvbkbc-xtensa:pr/24 1/1] arch/x86/kvm/emulate.c:1741:2: warning: '/*' within block comment
Date: Sat, 20 Dec 2025 22:10:33 +0800 [thread overview]
Message-ID: <202512202203.DAeqyrft-lkp@intel.com> (raw)
tree: https://github.com/jcmvbkbc/linux-xtensa pr/24
head: dcd699a99ce2f40e50263e0ec438e3b57b133598
commit: dcd699a99ce2f40e50263e0ec438e3b57b133598 [1/1] Fix potential vulnerability in cloned code (arch/x86/kvm/emulate.c)
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20251220/202512202203.DAeqyrft-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251220/202512202203.DAeqyrft-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/202512202203.DAeqyrft-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> arch/x86/kvm/emulate.c:1741:2: warning: '/*' within block comment [-Wcomment]
1741 | /*
| ^
arch/x86/kvm/emulate.c:1759:4: error: expected expression
1759 | */
| ^
arch/x86/kvm/emulate.c:1760:2: error: expected expression
1760 | if (seg == VCPU_SREG_SS && selector == 3 &&
| ^
1 warning and 2 errors generated.
vim +1741 arch/x86/kvm/emulate.c
dde7e6d12a9ef9 Avi Kivity 2010-07-29 1733
2356aaeb2f58f4 Paolo Bonzini 2014-05-15 1734 static int load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
2356aaeb2f58f4 Paolo Bonzini 2014-05-15 1735 u16 selector, int seg)
2356aaeb2f58f4 Paolo Bonzini 2014-05-15 1736 {
2356aaeb2f58f4 Paolo Bonzini 2014-05-15 1737 u8 cpl = ctxt->ops->cpl(ctxt);
33ab91103b3415 Paolo Bonzini 2017-01-12 1738
dcd699a99ce2f4 hungkien05 2025-12-17 1739
dcd699a99ce2f4 hungkien05 2025-12-17 1740 /*
33ab91103b3415 Paolo Bonzini 2017-01-12 @1741 /*
33ab91103b3415 Paolo Bonzini 2017-01-12 1742 * None of MOV, POP and LSS can load a NULL selector in CPL=3, but
dcd699a99ce2f4 hungkien05 2025-12-17 1743 * None of MOV, POP and LSS can load a NULL selector in CPL=3, but
dcd699a99ce2f4 hungkien05 2025-12-17 1744 * they can load it at CPL<3 (Intel's manual says only LSS can,
33ab91103b3415 Paolo Bonzini 2017-01-12 1745 * they can load it at CPL<3 (Intel's manual says only LSS can,
33ab91103b3415 Paolo Bonzini 2017-01-12 1746 * but it's wrong).
dcd699a99ce2f4 hungkien05 2025-12-17 1747 * but it's wrong).
dcd699a99ce2f4 hungkien05 2025-12-17 1748 *
33ab91103b3415 Paolo Bonzini 2017-01-12 1749 *
33ab91103b3415 Paolo Bonzini 2017-01-12 1750 * However, the Intel manual says that putting IST=1/DPL=3 in
dcd699a99ce2f4 hungkien05 2025-12-17 1751 * However, the Intel manual says that putting IST=1/DPL=3 in
dcd699a99ce2f4 hungkien05 2025-12-17 1752 * an interrupt gate will result in SS=3 (the AMD manual instead
33ab91103b3415 Paolo Bonzini 2017-01-12 1753 * an interrupt gate will result in SS=3 (the AMD manual instead
33ab91103b3415 Paolo Bonzini 2017-01-12 1754 * says it doesn't), so allow SS=3 in __load_segment_descriptor
dcd699a99ce2f4 hungkien05 2025-12-17 1755 * says it doesn't), so allow SS=3 in __load_segment_descriptor
dcd699a99ce2f4 hungkien05 2025-12-17 1756 * and only forbid it here.
33ab91103b3415 Paolo Bonzini 2017-01-12 1757 * and only forbid it here.
33ab91103b3415 Paolo Bonzini 2017-01-12 1758 */
dcd699a99ce2f4 hungkien05 2025-12-17 1759 */
dcd699a99ce2f4 hungkien05 2025-12-17 1760 if (seg == VCPU_SREG_SS && selector == 3 &&
33ab91103b3415 Paolo Bonzini 2017-01-12 1761 if (seg == VCPU_SREG_SS && selector == 3 &&
33ab91103b3415 Paolo Bonzini 2017-01-12 1762 ctxt->mode == X86EMUL_MODE_PROT64)
dcd699a99ce2f4 hungkien05 2025-12-17 1763 ctxt->mode == X86EMUL_MODE_PROT64)
dcd699a99ce2f4 hungkien05 2025-12-17 1764 return emulate_exception(ctxt, GP_VECTOR, 0, true);
33ab91103b3415 Paolo Bonzini 2017-01-12 1765 return emulate_exception(ctxt, GP_VECTOR, 0, true);
33ab91103b3415 Paolo Bonzini 2017-01-12 1766
dcd699a99ce2f4 hungkien05 2025-12-17 1767
3dc4bc4f6b9265 Nadav Amit 2014-12-25 1768 return __load_segment_descriptor(ctxt, selector, seg, cpl,
3dc4bc4f6b9265 Nadav Amit 2014-12-25 1769 X86_TRANSFER_NONE, NULL);
2356aaeb2f58f4 Paolo Bonzini 2014-05-15 1770 }
2356aaeb2f58f4 Paolo Bonzini 2014-05-15 1771
:::::: The code at line 1741 was first introduced by commit
:::::: 33ab91103b3415e12457e3104f0e4517ce12d0f3 KVM: x86: fix emulation of "MOV SS, null selector"
:::::: TO: Paolo Bonzini <pbonzini@redhat.com>
:::::: CC: Paolo Bonzini <pbonzini@redhat.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-12-20 14:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202512202203.DAeqyrft-lkp@intel.com \
--to=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=nguyenhunghnuekt@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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