Message ID | 20181113055053.78352-16-sashal@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB6BF13BB for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 13 Nov 2018 05:51:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDEFC2A278 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 13 Nov 2018 05:51:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC5862A329; Tue, 13 Nov 2018 05:51:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 480A32A2EA for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 13 Nov 2018 05:51:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A0D2A6B0279; Tue, 13 Nov 2018 00:51:24 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9BCA36B027A; Tue, 13 Nov 2018 00:51:24 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8AD036B027B; Tue, 13 Nov 2018 00:51:24 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by kanga.kvack.org (Postfix) with ESMTP id 4BBAF6B0279 for <linux-mm@kvack.org>; Tue, 13 Nov 2018 00:51:24 -0500 (EST) Received: by mail-pf1-f200.google.com with SMTP id a72-v6so9564959pfj.14 for <linux-mm@kvack.org>; Mon, 12 Nov 2018 21:51:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=T/FexRWnLKADXhFxi2gzLlqktSrjQHqWaORBypfakLg=; b=aYL291bmmQQnjFB48/i/3xNJs5uJb0Et4nWFdynzGXwX1yxQ1iJ+TT7Y2r0hIV3qsh ewffPzA6sOlI+eqSwqJE5PjiT8ku1OfwANbIHTyF6VEyLtwcDNp52TPeaVARVgOK62Yd k0OqAWitD3mKFbWDKDI3X+mphXY16Q7F1aBAEKXa8YJ2/X737FHsOYzzMGQK8spVZbeE MQDLCeHGq6OAfTk4unWCa/zbcs1qGXTsLr8xADeyhaTJWPmF8sDzkgbZ0vVC6832YfGH TZ6aUnHHPh4FPXokwPxD9vMHX92ozoUkCc3VEOCq4vW8JNFlHmcvwwnWMV3dBw+rgVNQ AKaA== X-Gm-Message-State: AGRZ1gLEePdaoONOd+djGus39B8PAKUyVI/YgO00e68VoVrgneuluhRX B0T7dRmOF32piOUoRsj+mUkmFvIuuALyHrySJp3fKDi92g6WDTBE2hNeZuQ11CS3LzQgNJu6xPn le0prVHCaiV6Ep6cvWygGwR9TStJwda/L0E5jmj9duc4m7OQC1KSBwXrJWvRmQuv2OA== X-Received: by 2002:a63:2b01:: with SMTP id r1mr3490638pgr.432.1542088283992; Mon, 12 Nov 2018 21:51:23 -0800 (PST) X-Google-Smtp-Source: AJdET5db/++svXA6y3xRXcraytozxzIx9HdRnkoUxQV1h9fiRk4HmaGtciMfG4rGc+T16hDFPCcs X-Received: by 2002:a63:2b01:: with SMTP id r1mr3490592pgr.432.1542088283211; Mon, 12 Nov 2018 21:51:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542088283; cv=none; d=google.com; s=arc-20160816; b=TUlhgAGIWtelk68dhOwGR95Ka/ARAXuibclo6PLQ1aZkvAyHqvphwkRjzIBUTQP6C4 lln9jAZBzrJou8SvuVcoRm/DbCACXkgaru7uQ8qPWHsCDsgddmfMCIuC40Gt8jvK2zdF AAeZbqYuCCSb+nP8GOoltDe2FMoDEG4y1rShXbiE4m40TYftTqPWQfwlcc3/e+i5vX/K G84Uc9ycY+BXrKvrnCPhrjbBWZhsVpJDicYZtrJALQsCPlIBF+9wmt7fi67Lk8EzehjA 6ILUldrFnRLAj2l0UguK+vSt9zaNiDwA3MWaNyCBT5Ju9mGR6cSe1pm/CiDpia8iOK5+ OGXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T/FexRWnLKADXhFxi2gzLlqktSrjQHqWaORBypfakLg=; b=CW/WwE1g2J+IJ/TYtrjDCzNVJvXV9w0FIHzNQ1o6y3Uux2eAZgB674JGuDpPgRqIrd g1e+6nuMunFB/+lDGmk4AYWaAbQXIeojlMTk/sioL0XCR9Q5utUsaxH3Mze6Zl+yEUyH BjlUs7ER1w42ilH3Q6JIAEL8uJ1GXZbNSp4eIjFDVC6lQbi1FaF+cPMvUE5y/9mTRMTa vtXuas1hgOevaFKdO8Kdrx9s4qKFYw+VcqlKggYxDX+NZBglvw5JpzLgRxCBy2JXOQtV royIYarKIgP4HxJV6ENrfUGh4WxOnwixwFv2OY2EGPK0LXeAysddWTcR+bCeTui12QNo BGag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HvdJ+1aV; spf=pass (google.com: domain of sashal@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=sashal@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id e7si2519519pgv.499.2018.11.12.21.51.23 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Nov 2018 21:51:23 -0800 (PST) Received-SPF: pass (google.com: domain of sashal@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HvdJ+1aV; spf=pass (google.com: domain of sashal@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=sashal@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sasha-vm.mshome.net (unknown [64.114.255.114]) (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 AD7CC2250E; Tue, 13 Nov 2018 05:51:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542088282; bh=7mQEjIV2IFnljtef90NPlS5B4LarDbNuW7HZDt0nVlo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HvdJ+1aV8KYlkDGo8BjZILp8xpzc7dsasGNKaxZgxO5atzzcy0aHEvMJ9xINP0+uy 1xFS3GDEotbQpAGkpZdOy8MoVmYwPPIiQ1u+Nt2RbUG4n+domF6iy7tjQmijMV2p4Y GD0fZ5roKQSDa12pwgmoXXPrxQUCGLAaRL6gSWLo= From: Sasha Levin <sashal@kernel.org> To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dan Carpenter <dan.carpenter@oracle.com>, Stephen Rothwell <sfr@canb.auug.org.au>, Keith Busch <keith.busch@intel.com>, "Michael S. Tsirkin" <mst@redhat.com>, Kees Cook <keescook@chromium.org>, YueHaibing <yuehaibing@huawei.com>, Andrew Morton <akpm@linux-foundation.org>, Linus Torvalds <torvalds@linux-foundation.org>, Sasha Levin <sashal@kernel.org>, linux-mm@kvack.org Subject: [PATCH AUTOSEL 4.18 16/39] mm/gup_benchmark.c: prevent integer overflow in ioctl Date: Tue, 13 Nov 2018 00:50:30 -0500 Message-Id: <20181113055053.78352-16-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181113055053.78352-1-sashal@kernel.org> References: <20181113055053.78352-1-sashal@kernel.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
None
|
expand
|
diff --git a/mm/gup_benchmark.c b/mm/gup_benchmark.c index 7405c9d89d65..7e6f2d2dafb5 100644 --- a/mm/gup_benchmark.c +++ b/mm/gup_benchmark.c @@ -23,6 +23,9 @@ static int __gup_benchmark_ioctl(unsigned int cmd, int nr; struct page **pages; + if (gup->size > ULONG_MAX) + return -EINVAL; + nr_pages = gup->size / PAGE_SIZE; pages = kvcalloc(nr_pages, sizeof(void *), GFP_KERNEL); if (!pages)