Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1082446ybt; Wed, 1 Jul 2020 18:24:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyxqGG1azq8N3RdNVpu/ibqvERQLpsTVvq3s5jdubJgTrbi/rx/L8IYOaSC4MwBvZ76DpD X-Received: by 2002:a50:eb02:: with SMTP id y2mr29650271edp.281.1593653097500; Wed, 01 Jul 2020 18:24:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593653097; cv=none; d=google.com; s=arc-20160816; b=s+6kFvqNs50QDd44+yGRxtgZrSEub4mLbVqx6sRzjLDkNbTn7OTzWB9LIPnbWGK7R+ fKrLFpiUaOwfOoNQ505Y4oYTwi4raYCGFnVjKxv7H5TrFd4JyJLQuhZKZK9KTeCyXb3b QV0ljT8MbW6IwBBxvZJGBw+s6LoEiisgkFv/hEw7k4TSFvej9MniyO0k5zNGWZXGpVJl 03bVmsPaFp7QSqeBGvoMifqr2Ty7qXY1VU9HRQ//MqyDpDTWrahvTvKRQ8n8ef12biff AKvFYc2hJ+xHBl/DnZThjWm5N9WV65vX0Mbv3DYqeF9UGw7iL0NnEY3MqIsi9j1Iswmq 6CzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HVoSXVSrcTbvYl2m3QIFtyrNOxpD4AOp42fYUQ2TGnM=; b=zgBx7dezguU9dmeeQarFqqo1AHy+mp11nSCIxsxpfLrcAU5TO9NAL84Wk95xVHdAdQ nA77uo6OQnP91IsR9ggPXK8/w8vElJn1NihKoJ7jb8QXcwSSnKFw0WDYwP1tYKKKK7rp 72KHqIXU4bys2zlhXOirt5mYVFM48owV33K+zouXm6gtWaIMcjXjaAxvfHNVyuplhcvO KQrc1yQJCEfsp71cmieHqFwmWREZJQWIIp6TLkIdegflQdL2KYGcRzdjglc79OHC+srQ oDBlQYoPnyL0TZStG/2uhfExATWJjlzNRuA1MjAKVwGH0XCfX6pTKnwglmarUPODIaeZ 4Z+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=btQvHiLp; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si5371747edp.574.2020.07.01.18.24.34; Wed, 01 Jul 2020 18:24:57 -0700 (PDT) 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=@kernel.org header.s=default header.b=btQvHiLp; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728508AbgGBBXw (ORCPT + 99 others); Wed, 1 Jul 2020 21:23:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:54342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728420AbgGBBXk (ORCPT ); Wed, 1 Jul 2020 21:23:40 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 390332082F; Thu, 2 Jul 2020 01:23:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593653019; bh=c+QW1mE2tGRPZcQtySA3Jab8B8UJPsk/3gFArtC+8zc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=btQvHiLpFGmzLH9ySps5JeEWsRGhSMg7GRTHTOr6JF7LFmy1xR0Qnp1kt2vCT8/W1 VADRqPOrz0gyIZpRLITTbGWDqgDpbaPWq5FPxiyZfJVHag8UV7Q9JJwZuzi1iTQ01P QTdG5oOPZGi/pn2VAPjIw6zV/VssUsrEn1gXZJbo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christian Borntraeger , Heiko Carstens , Sasha Levin , linux-s390@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 36/53] s390/debug: avoid kernel warning on too large number of pages Date: Wed, 1 Jul 2020 21:21:45 -0400 Message-Id: <20200702012202.2700645-36-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200702012202.2700645-1-sashal@kernel.org> References: <20200702012202.2700645-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christian Borntraeger [ Upstream commit 827c4913923e0b441ba07ba4cc41e01181102303 ] When specifying insanely large debug buffers a kernel warning is printed. The debug code does handle the error gracefully, though. Instead of duplicating the check let us silence the warning to avoid crashes when panic_on_warn is used. Signed-off-by: Christian Borntraeger Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin --- arch/s390/kernel/debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index 6d321f5f101d6..7184d55d87aae 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -198,9 +198,10 @@ static debug_entry_t ***debug_areas_alloc(int pages_per_area, int nr_areas) if (!areas) goto fail_malloc_areas; for (i = 0; i < nr_areas; i++) { + /* GFP_NOWARN to avoid user triggerable WARN, we handle fails */ areas[i] = kmalloc_array(pages_per_area, sizeof(debug_entry_t *), - GFP_KERNEL); + GFP_KERNEL | __GFP_NOWARN); if (!areas[i]) goto fail_malloc_areas2; for (j = 0; j < pages_per_area; j++) { -- 2.25.1