Hi Bibo,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: ab348dfdf1ec26d67e53449056f417e399807edc
commit: faa35b0fcdefb1e5f2d05b0eeac12be32e69e566 [7137/15906] LoongArch: KVM: Add steal time support in kvm side
config: loongarch-randconfig-001-20241031 (https://download.01.org/0day-ci/archive/20241031/202410311034.Boz3bHHh-lkp@…)
compiler: loongarch64-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241031/202410311034.Boz3bHHh-lkp@…)
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(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410311034.Boz3bHHh-lkp@intel.com/
All errors (new ones prefixed by >>):
arch/loongarch/kvm/exit.c: In function 'kvm_save_notify':
>> arch/loongarch/kvm/exit.c:764:63: error: 'struct sched_info' has no member named 'run_delay'
764 | vcpu->arch.st.last_steal = current->sched_info.run_delay;
| ^
--
arch/loongarch/kvm/vcpu.c: In function 'kvm_update_stolen_time':
>> arch/loongarch/kvm/vcpu.c:68:37: error: 'struct sched_info' has no member named 'run_delay'
68 | steal += current->sched_info.run_delay -
| ^
arch/loongarch/kvm/vcpu.c:70:55: error: 'struct sched_info' has no member named 'run_delay'
70 | vcpu->arch.st.last_steal = current->sched_info.run_delay;
| ^
vim +764 arch/loongarch/kvm/exit.c
754
755 static int kvm_save_notify(struct kvm_vcpu *vcpu)
756 {
757 unsigned long id, data;
758
759 id = vcpu->arch.gprs[LOONGARCH_GPR_A1];
760 data = vcpu->arch.gprs[LOONGARCH_GPR_A2];
761 switch (id) {
762 case KVM_FEATURE_STEAL_TIME:
763 vcpu->arch.st.guest_addr = data;
> 764 vcpu->arch.st.last_steal = current->sched_info.run_delay;
765 kvm_make_request(KVM_REQ_RECORD_STEAL, vcpu);
766 break;
767 default:
768 break;
769 };
770
771 return 0;
772 };
773
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
From: Jeongjun Park <aha310510(a)gmail.com>
mainline inclusion
from mainline-v6.12-rc1
commit 0fa5e94a1811d68fbffa0725efe6d4ca62c03d12
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYRB6
CVE: CVE-2024-49936
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
During the list_for_each_entry_rcu iteration call of xenvif_flush_hash,
kfree_rcu does not exist inside the rcu read critical section, so if
kfree_rcu is called when the rcu grace period ends during the iteration,
UAF occurs when accessing head->next after the entry becomes free.
Therefore, to solve this, you need to change it to list_for_each_entry_safe.
Signed-off-by: Jeongjun Park <aha310510(a)gmail.com>
Link: https://patch.msgid.link/20240822181109.2577354-1-aha310510@gmail.com
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
Conflicts:
drivers/net/xen-netback/hash.c
[
A previous commit f3265971ded9 is not merged, but it is ok to merge this patch.
Because this patch will remove the modification of the previous patch.
]
Signed-off-by: Luo Gengkun <luogengkun2(a)huawei.com>
---
drivers/net/xen-netback/hash.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/xen-netback/hash.c b/drivers/net/xen-netback/hash.c
index 10d580c3dea3..bb7545ab9cd1 100644
--- a/drivers/net/xen-netback/hash.c
+++ b/drivers/net/xen-netback/hash.c
@@ -94,7 +94,7 @@ static u32 xenvif_new_hash(struct xenvif *vif, const u8 *data,
static void xenvif_flush_hash(struct xenvif *vif)
{
- struct xenvif_hash_cache_entry *entry;
+ struct xenvif_hash_cache_entry *entry, *n;
unsigned long flags;
if (xenvif_hash_cache_size == 0)
@@ -102,7 +102,7 @@ static void xenvif_flush_hash(struct xenvif *vif)
spin_lock_irqsave(&vif->hash.cache.lock, flags);
- list_for_each_entry_rcu(entry, &vif->hash.cache.list, link) {
+ list_for_each_entry_safe(entry, n, &vif->hash.cache.list, link) {
list_del_rcu(&entry->link);
vif->hash.cache.count--;
kfree_rcu(entry, rcu);
--
2.34.1