lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230418104743.842683-3-alexjlzheng@tencent.com>
Date:   Tue, 18 Apr 2023 18:47:45 +0800
From:   alexjlzheng@...il.com
To:     seanjc@...gle.com
Cc:     pbonzini@...hat.com, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
        hpa@...or.com, kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jinliang Zheng <alexjlzheng@...cent.com>
Subject: [PATCH 2/2] KVM: x86: Adjust return value of pic_poll_read()

From: Jinliang Zheng <alexjlzheng@...cent.com>

Returning 0x07 raises ambiguity when no interrupt is in pic_poll_read().
Although it will not cause a functional exception (Bit 7 is 0 means no
interrupt), it will easily make developers mistakenly think that a
spurious interrupt (IRQ 7) has been returned.

Return 0x00 instread of 0x07.

Signed-off-by: Jinliang Zheng <alexjlzheng@...cent.com>
---
 arch/x86/kvm/i8259.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 861872e2641a..57978ad8311c 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -414,7 +414,8 @@ static u32 pic_poll_read(struct kvm_kpic_state *s, u32 addr1)
 		/* Bit 7 is 1, means there's an interrupt */
 		ret |= 0x80;
 	} else {
-		ret = 0x07;
+		/* Bit 7 is 0, means there's no interrupt */
+		ret = 0x00;
 		pic_update_irq(s->pics_state);
 	}
 
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ