Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1161435ybf; Thu, 27 Feb 2020 06:08:38 -0800 (PST) X-Google-Smtp-Source: APXvYqw2MVRMbEOFoAXMwg0McifZz7bRxEOPUTemGl8TCi3XuVU3/7gcTmjWcsxiQ7WL9l/yV9mM X-Received: by 2002:a54:4006:: with SMTP id x6mr3407896oie.145.1582812518539; Thu, 27 Feb 2020 06:08:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582812518; cv=none; d=google.com; s=arc-20160816; b=YlA6AgDSO/eHpqpC9tf1YjWx/xVSfRmZcYwlp1vl0UTIPI/WCb/sMMFe0UZgfJk7HZ GK61SjurkFR7gjwwlTEy0NTT0zCv5dEghon08gbKORUGTn7WYYJN6B80LdvUaM1VhVzE Q06A9QrTFWsykXKpn7knCnGZvrNhB6+UaPhNvNAlu8hs6nFnpoWxVU+Ryv3chx8mZhkt HUEybMBdsaca5fNlKHu2QLsmqLF0P05IlOcXfz5JlUlZi4H0GOt6goiNulm3eQ1FPdCe GWH4e+n/FNUrO6G8/LYvngi/2nf52F8xk7tVD1gHg7nwQkvCKzQHHh6zpAytMK6TxklD EjZQ== 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=rROLW5FcOQIKZmCdeewkZXAOusbCPzXXPrhJ1zcUjDQ=; b=eYBcg9k3fiHiY510D3+6lP7UGgKZHCmLtMN7MeCrfMG2xyN9RHVVun+Mry8vF/lov0 gIhNlbdBKZTeD/oiKmNZE+7oI4/NKGCG/cUhpROGajnqXsErjXAEkDknjVSQ24fH/wuv Eg4MWooGTD2MQrFFtuEB/HqsxRftoYpYnuB8Hiy43KUyOEZdB184s2hxSrv1Z6Bct0Cs nGK8aK/Xq3ck8+LS9OPAMWI8fi4mKmqeuPKaOwBHsVDM1me3YJNwB7pt20Phps88VRuQ KmDvLgp53jup+QcwKx8zKMNtJ69SBmHgkwvOiQNQ8eBjnB/I80wDWJWAlhto2PcsxlJR 7HRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0x9nxOVf; 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 r6si1586354otn.216.2020.02.27.06.08.18; Thu, 27 Feb 2020 06:08:38 -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=0x9nxOVf; 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 S2388216AbgB0OIN (ORCPT + 99 others); Thu, 27 Feb 2020 09:08:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:45938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387937AbgB0OIM (ORCPT ); Thu, 27 Feb 2020 09:08:12 -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 B686821D7E; Thu, 27 Feb 2020 14:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812492; bh=CmkjkhLeHHiNAXym8hLvSfXzXCM12YtwRWTN1awRdlM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0x9nxOVfJ3efzPEHkQ2gLVR2F76hWrewTud3ioEl5A9q77U7T+HZO+wffQnxO/KE0 TpzwuAovyPgFDt9lNTe2E1z+IJE5fZ75AZOLnTVoR95oy930sF4CwaDGoj8lJAeb58 INhl1QaDbsVdfqxBgfsVFkKiAWlboUgZkQBlhksM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pietro Oliva , Larry Finger Subject: [PATCH 5.4 039/135] staging: rtl8188eu: Fix potential overuse of kernel memory Date: Thu, 27 Feb 2020 14:36:19 +0100 Message-Id: <20200227132234.810642676@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132228.710492098@linuxfoundation.org> References: <20200227132228.710492098@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 @@ -2025,7 +2025,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; }