Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3729263pxb; Mon, 24 Jan 2022 16:31:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJynNS36TAq3UsuJSpgN4GKSxILkMZMNRz3EBFW1rVXZmFrFxKv4tnddiVIHKk/Qaaz+MH31 X-Received: by 2002:a63:2164:: with SMTP id s36mr13416003pgm.71.1643070715329; Mon, 24 Jan 2022 16:31:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643070715; cv=none; d=google.com; s=arc-20160816; b=b5fVd1SjeiVXCLd53wbltp8kKQ0h09l+5OSNI9iQy2OUeZvzmoOygfpQ3dem9EvRws w1lNekmL8cdrXBW3uEVOfulvJCa2WE04eJS7gO1svHr6fKniaEy9/7rWgTHCcR4mbQt6 6IfFIYUPkVIuAtRVn/Mff+LYuYWbnSCMpeImdcoYy4PSr/ttLjRHe70ACEQk1MVQzGBo syLcc/+4gSCMyYxjT8Uf3Thf3KfkG9fpJm7Wx9KFJBJFAvL5/5Yj2l98OYElhn+4ohbI Dr3tNXQe5+edvtugcyLNrPXd4ovSZ8PtM6WBIHlhad5B2tpYG2qpQBLsp1T44MlBolRq okWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=utQEOP4h6YCCSH4RgSZe2vyleP+xqtbarbBpbTDeBiI=; b=y1RLN/KUTQUdHNl8wnL8uwTHA6XcxPAJI/m1cVizommxoZwvNbXW2WLVU7p1un8moG VIlmCKX1nzf4FXhmmQ8g90oDb+2WH+dDN44Z4AVD3QLwROijlAGinI3TLcXzsIRZvNRh 6+Nr5Iq1JsUMj1FRgC2qtE62XcfQmorn+5+/pL6f+fRSXnEKYGwq8sE98aTz74f0351J EIxibNUbp08X7JG7rNAi0EMM2VXabb2DO43wweR80MhHeABndCBMIBmJUVfQbOdscdn2 +i/Wd6m5TzRHTOgc/oxLid+aK2wT+G5MaF10nBWbq0/X+CUg6ciMjxg1LA2LBAZImeVz S8VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FdWbgKA6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v12si14985305pfu.109.2022.01.24.16.31.42; Mon, 24 Jan 2022 16:31:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FdWbgKA6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S3410258AbiAYA2w (ORCPT + 99 others); Mon, 24 Jan 2022 19:28:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1578585AbiAXWDK (ORCPT ); Mon, 24 Jan 2022 17:03:10 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3B63C036BDD; Mon, 24 Jan 2022 12:41:36 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 40CDD615A0; Mon, 24 Jan 2022 20:41:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 228A5C340E5; Mon, 24 Jan 2022 20:41:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056895; bh=e9qHwmWQeW+I8N/3hk78hKYr7tPj2scOY6Gr/oCbo4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FdWbgKA6PNoQWcYKYBUYP1zREWMCZr/0xS+Rn9cfo4wRsxmpQ52XmKt9r3O/aa2dS w0KxgDuuS80QrjpajX5+l16OaJZQRIn3LjC51kcgj+jdCUYh4XKwWPhJAj9NXEgSvq fTTk3kAGIOTtTH/T6OfniVWsprHApqU50PD9jj/Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Kardashevskiy , Fabiano Rosas , Michael Ellerman , Sasha Levin Subject: [PATCH 5.15 635/846] KVM: PPC: Book3S: Suppress failed alloc warning in H_COPY_TOFROM_GUEST Date: Mon, 24 Jan 2022 19:42:32 +0100 Message-Id: <20220124184122.929031010@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexey Kardashevskiy [ Upstream commit 792020907b11c6f9246c21977cab3bad985ae4b6 ] H_COPY_TOFROM_GUEST is an hcall for an upper level VM to access its nested VMs memory. The userspace can trigger WARN_ON_ONCE(!(gfp & __GFP_NOWARN)) in __alloc_pages() by constructing a tiny VM which only does H_COPY_TOFROM_GUEST with a too big GPR9 (number of bytes to copy). This silences the warning by adding __GFP_NOWARN. Spotted by syzkaller. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210901084550.1658699-1-aik@ozlabs.ru Signed-off-by: Sasha Levin --- arch/powerpc/kvm/book3s_hv_nested.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_hv_nested.c b/arch/powerpc/kvm/book3s_hv_nested.c index ed8a2c9f56299..89295b52a97c3 100644 --- a/arch/powerpc/kvm/book3s_hv_nested.c +++ b/arch/powerpc/kvm/book3s_hv_nested.c @@ -582,7 +582,7 @@ long kvmhv_copy_tofrom_guest_nested(struct kvm_vcpu *vcpu) if (eaddr & (0xFFFUL << 52)) return H_PARAMETER; - buf = kzalloc(n, GFP_KERNEL); + buf = kzalloc(n, GFP_KERNEL | __GFP_NOWARN); if (!buf) return H_NO_MEM; -- 2.34.1