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=ham 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 CD523C3F36D for ; Thu, 27 Feb 2020 13:51:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 95CC32084E for ; Thu, 27 Feb 2020 13:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582811475; bh=QIxfv9IqXqjEULyp9k88AQixp8pBPBBWvgWwqIt/4mo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SQF/PTzW0p/iNb51xkOZcNeiXXHZLrg9leHQLLc6HFm9MkSaKxnz8PZPWI4qww+fa vuA2Qop53GJgLAoc6oAz9aLHPSmc7t9fDG/O8bqQ+YIPgmIfNY3lrYcD2yL8U+b9Y6 7swX0C+J94vx5th2TYpvaiCzdzvvZIuSlN1Q9D0o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731354AbgB0NvO (ORCPT ); Thu, 27 Feb 2020 08:51:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:49992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731082AbgB0NvJ (ORCPT ); Thu, 27 Feb 2020 08:51:09 -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 A00E8246AF; Thu, 27 Feb 2020 13:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582811469; bh=QIxfv9IqXqjEULyp9k88AQixp8pBPBBWvgWwqIt/4mo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HQf1pYc2W0P25Uyse8ZuS287tNXmX8sX/TkyyX8k+Bm3K6NFxQ8eA96VS//ngxD+n PPL3bKPGSDRZD6MmktCkiaab+87RxCRTTpQBR6XuVOdwNnPn6m1YfL6z7NlyIlu4BD yZlU/w+/DQQ/MHE/AhTR8UF8I65eCQZmMAJ/rntQ= 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.9 127/165] staging: rtl8188eu: Fix potential security hole Date: Thu, 27 Feb 2020 14:36:41 +0100 Message-Id: <20200227132249.642490750@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132230.840899170@linuxfoundation.org> References: <20200227132230.840899170@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 499c405b2b80bb3a04425ba3541d20305e014d3e upstream. In routine rtw_hostapd_ioctl(), the user-controlled p->length is assumed to be at least the size of struct ieee_param size, but this assumption is never checked. This could result in out-of-bounds read/write on kernel heap in case a p->length less than the size of struct ieee_param is specified by the user. If p->length is allowed to be greater than the size of the struct, then 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: a2c60d42d97c ("staging: r8188eu: Add files for new driver - part 16") Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20200210180235.21691-2-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 @@ -2859,7 +2859,7 @@ static int rtw_hostapd_ioctl(struct net_ goto out; } - if (!p->pointer) { + if (!p->pointer || p->length != sizeof(struct ieee_param)) { ret = -EINVAL; goto out; }