Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2276644pxv; Sat, 17 Jul 2021 08:54:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzumIr5QfDMvHWczAe88Us3IT1tQHDPCpU7lm2N47eNs7aKziLPaqlfYoO58iIsjkaLlBTF X-Received: by 2002:aa7:db94:: with SMTP id u20mr22754131edt.381.1626537285188; Sat, 17 Jul 2021 08:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626537285; cv=none; d=google.com; s=arc-20160816; b=TmOzx4PNK/O2OpvFTrIuLDFrSRUdQpLhPdUjmxeMiq8YWTX+eCP91qddWXiTC75ykG Ite1+XL/Uf73grrnZ8PVm2MrX1LJNbs9zJkpWFeNaCJqbb46yJoGa6iunpADjYPi2Yv2 U3/Q34Eb/BRz8VWdBLsLcj/js5H17q51nb1f+OeeDtJ7u08ZMgnM5trIHgdNcAM+hBKs hG5LiEI5EfjsPRPw4yGrDQ7qVtr15jXIo6Arr7Hh1eCC9yqdB7LQpVCiTcA1GLiJIBxN WPrWBS9mOJz7riXdL7KjiU37iN+UVa3bGIbq8e2fAijAjErshBMv8LI/81WBi+WSe7Uv OYeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CFTZJb5uXdRQgFXGM+12UBexbr83Z4hXZtxIEIPgjXI=; b=za791B1MX277pC6FNRRV/eotfok7tQANu4Sq6/le/c3+ewrx+la/P9NhURAvGu3U5b rymRwMlqxurC4ofWvS+a/AhH7N49wa+5cM+OM7Jwj6MeoH/XxHtM4ANlJ8TKvZIF2VPr bpl0JZM89VMVe5TSnJLnH3HA9HmF3OUdc5NBbG8jYkXMnf3KMpy82jZU+otV6UkfSzf7 BoAfNc6jSjG+U0zhDowJFZ9qZ7u8HLICh4BRNHHBMI4FEcukDVUKJ5981Ns1zxwBnMkL vmwlActS4xEw+yFOJ77K0CQOlhk0EodFWzjv12JNM8b8vdw9HWByWCdnvFtA3zji7iyA dHCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=hsKpqVOZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kw23si15386068ejc.414.2021.07.17.08.54.22; Sat, 17 Jul 2021 08:54:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@gmx.net header.s=badeba3b8450 header.b=hsKpqVOZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234935AbhGQPzM (ORCPT + 99 others); Sat, 17 Jul 2021 11:55:12 -0400 Received: from mout.gmx.net ([212.227.15.18]:56997 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234454AbhGQPzM (ORCPT ); Sat, 17 Jul 2021 11:55:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1626537126; bh=mZcP3QmI7YItRwoSRYnjV0gfYLGImu6x7tc+Qai8wIQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=hsKpqVOZ3p7sWvpcDkUU01YH+SeIlBaRhzd4uMxBYC/yOl6zyp61HmktWIY/36gGR lMN8wm17G1tB/NYk9x2rpE1wUb1tj6I+DWIiRENBz4JDrj2BsHZT2LBtL04CkcNIuR zWFgliqBtNkW5a8M2sl0s2Y/1vNG3gFOr88vYsIg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([83.52.228.41]) by mail.gmx.net (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MgeoI-1lUJje2GA0-00h3sX; Sat, 17 Jul 2021 17:52:06 +0200 From: Len Baker To: Larry Finger , Florian Schilhabel , Greg Kroah-Hartman Cc: Len Baker , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] staging/rtl8712: Remove all strcpy() uses in favor of strscpy() Date: Sat, 17 Jul 2021 17:51:45 +0200 Message-Id: <20210717155145.15041-1-len.baker@gmx.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:5C1c4EKwqwdWzS1m8cugGHgErNfVnZaBAsgwiLEyAvM7mbWHFh6 3dPzuepBGkRvzS6i/eiEy9tk2c+MCnBxRn757yPDgAmfn3NbFT7qTul3SG2DocmU/96FEoe GsGpaKKgIIO7UDxOv+2O/8x2/9RmZkrEnQYa6NxCRbl1CAqv0zmt4T/HfkyNl1CJQSMCVkn ZS54E7eEKFAJOoUSZqPVg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:00IjXtN2iM8=:8GT4FY/lAjE2z6TxXsschr h7HSls1qOnKtKjqOTnzolJHU+2Flj2+roAGKB6ppp2N21u5YZVLJ/64gxl7CDdAKnQog4c1iD uKbC/V05Zc3yxm6FBcG94TXswtdYY9W0Io71tzSqdLnrtQJqgPjF6jYTNQmRlI7UcgD914Y5q W8uHaVEIphKt1jS2xcQEl8RoJ5lKQXUc9Z72FQ08wYJaff8DhgXt2hr4+XMnz6FKX4Oqh832d u5yr5AEu4f7OJb9vJD1PXr8amodxKt+0k5czt/hRSfl61l+aWuVnYBxg+g3tn6c2NdGbBPBQ+ pCenu4efjCn+CpUrP/ls1HMk7c8SwOZF+Ij8/MKq+H4qJqNsZsu8QAQTmapM/Tri3xvxpiojI PEuSnh8CDAwTe+ysfQoVRYSg+Jm+Gd9/sdwNaCMRUiEBx4f/9UzI/1k6ZFBJgGzXB7rQBWBdk 8bFkqTAimOgZOtu/x/nBqlokyZMzdD2h37jVP1XOC0lH4crqLACIXUyg+H+htAAb4Ejm8ISwm KRufPyjvzRaC+a9/VTfluE2lcBW5mQ6ayDjFZsN7JLOlwD+FwbccEYpi3Dy1KT89DMEj4zg/2 SW12lqlRcjx0/Qs36ZE++qCmxPpAaRMuJFecP5MQWZmYQTplqpzsREeeL+W91bs5DjJEPkqkY p5UZNSOYmsy2tY/K43LhLDPmTfWuOpys45M4SipCCrx9SfpahQ8az1WVfNCJT67/malL8bSG/ utXNRGEFlkDSo6Cb3hbC2M4qWW+ShEnUxWzlP6mjYDtwHG0AvK3zmsHmh0Qo2eMD8p1PRArjX kWGYiQztd3LCTh3lyCvj4H8Qlh3wke+lexIzIwQEuyhB5DCkaQ6sVWWM2WA6DsbgYBJInW4gJ Hk/V06UCvBe7d5lXOq6KZISfXQSBlq+uCuosqqAvLYfE0+rLvd1KA59lCulT1HGxCAK1PFODD gspNP4EmkKfMQzCMopeueZ3N06YD3SiqW03HnblJ5aneZyT0uPnE05MStMQXs1fVXw3o9cdAa nFoVdvEEX9rTVnyMv2T0WNbBCk6suQ077V9WUtSW8v8O7GH7nB2hM8+oBy45Pg82kkp5dAetu 70ecFhQAks8caXhhkq9+/nw+UkAZt7Kmz9V Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy(). Signed-off-by: Len Baker =2D-- drivers/staging/rtl8712/os_intfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/= os_intfs.c index 2214aca09730..9502f6aa5306 100644 =2D-- a/drivers/staging/rtl8712/os_intfs.c +++ b/drivers/staging/rtl8712/os_intfs.c @@ -203,7 +203,7 @@ struct net_device *r8712_init_netdev(void) if (!pnetdev) return NULL; if (dev_alloc_name(pnetdev, ifname) < 0) { - strcpy(ifname, "wlan%d"); + strscpy(ifname, "wlan%d", sizeof(ifname)); dev_alloc_name(pnetdev, ifname); } padapter =3D netdev_priv(pnetdev); =2D- 2.25.1