All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.14 01/18] KVM: arm64: Report corrupted refcount at EL2
@ 2021-10-25 16:59 ` Sasha Levin
  0 siblings, 0 replies; 27+ messages in thread
From: Sasha Levin @ 2021-10-25 16:59 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Quentin Perret, Will Deacon, Marc Zyngier, Sasha Levin,
	catalin.marinas, linux-arm-kernel, kvmarm

From: Quentin Perret <qperret@google.com>

[ Upstream commit 7615c2a514788559c6684234b8fc27f3a843c2c6 ]

Some of the refcount manipulation helpers used at EL2 are instrumented
to catch a corrupted state, but not all of them are treated equally. Let's
make things more consistent by instrumenting hyp_page_ref_dec_and_test()
as well.

Acked-by: Will Deacon <will@kernel.org>
Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211005090155.734578-6-qperret@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/kvm/hyp/nvhe/page_alloc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/kvm/hyp/nvhe/page_alloc.c b/arch/arm64/kvm/hyp/nvhe/page_alloc.c
index 41fc25bdfb34..da2d3c0bfb7f 100644
--- a/arch/arm64/kvm/hyp/nvhe/page_alloc.c
+++ b/arch/arm64/kvm/hyp/nvhe/page_alloc.c
@@ -152,6 +152,7 @@ static inline void hyp_page_ref_inc(struct hyp_page *p)
 
 static inline int hyp_page_ref_dec_and_test(struct hyp_page *p)
 {
+	BUG_ON(!p->refcount);
 	p->refcount--;
 	return (p->refcount == 0);
 }
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2021-10-25 18:25 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 16:59 [PATCH AUTOSEL 5.14 01/18] KVM: arm64: Report corrupted refcount at EL2 Sasha Levin
2021-10-25 16:59 ` Sasha Levin
2021-10-25 16:59 ` Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 02/18] ASoC: soc-core: fix null-ptr-deref in snd_soc_del_component_unlocked() Sasha Levin
2021-10-25 16:59   ` Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 03/18] ASoC: cs42l42: Ensure 0dB full scale volume is used for headsets Sasha Levin
2021-10-25 16:59   ` Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 04/18] scsi: core: Put LLD module refcnt after SCSI device is released Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 05/18] ALSA: hda/realtek: Fixes HP Spectre x360 15-eb1xxx speakers Sasha Levin
2021-10-25 16:59   ` Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 06/18] ptp: fix error print of ptp_kvm on X86_64 platform Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 07/18] net: sparx5: Add of_node_put() before goto Sasha Levin
2021-10-25 16:59   ` Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 08/18] net: mscc: ocelot: " Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 09/18] cavium: Return negative value when pci_alloc_irq_vectors() fails Sasha Levin
2021-10-25 16:59   ` Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 10/18] scsi: qla2xxx: Return -ENOMEM if kzalloc() fails Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 11/18] scsi: qla2xxx: Fix unmap of already freed sgl Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 12/18] mISDN: Fix return values of the probe function Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 13/18] cavium: " Sasha Levin
2021-10-25 16:59   ` Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 14/18] vrf: Revert "Reset skb conntrack connection..." Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 15/18] sfc: Export fibre-specific supported link modes Sasha Levin
2021-10-25 18:24   ` Erik Ekman
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 16/18] sfc: Don't use netif_info before net_device setup Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 17/18] usbnet: sanity check for maxpacket Sasha Levin
2021-10-25 16:59 ` [PATCH AUTOSEL 5.14 18/18] hyperv/vmbus: include linux/bitops.h Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.