Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1184964ybk; Sat, 16 May 2020 03:45:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKciyVFUoPRQwwmOPw/soQOMZ4S2GwoR4z3ZmXJh20j2SauK5uV7Agln/8hBh71V32xagC X-Received: by 2002:aa7:d2d7:: with SMTP id k23mr6261876edr.358.1589625938083; Sat, 16 May 2020 03:45:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589625938; cv=none; d=google.com; s=arc-20160816; b=f/6XXBAOuinAiHJtBBq4JliUk0j6UNPB2uQEavU92NUCCwC2H44+77NzOm7MCE2SKr ELQoJ0JYsLFPS6iyoAwp7IznjXo0nW5btMCLsfqiGksU7z+CBvhVZMaNn29T4WLyEbzU QBEby7l/lGrMEBZH7kAKeyaROE/GrFnFKIZBeOY/K3d8kqiyizTPHQE0pONUadvDPIGw be8fuofBXRCQI6OAa1BzMQ3tdY78Lg2bkbUpsBT70GE8zqsmwXrIg0zCbAJOGkAmPgLX HpxjH/2SVuDGCaBTaF6hxCBk8LMIYfLHm+P3bBZUgYDNcuCIvw/OhQ5GhPwq4KkOfkVH 9MBA== 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 :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to:dkim-signature; bh=HBMtOIlLuh0dSxmXZrr/4mcZt+nHKej+x25g85wOizM=; b=fedV/8lhEU88coBaQJec9nDtURKNnxq/fdY6KFbDNzmgij1EOV+IKPqt2dZ3mdbs+U wbqyfOw8Gm5hYzWT/jDYjSCfXdMqIZSn6eVTRq58xkWuMpyH+AxuZMoyXePdQbP9azTM hP7mUFOFvW6aMziiTEbA6F+s7yIV/B0zk7at1s8DxqpJ5boxTNbqBJnSHXithcKzufT3 nfwQeZtzqsLM2ILqOIVxDHA94nHkn41ZkGLLDrPnG929iJ77YzHm/bIfiy5cfT9OcMfC pIKy2nww4+wkGSvVOLzby0Z3DkzbxPBShrDq3g0srDEKesYqSnskW3DjqbZFmQ26fVeY v52g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MLIXTsyT; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 5si2978815edm.395.2020.05.16.03.45.12; Sat, 16 May 2020 03:45:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MLIXTsyT; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726170AbgEPKpD (ORCPT + 99 others); Sat, 16 May 2020 06:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725853AbgEPKpC (ORCPT ); Sat, 16 May 2020 06:45:02 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5384C061A0C for ; Sat, 16 May 2020 03:45:00 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id h17so6272622wrc.8 for ; Sat, 16 May 2020 03:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=HBMtOIlLuh0dSxmXZrr/4mcZt+nHKej+x25g85wOizM=; b=MLIXTsyT8CTy2m0XpubsDcvvDcuAxwLuCPZ78AeihNMgaBYJWULU1KpF3h1aH1BTSR QGY76Nk+054FW1BPly5bw1WJ8x4wvaDXzjQBqd8WUl0pFvHqkyUc6Qz5qxsqnaaInuOH LRgPew2VFNfh5DYWh3HeiIGKX7UNH+5mtCJOJOOVNxMCOP9tJUiWb8nHvKTv5BIf+G6f sYDukxEycYSWCLWhVSE+oUSouviotwdfJm43wX3FJ5io2h4b30sDlUTAkVGMyFneRKI9 tew2jLvOflj9oTvxDRa73m4AdOMxEwYh5yzyTYoQNJy+jXi0KJ2FrDqwTvQHcQiQgI6P WDMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=HBMtOIlLuh0dSxmXZrr/4mcZt+nHKej+x25g85wOizM=; b=er4XLk+b90dSpAjdEebRixHMZYUjB2umkV9khW8zrCpwyKi90oBz15ByQ7YnxkyiNS ztFnNZZR0deVpDSr4W5Odja8ChvTtAWHwgWo8pBgNRFA1hn2wK1pnsbcZvVvSiTLfruC u/Z2CaXitaJ7NosUq2TBkySdLZRAb9IzzmtyXspwaQbzZ45DVLM+NM1I5lz1FojI7LDv uEk9tp6oANzVQEWfojxog93ihqaWhaNMcaXRgQIFDyXBgYYF/gkS3zfj4TfATPfBIlyZ 7NZBMstjB2y8xLbclM/quCri/FVwM6fhiUZvLuHDnulIgAe0akPTeQ/9lnoKL82TfKpo yDlA== X-Gm-Message-State: AOAM532kpqekhOEmUb6OsGwwhRknQ8kcLmj56qjQxoR+MFtNbkvWkHVo TkWikB0Ez+GABofBYcxAtFnaOxw8 X-Received: by 2002:adf:f783:: with SMTP id q3mr9032517wrp.348.1589625899101; Sat, 16 May 2020 03:44:59 -0700 (PDT) Received: from [192.168.43.18] ([185.69.145.77]) by smtp.gmail.com with ESMTPSA id a24sm7108957wmb.24.2020.05.16.03.44.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 16 May 2020 03:44:58 -0700 (PDT) To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org From: Malcolm Priestley Subject: [PATCH 3/4] staging: vt6656: vnt_usb_send_context remove variable data. Message-ID: <9416e1a8-bd72-ffb1-5366-78361d053907@gmail.com> Date: Sat, 16 May 2020 11:44:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org A limit is also placed in vnt_tx_context of MAX_TOTAL_SIZE_WITH_ALL_HEADERS limiting size. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/device.h | 1 - drivers/staging/vt6656/rxtx.c | 3 --- drivers/staging/vt6656/usbpipe.c | 5 +++++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h index 074b98dfac91..08294b21c4e9 100644 --- a/drivers/staging/vt6656/device.h +++ b/drivers/staging/vt6656/device.h @@ -250,7 +250,6 @@ struct vnt_usb_send_context { u8 pkt_type; u8 need_ack; bool in_use; - unsigned char data[MAX_TOTAL_SIZE_WITH_ALL_HEADERS]; }; /* diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index cf194c95df03..8f9904c8045c 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -73,9 +73,6 @@ static struct vnt_usb_send_context context = priv->tx_context[ii]; if (!context->in_use) { context->in_use = true; - memset(context->data, 0, - MAX_TOTAL_SIZE_WITH_ALL_HEADERS); - context->hdr = NULL; return context; diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index 904645fa0eb0..43f1ef32a9ce 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -463,6 +463,11 @@ int vnt_tx_context(struct vnt_private *priv, return -ENODEV; } + if (context->buf_len > MAX_TOTAL_SIZE_WITH_ALL_HEADERS) { + context->in_use = false; + return -E2BIG; + } + usb_fill_bulk_urb(urb, priv->usb, usb_sndbulkpipe(priv->usb, 3), -- 2.25.1