Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1187828ybf; Thu, 27 Feb 2020 06:31:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxCDVDdP7wReJ9vOcFQEh50s+gsujjWEqSGcNxPF5CjHWUoYf8hxGm0PLW1qU3fj3Vu/bTy X-Received: by 2002:a05:6830:15c2:: with SMTP id j2mr3355055otr.351.1582813909785; Thu, 27 Feb 2020 06:31:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582813909; cv=none; d=google.com; s=arc-20160816; b=lyqCXRS1Pt9ixcrZIhuoayuHLp7LbLCMbFSTK/7YjhcZsqmvMxEMuYChoNIkEzsxP7 zm8JLHK35hgCUUUA4fxDwrBujhnY1P+uCQMDtJRDZuEs5IPk9NeyAndmRNVywHvdM89t 92fk9aaR8Lh/gcy1JuYPbV6gqf+1UFwxX9kKdU1sGNBVXUay1WQM4Vtb2Rgodr+GJoOl p1LLOrzSKSM5oZcvR/+0J27z9OnHQ7X4Hr7Cfr/3t3vcyrFu4uuW10LqKkk4pwjrizUp a/r8vE9XoU/d6NiYxsKL2Eh6etn9H4neoXGI4wD8C+EiWtyvMy5/no7nlrJESP+BB1lC yevg== 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=5SVmYJ1xkikOKH4uBVFgxD18UUwZfe7L5rZbYUAzLiQ=; b=gep5WtG5/ulXAEY/8xzJb7EkhtOIMvzFhDhX1cJD3zzogpb6CZIf8Q+8oAsXQvz/V1 hSG1K+aLBMjQwz0bnUoUEL3U0wyvy4RkxUbgF6K5UfMv1n0KQu4mxtYN2BBvyHrGU/xn Rh3VXUQc0KMq2OdNR5PjGzQF4w4Ua1+hjjrTPTDQ7g9ABG6oL7uHVkOOBDtktwwU3zj0 akpqVG/hGxgYFVfg6125Z5jhBCAEGldZxYksbFA/pwNt/+xa4DbQuM+2UhhR9wgjsg+N 7MBO9wXVMPKb98k5Q8i6w53A1J/oK7v84eaCMO1f57XJsuRqwn1XBNiqCyXWIj52jq0/ PNNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mJabvefV; 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 d3si1294731oia.236.2020.02.27.06.31.37; Thu, 27 Feb 2020 06:31:49 -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=mJabvefV; 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 S2388048AbgB0Obc (ORCPT + 99 others); Thu, 27 Feb 2020 09:31:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:39176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387459AbgB0ODn (ORCPT ); Thu, 27 Feb 2020 09:03:43 -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 183D02469B; Thu, 27 Feb 2020 14:03:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812221; bh=IoWa7QZLuZ0KwOhlazEhElkEOpT1YG2XzFoWSCwIMzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mJabvefVqjIGmPdd5DfD0Oa/tShAE91se9MwsExwcJMOhc2fZPTnct/kOSSwq8dor 6D6OASIryuuLJZfgutoa/Ckf2zcglnkN5a36hh1cAKcWnJXmA4i7IBatnK5oVFgSe/ EoiUtJlYznW4WhKNLWpOILMWerih5BFr8izq7zWA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pietro Oliva , Larry Finger Subject: [PATCH 4.19 32/97] staging: rtl8188eu: Fix potential overuse of kernel memory Date: Thu, 27 Feb 2020 14:36:40 +0100 Message-Id: <20200227132219.849129077@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132214.553656188@linuxfoundation.org> References: <20200227132214.553656188@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: Larry Finger commit 4ddf8ab8d15ddbc52eefb44eb64e38466ce1f70f upstream. In routine wpa_supplicant_ioctl(), the user-controlled p->length is checked to be at least the size of struct ieee_param size, but the code does not detect the case where p->length is greater than the size of the struct, thus a malicious user could be wasting kernel memory. Fixes commit a2c60d42d97c ("Add files for new driver - part 16"). Reported by: Pietro Oliva Cc: Pietro Oliva Cc: Stable Fixes commit a2c60d42d97c ("Add files for new driver - part 16"). Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20200210180235.21691-4-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -2026,7 +2026,7 @@ static int wpa_supplicant_ioctl(struct n struct ieee_param *param; uint ret = 0; - if (p->length < sizeof(struct ieee_param) || !p->pointer) { + if (!p->pointer || p->length != sizeof(struct ieee_param)) { ret = -EINVAL; goto out; }