Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp144368pja; Fri, 22 Nov 2019 04:39:02 -0800 (PST) X-Google-Smtp-Source: APXvYqxb9sa3Zlvxh4MriZC+XIguN6/8JhSbZToeZcJL5a7BxZoznLEk5cVNYU+AQwtieHL9UhnZ X-Received: by 2002:a17:907:20b8:: with SMTP id pw24mr21394976ejb.28.1574426342620; Fri, 22 Nov 2019 04:39:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574426342; cv=none; d=google.com; s=arc-20160816; b=MuZYdzk8SV+Y2K2eQ6W7Sp3nTHLQnNmGbC8POcITAtskC/+glIOU9Eif9nRZxmK+FQ XQ3Kh8Hxbx3TJGPuS/gx6DcBVnyhRsSzA2YVbBNPQYlQVol07V2QL0FvZ8Bz0otWsrz2 sh8KtqwFDNLmLO/96XEvr7LI/zHykFFJBx2OGBPTdJzGrqG/MgK3L0746B9Pp0L2H3W0 /Mih7cfS3Qlf4fphe/Iy1i26PjenQiLQf1Z8Di4JbgAZLsrNFduxDXYjGuuFEI9e28A/ QLcV0gFojJnF7TQ7/HbbHsaKor2r5vxhl2KfesF30Gfik8KUecfxpaBdOS1Jz7dGIKMB ZbyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RXHpNXKeSFhWszqKE2zK8QQG9WChzlwgrOViGlZ02zc=; b=QmuVbf7d7+2sQp6dKN/oskJ8G6Jzgnmov92q1/KvY3MiT4SzbO0gAr5oYn0/pzoXzy mQkroAHodr66IzYp0ac2Pi8gZf6iaLLSYwEmPK2AZ0dSbE38s27Sey4lTrfREbDpYmBp vaB19Z91UvvxHxtYYYGV3vOvua7May2F+gNqL7ZAdhr0reDjH02iYi43C5BN2falOssO 1EseScIGLvWDxdxw5V6J0nVk5Aku/JPQthRcOFgS06WpDuX2myY2ILCW/NSQF5tpn7bA n/BGnUghtzoCdu0sdxvYfDztpTNhEBP8HLsLjerhJoq/4p5L0+vA8YG6r/xAFOHjBT0r Gr+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=CwtxpArJ; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si4782983edb.265.2019.11.22.04.38.37; Fri, 22 Nov 2019 04:39:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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=@oracle.com header.s=corp-2019-08-05 header.b=CwtxpArJ; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727317AbfKVMiQ (ORCPT + 99 others); Fri, 22 Nov 2019 07:38:16 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:57720 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726620AbfKVMiP (ORCPT ); Fri, 22 Nov 2019 07:38:15 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xAMCTgsP020019; Fri, 22 Nov 2019 12:37:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2019-08-05; bh=RXHpNXKeSFhWszqKE2zK8QQG9WChzlwgrOViGlZ02zc=; b=CwtxpArJV+n9Fsk69XER5H9LDkFNVK9jh8cH5hb0LbLClW2clxVS/iclGrALrdPnhqdZ gcWnzevPB3QNQKC/cqZEVRWWYr8xOYgte+Tl17DoNg3xru+QKKxQ/Z+Pjhm7JmkvHR0F JD4ZIE0GhzybPnieBs2pROfMEqVFsKGym0w2S5gZPASA6WE9v0xqq2TgE13WwXKVdkMB JZHbFKatpVSNjFaGYGjygVBMJRpg/cItJYiSTXg8KvyHZWY5miwGTOqGezHd8VAQ0mQi 08VaBxMlGK2je9Va6Tltd3vtCcM2tPRFPrzEHyuXD/qxewcN2MqaIF3cvIfbt9obX0qo ww== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2wa8huabcc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Nov 2019 12:37:53 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xAMCT6sB082276; Fri, 22 Nov 2019 12:37:52 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 2we8yftgwt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Nov 2019 12:37:52 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id xAMCboEZ028482; Fri, 22 Nov 2019 12:37:50 GMT Received: from kadam (/41.210.159.99) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 22 Nov 2019 04:37:49 -0800 Date: Fri, 22 Nov 2019 15:37:39 +0300 From: Dan Carpenter To: Ganapathi Bhat Cc: qize wang , "linux-wireless@vger.kernel.org" , amitkarwar , nishants , huxinming820 , kvalo , Greg KH , security , linux-distros , Solar Designer Subject: Re: [EXT] Re: [PATCH] mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame() Message-ID: <20191122123739.GJ617@kadam> References: <20191122111339.GH617@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9448 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1911220112 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9448 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1911220112 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, Nov 22, 2019 at 11:40:40AM +0000, Ganapathi Bhat wrote: > Hi Dan, > > > > + /* copy the ie's value into ht_capb*/ > > > + memcpy((u8 *)&sta_ptr->tdls_cap.ht_capb, pos + 2, > > ^^^^^^^ > > > > I don't understand why we changed "pos" to "pos + 2". Presumably there is > > a reason, but it needs to explained in the commit message. > > I think, we were doing wrong in the original code. We are supposed to use 'pos + 2' itself, instead of just 'pos'. This is because, 'pos' is pointing to 'ieee_types_header', followed by the actual data and the destination do not start with (i.e. it do not contain) 'ieee_types_header'(ex: 'sta_ptr->tdls_cap.ht_oper'). > > Also, there are few places were the destination starts with 'ieee_types_header'(ex: 'sta_ptr->tdls_cap.extcap'), which need just 'pos'. I assumed it was something like this but it needs to be explained in the commit message. regards, dan carpenter