Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1161508ybf; Thu, 27 Feb 2020 06:08:42 -0800 (PST) X-Google-Smtp-Source: APXvYqwaoS9qAK3Rd8ZLWN1S1oO0PuV74AQR1yTayTpXDoeNWB3xsjHo78LC9uFP8tRUu3Vn+0L2 X-Received: by 2002:aca:1a10:: with SMTP id a16mr3481443oia.9.1582812521934; Thu, 27 Feb 2020 06:08:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582812521; cv=none; d=google.com; s=arc-20160816; b=tSWB3TPRMAXfewMek7/J7ZExN/KSHH6+xxwe4n01ZgvwVrnT0OPtnysmMKWadNDE/2 xsTe3d4wg7gU3mIewuuN44tw+P/Qah4aq/+b2OVoL6oZI7CfpiIN7KxhF+yN21XCJhkV e6oKO9RYTPE1sWrxv7ncmImrKdggDGCi4sMtA4oeKerMhPcSjcu6IdpjLTMM98MPk+zo AkIxha30UWarFnidFNyv2R4ZkMoZP8NVgazs/8UJtkDyLAWu4CL0sdtBbc0KD8dkVjb7 EMv7KKmhqfIC2jpxXDECk2IGCzQFQ0n1wABboBtHQ4nFvewI0PCq5FXhl153B2E+pjnu LeTQ== 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=WXmMwn7DuNa4TKooZLD6N1aCQF8iK+oF8R9MQgV4TPg=; b=K/iXu0BW+Mk8po3cAf0Fw3HudnDixilF8zDeDdRjHpQ2VEsDxcWSBcCulxaDPQ67s9 IHvhdSZl9aquZTQgGLzZ1ybIyh7Hnocc5jwqllNNvxyahQHYuotaCAJTWv/qwpAJNbx8 DDt3bGvPlz3mdBFZ4Qo9rYjS96me9e2w5tKm7jQ2hNOvtX9id2l+RLdSk1c7C3TdkKYs JAIQPeRYAr6O/O1cXuBKlgA1LOUsvbIZqv2BdSsCOcieSxW3gAEZ381/csGPGmcTexYi o7f3t0S3MKzoshuseC3BG6qBkZRnsOBXyiswWBB7YZBgy2umRfozoaWhUc6re71xErs3 elVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pQ9Yqxm8; 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 f81si1451214oig.110.2020.02.27.06.08.22; Thu, 27 Feb 2020 06:08:41 -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=pQ9Yqxm8; 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 S2388233AbgB0OIU (ORCPT + 99 others); Thu, 27 Feb 2020 09:08:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:46072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388227AbgB0OIS (ORCPT ); Thu, 27 Feb 2020 09:08:18 -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 6ED1B20801; Thu, 27 Feb 2020 14:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812497; bh=wgwUsXD3MhMy864LF60dbSO9NBJsQUwXPuA+0vferc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pQ9Yqxm8Q0RX9q29+/hIYkIHCw5//DiRbJBLqypogg34pvsdkSsEsq9WtZPfmIN5i xKy5g7TmIJRl0atEF/x+xXej1lYROwBqfx1T5sjRZXlu6Q3wew1SiFd++IpO+ZPRn/ yAu1vpxDXSVmOB6cVJ+IRdeaplXPlLF02vJxBFNY= 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 040/135] staging: rtl8723bs: Fix potential security hole Date: Thu, 27 Feb 2020 14:36:20 +0100 Message-Id: <20200227132234.923912732@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 ac33597c0c0d1d819dccfe001bcd0acef7107e7c 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 554c0a3abf216 ("0taging: Add rtl8723bs sdio wifi driver"). Reported by: Pietro Oliva Cc: Pietro Oliva Cc: Stable Fixes 554c0a3abf216 ("0taging: Add rtl8723bs sdio wifi driver"). Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20200210180235.21691-3-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -4213,7 +4213,7 @@ static int rtw_hostapd_ioctl(struct net_ /* if (p->length < sizeof(struct ieee_param) || !p->pointer) { */ - if (!p->pointer) { + if (!p->pointer || p->length != sizeof(*param)) { ret = -EINVAL; goto out; }