From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C793A1BDDB; Thu, 15 Aug 2024 03:20:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723692032; cv=none; b=Msv9ZS/OzlN0xX/ZbjI+YRXOulBXOrcn6VCpprce1mvQp7+/D/SD2T+mB+VEwiJHV+Q0UcV5AmgrmNHQ42+otpV6FgQfDk4dKn3ZtoqcX7M5LN4Yo/j9xOWUoXDxYafxTRtNy9AOMfXCYzZnSzeDU0STYKFS9bXJwdlZW2ck1Nk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723692032; c=relaxed/simple; bh=BpPYc4Tihajr/RR/HigJKLrUSFb7msnqHcQi0RKYHXU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=h62ODO+ENSwfaQgIKZlZelhVQqmRUp0NGvWp9rKppyCmJspcTJ+PIYDpvEtAGneouBgg+QCib649vydnaTI0b5RS97FshLR4bKtudBa4S9PEsTXjxu2j3hx7qUGnnfw1oXXMfXWDyN37pno33ieprfKMT7AbBjwh52gbb5EREyI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=nx1z/6z4; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="nx1z/6z4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1723692027; bh=9heJ5lej0lmzgaMPk+qYVLtyn5V38y1FDbls6T33vyU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nx1z/6z45RHAu8+PoDYNG6J4zfHMH/t7JHlIzyjBMY58UDdiAp5GnNgOLaSZwrH77 +qIwqMJS4Yslrv1XBPWnLwDgVhTeg6gzGdeFPcHHL3AOEVRVZzKR4+4E2UsJ/NOkjd cVPTytEN8Bz1Z5Z5/oux2/Z8ibioei0xEPUGwGXhUklhMnvXkJBLcIfeRGoLPjr647 aPIBx5qROon+XOdmmHMDrLabvL1U+v3avgXNASlNtgbtFJhalqFRaTHQVGrB5ec2S4 twYsPLD9YfqJPY56NcdwLyOwPtA4a4gvzyeVUHUpOEkHUCzpAiAqje24tCaZDWSE+j tXznfHA+2Zjfw== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Wkr3X5dtxz4x1H; Thu, 15 Aug 2024 13:20:24 +1000 (AEST) From: Michael Ellerman To: Bjorn Helgaas , Amit Machhiwal , Rob Herring Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, Bjorn Helgaas , Lizhi Hou , Saravana Kannan , Vaibhav Jain , Nicholas Piggin , Vaidyanathan Srinivasan , Kowshik Jois B S , Lukas Wunner , kernel-team@lists.ubuntu.com, Stefan Bader Subject: Re: [PATCH v3] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest In-Reply-To: <20240806200059.GA74866@bhelgaas> References: <20240806200059.GA74866@bhelgaas> Date: Thu, 15 Aug 2024 13:20:23 +1000 Message-ID: <87h6bm1ngo.fsf@mail.lhotse> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Bjorn Helgaas writes: > On Sat, Aug 03, 2024 at 12:03:25AM +0530, Amit Machhiwal wrote: >> With CONFIG_PCI_DYNAMIC_OF_NODES [1], a hot-plug and hot-unplug sequence >> of a PCI device attached to a PCI-bridge causes following kernel Oops on >> a pseries KVM guest: > > What is unique about pseries here? There's nothing specific to > pseries in the patch, so I would expect this to be a generic problem > on any arch. > >> RTAS: event: 2, Type: Hotplug Event (229), Severity: 1 >> Kernel attempted to read user page (10ec00000048) - exploit attempt? (uid: 0) >> BUG: Unable to handle kernel data access on read at 0x10ec00000048 > > Weird address. I would expect NULL or something. Where did this > non-NULL pointer come from? It originally comes from np->data, which is supposed to be an of_changeset. The powerpc code also uses np->data for the struct pci_dn pointer, see pci_add_device_node_info(). I wonder if that's why it's non-NULL? Amit, do we have exact steps to reproduce this? I poked around a bit but couldn't get it to trigger. cheers