From patchwork Thu May 4 20:51:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98570 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806349qgd; Thu, 4 May 2017 13:52:22 -0700 (PDT) X-Received: by 10.84.128.47 with SMTP id 44mr59345802pla.35.1493931142743; Thu, 04 May 2017 13:52:22 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.22; Thu, 04 May 2017 13:52:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751330AbdEDUwV (ORCPT + 6 others); Thu, 4 May 2017 16:52:21 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:50537 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023AbdEDUwU (ORCPT ); Thu, 4 May 2017 16:52:20 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0LrEdQ-1e4qcg08eS-0138kH; Thu, 04 May 2017 22:52:18 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 03/13] [3.18-stable] staging: vt6655: fix overly large stack usage Date: Thu, 4 May 2017 22:51:59 +0200 Message-Id: <20170504205209.498721-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:qllNs/pvr0veb9W/S9PwvDHdWuPPQqtztWkl7NKYtDxJ9PSRRpu fuqNlHEUO+bV7dQ/gyNDffGfUCVlRH5Re7SX165a089G795cxBU6o4LZe2Pu96JDm0O7+LJ klqvUr8ZC3gN0x4eaEPdPEPrkcB/Kvz9Ai3MySfkYTshTm7yH5qxZexCiaHPeShDZqaKP9p caguysF36WvXfB4zLFq/g== X-UI-Out-Filterresults: notjunk:1; V01:K0:JBg/uK7cO1o=:lFJvQG3ZmxPEfUJ/hGUwaK Jj97NEiix7SGjUcbQrL0AWKMfBwK/dGgjyILn3NmDF8zBdKta51s1keZOm8RQbAuhc8c4fyzO Z3ENkwcpqrcHBMQh9EfE/jRgE2GlFH92VqqBwcwgEbsEu53xLNFDc9L0sU28Xkz+snzkMPuz5 zhMjNjRGDyqors0uIBhnb1osd1AxcPDK3EyFzA+RKLFaHoSRqvJ0nc41UPz9VcTVo2OrK1Kpd ww9UFTZz8DB5wW1s9iKbi3jPHrf+rYyIylqLffBcwTA9ZnB8WCAf1FmFP4Sy9nyHrENqzXc2k ahvCkesq8ign+Sn1hOZ9nNOwbxrSrZUmneMaIj6jO6F2DLY5rp/LEm3ix+huSDZAnmvV0uYfj UtlEbNui2cOCEKQJEs84CJOIeQV7m+Wo1VB75Gyg4c8j7s9KHV+Cdtq5u+1y8aWn/f/Lt1yp8 lshIIqWmSqvIJi8TWm9v7c0MXRlGsa9400QBm6c7ELiypLrjpT6RuDlC+BiCEABNu1zKelYZb wshZiTs1mdn6bVdFT6Dz+8BdLNGB+LkiYNy4g2mkWoWZwyLVI6yO8r1Yo2ZJatjPAwqPqv9VH pMoONN+zQtSac6+V721Z5yd9fuhph2afwi6EOwD5isJDjdLnkJVwfXX8c2DdssKK0cwwxhZ4s aylGHi2MsKaNbz/zwdrERAyLhDGvPJ160jeeCfR0M2jGW3vcyD3hWmTNMri7Aqq1EXTU= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org We get a warning for the large stack usage in some configurations: drivers/staging/vt6655/device_main.c: In function 'device_ioctl': drivers/staging/vt6655/device_main.c:2974:1: warning: the frame size of 1304 bytes is larger than 1024 bytes [-Wframe-larger-than=] This is addressed in linux-3.19 with commit 67013f2c0e58 ("staging: vt6655: mac80211 conversion add main mac80211 functions"), which obsoletes the device_ioctl() function, but as that does not apply to stable kernels, this picks an easier way out by using dynamic allocation. The driver was merged in 2.6.31, and the fix applies to all versions before 3.19. Fixes: 5449c685a4b3 ("Staging: Add pristine upstream vt6655 driver sources") Signed-off-by: Arnd Bergmann --- drivers/staging/vt6655/device_main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.9.0 diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index ea240512cbbb..0670fcb02b4a 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -2818,11 +2818,13 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) pr_debug(" SIOCSIWSENS\n"); rc = -EOPNOTSUPP; break; - case SIOCGIWAPLIST: { - char buffer[IW_MAX_AP * (sizeof(struct sockaddr) + sizeof(struct iw_quality))]; + char *buffer = kzalloc(IW_MAX_AP * (sizeof(struct sockaddr) + + sizeof(struct iw_quality)), GFP_KERNEL); - if (wrq->u.data.pointer) { + if (!buffer) { + rc = -ENOMEM; + } else if (wrq->u.data.pointer) { rc = iwctl_giwaplist(dev, NULL, &(wrq->u.data), buffer); if (rc == 0) { if (copy_to_user(wrq->u.data.pointer, @@ -2832,6 +2834,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) rc = -EFAULT; } } + kfree(buffer); } break; @@ -2878,7 +2881,6 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) pr_debug(" SIOCGIWGENIE\n"); rc = iwctl_giwgenie(dev, NULL, &(wrq->u.data), wrq->u.data.pointer); break; - case SIOCSIWENCODEEXT: { char extra[sizeof(struct iw_encode_ext)+MAX_KEY_LEN+1];