From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D63C7C52D22 for ; Thu, 27 Feb 2020 14:00:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9CDD62073D for ; Thu, 27 Feb 2020 14:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812021; bh=RZ4sZQnU/cHEVTj6PZ7/lt+uTsueIQ45+x1PBUD6DLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fXkUobroyX7dRPI+0jPHQcUsO9xIVBkmFOVannpECSNpLjKPvJ37zWmI2Gr452HsJ YPjfKH/4dFP4E8MaFFSJadnuQV0WFErLCuLK+MJ2qwfdPQuoUGG9zC2WmfgW/xVPwF 5j2ogrkWpQ45SZ58HEBgNi8u2Uu/8Tvizlyv72Is= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732464AbgB0OAU (ORCPT ); Thu, 27 Feb 2020 09:00:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:33630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732713AbgB0OAQ (ORCPT ); Thu, 27 Feb 2020 09:00:16 -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 6C0EC24691; Thu, 27 Feb 2020 14:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812015; bh=RZ4sZQnU/cHEVTj6PZ7/lt+uTsueIQ45+x1PBUD6DLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lq0hH58oW9NZYjylD/2E1/0+Q3s0WqiHp/V48pS9/IW7WFHtbV6HA4yIxMPEPrIzp h7Yr6kYaCJFtJ5lFqzAMNjSfRQHd/zUr4rrrQxnzDIZ4ikuMZr2bYn8+OrF9Hr1Brr InBjsfWjZ3dhQWXhJXEVpV8ssQpTHiid7j12uCgo= 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.14 188/237] staging: rtl8188eu: Fix potential overuse of kernel memory Date: Thu, 27 Feb 2020 14:36:42 +0100 Message-Id: <20200227132310.165912808@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132255.285644406@linuxfoundation.org> References: <20200227132255.285644406@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 @@ -2051,7 +2051,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; }