Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17926240ybl; Thu, 2 Jan 2020 14:58:08 -0800 (PST) X-Google-Smtp-Source: APXvYqxp2TLKEd80KNHC4AVN0/GTmS/5oM1y2CTLRec+vT+NDJDeOgqRzPzCtFcoE2BWbbp58ho/ X-Received: by 2002:a9d:7cd0:: with SMTP id r16mr98617603otn.50.1578005888671; Thu, 02 Jan 2020 14:58:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005888; cv=none; d=google.com; s=arc-20160816; b=VSGHpyHu0SuLMmim6rccbcFKiPbuwb3fkJt+5JMKMRpfYA4DYvbohnu1i/5pEgbKX9 S9Skfnr6NIIljGRkzvGfS7Z2MI0QLhOWzn0MaPzM5ihyMHSzI0JWhW1XY0LhcmJ8AqNv e/hbmqZS385JhwRI++/vqarrdBferTtRrjRHaVgYvyTVl6jvGr3N9KC+2xfKYWkZP3Jz XyPFmzcLLYPJ7gzugrbzM/ffQJN4o8h83xgj40ssYL8c17Mf4EhNFohwy0679xm+gktF cLxAMSAhVUSJTjAGt34zHYDASv/PXeeU79IItn9ZQsnehrRN1HAMeCb5gTlTCCcSgI7E H13Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M6mieLGOIvGwEwlbTWI/KHmVADXN3Sc+Y2lzUBtDD6k=; b=yYm0N2HvP+8NHHK3dYZKgDfj4WZsEEjQmL1cWwEO6CAtcd1VYEcHl5hLb3WO8mr0zo +8EHJtkYiHiHEc61cX/AeKXXhmqi9EI6vqExpCaRi42mgoek2H8w/zDd4LhXujYUAexN R0xuG1JfKlEOu6MAVm63HdsUldVwHFUUNc7hmrI1NJyy4yxhoLondRjMnYWf1no2V/35 72WALpC6jAZrHIte9XOlwIxFOXXQaCrMfJMdqMkPiCkFKgLf0DLV8rNRj0Jy+OjXOzRE ci66LN1amFPwRkmCHwo8oQ5NQQQjvGYBrXyaVUvuNycYrhTPcwQuoveQJ1D21lQnfZXs sBIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q8icWJQm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 25si7555320oix.178.2020.01.02.14.57.57; Thu, 02 Jan 2020 14:58:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q8icWJQm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728649AbgABW4v (ORCPT + 99 others); Thu, 2 Jan 2020 17:56:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:60490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbgABWRo (ORCPT ); Thu, 2 Jan 2020 17:17:44 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A8A6422314; Thu, 2 Jan 2020 22:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003464; bh=cB4IX+UJzd1OLwcNmkie+J4gIlrd3T4EWRRZqLEQPyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q8icWJQmSpV9naIY47ALjVsXLTOc9UMKDrWVaJDsj6z4efQgYC7//IpzIwiGkk1fn GxRQKAKdyNFKAU5ikM9WzKC6U3eF/lF8rrClwnxvYwoLLMNWR6K8XOxUeBir7jP8GY KoEqXWAuwrwPPtReR/yCU1BsZ7cz85lMIa9+2tew= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Vetter , syzbot+fb77e97ebf0612ee6914@syzkaller.appspotmail.com, Kees Cook , Alexander Viro , Stephen Rothwell , Andrew Morton , Linus Torvalds Subject: [PATCH 5.4 145/191] drm: limit to INT_MAX in create_blob ioctl Date: Thu, 2 Jan 2020 23:07:07 +0100 Message-Id: <20200102215845.053049824@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Vetter commit 5bf8bec3f4ce044a223c40cbce92590d938f0e9c upstream. The hardened usercpy code is too paranoid ever since commit 6a30afa8c1fb ("uaccess: disallow > INT_MAX copy sizes") Code itself should have been fine as-is. Link: http://lkml.kernel.org/r/20191106164755.31478-1-daniel.vetter@ffwll.ch Signed-off-by: Daniel Vetter Reported-by: syzbot+fb77e97ebf0612ee6914@syzkaller.appspotmail.com Fixes: 6a30afa8c1fb ("uaccess: disallow > INT_MAX copy sizes") Cc: Kees Cook Cc: Alexander Viro Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_property.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/drm_property.c +++ b/drivers/gpu/drm/drm_property.c @@ -561,7 +561,7 @@ drm_property_create_blob(struct drm_devi struct drm_property_blob *blob; int ret; - if (!length || length > ULONG_MAX - sizeof(struct drm_property_blob)) + if (!length || length > INT_MAX - sizeof(struct drm_property_blob)) return ERR_PTR(-EINVAL); blob = kvzalloc(sizeof(struct drm_property_blob)+length, GFP_KERNEL);