Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2731840rwd; Wed, 14 Jun 2023 06:47:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7uNwr8UwnbrAkhkXN9vEmKFO712eTqjMWg7PGIp1LgGzJKUfMB8tAfHUk0khZ/k8AiXSrR X-Received: by 2002:a17:902:e54a:b0:1b2:6387:a30d with SMTP id n10-20020a170902e54a00b001b26387a30dmr13681361plf.35.1686750464697; Wed, 14 Jun 2023 06:47:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686750464; cv=none; d=google.com; s=arc-20160816; b=Zz/qGeI414loUX2WTnDqxSTiSRG4QU/j6zOe6633aM9UQgHTk5CKfMPZs2awEIfgcK B4lD1uAadNtqBfAELjPbvLSvfiu4VKsYRxUFi24JyJt/z0kAehbJhNFHlWuwAqYcjbBt Zc3/ttBOTcCKfiHgZU3Ot/meeEU400Ur+T2D4ShuxKS/+yoh0YhvOxHgXN/BbAiYon3D scLD+bDud1ur9mI/A4KNP4VOUXOoD1KjxkzQKFfqu/U729ykvRyQXn+q7rRW8f1+4n49 D06bWlUCmy+K3LEH6PhIzMT5kcdOgmXnotnJmezVX78cev98fQqzc92imSZi3SeOfSm4 oX5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hsXPCS4S+gkMSRcPDjjLvSrDD3Jt0vvETwXhvxIBuQQ=; b=y4PojIwD6Zfsrx+tHEeYZFWVAwnbxPQnnggQEmHn++2IkJEtj0ZqUvw8Ml4bzfH8KZ YYeTqaFeLnJjEetIuLxa8JWrMO48+4w5y0T9dLSE5Ws0FtpmiH7GWMz3k0WK+cYFNQaJ N/Qx/OOINb2CJgSZ1bAnFQ3RfAYJOiom7YniP0Vjstyh0leZ02z1KWaykoiNk5GTvlvT mnZijJdG0ABm/8v5TY/n3nR2CZdgVHdw1JqaFNgqUzYDBdi5rGHQiQ/DlyuTpcG59diy uwpCALrjH6qOzi9ttCDp5xFMFM3wATSYPYNf8HQ5QkIJ8w3QjWfzpIBSjZ8QYMSb2nJg n3Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=AgVFd20b; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a170903018a00b001a637615a89si11400370plg.561.2023.06.14.06.47.29; Wed, 14 Jun 2023 06:47:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=AgVFd20b; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S245091AbjFNNqv (ORCPT + 61 others); Wed, 14 Jun 2023 09:46:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245076AbjFNNqt (ORCPT ); Wed, 14 Jun 2023 09:46:49 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 384752109; Wed, 14 Jun 2023 06:46:45 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-30aebe2602fso4772399f8f.3; Wed, 14 Jun 2023 06:46:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686750403; x=1689342403; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hsXPCS4S+gkMSRcPDjjLvSrDD3Jt0vvETwXhvxIBuQQ=; b=AgVFd20bYOSqBI9tB+SauZvB7LGobLGra3s/n0OVHOKvTLEg4/P8rpoSedrfyIh2Wt S7CitgB2Ld3oDPyu2C12hPZX5r2oLCeZYemVu6ZVDpNNCWCtPrmTw1zPUZKZpQsfLIwE n9X9giCCKLS2krzRiHsAQ6zQUWFTTAiIAJKpe56xo0tX/S5GcjB98z58C4Sa+Ay7eCk4 /Zbb7qdHxYPu5eWxge2rt9NXTFJFHJipeCY7zhME1EGm0HeYSQZt/hkXOt4V5shLbeBM ZaGhDMbx/8/ZozehJRITX/uzLIZDFifnH9csTl5uIaRHerkLnlANd2VtNZz/qlCWu3rb 8Ipg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686750403; x=1689342403; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hsXPCS4S+gkMSRcPDjjLvSrDD3Jt0vvETwXhvxIBuQQ=; b=Xl2t3jVJ9yBMAuiaHaju79/aXVBbwizp2ffkGuSfw7dlHfdRrm8EqB4fNmQjVhEZSY gb1NWbrPDZSeZ2W+yNxirzLjtRGjmYRgO2atsbOpw3saDyqe2CGPh7fqfIm/bB+FOiKG dXXexrYadWsDeeiTNvgyfMNX7n3goPu3dcMS9xXavzZAv7d512AbcLpZeqhaMOnpm2Dk f8r7jEe09Frc8qfIlHNgVWv5kHneWO7CJVut6bh5puMEm768vJSp8dA40SA72IYNm4/G HRP9KFoShJUZ5G1ZBaD17U04vQuS+LnaZCvfggOe6f9J7kow2ITVKssVeDPIKrzTzAnU 3PRQ== X-Gm-Message-State: AC+VfDz9q7BAOZmiVjELMAXkPnL+KXXsX0p2qqGDLoAyKTYEM0b7TSM1 dacWGc3bhXD0sQRvor5Q9ZhLoQaHCrOeoQs4jls= X-Received: by 2002:adf:ce0f:0:b0:311:b44:2d74 with SMTP id p15-20020adfce0f000000b003110b442d74mr1119877wrn.0.1686750403225; Wed, 14 Jun 2023 06:46:43 -0700 (PDT) MIME-Version: 1.0 References: <20230612232301.2572316-1-azeemshaikh38@gmail.com> <87fs6ufq5r.fsf@kernel.org> In-Reply-To: <87fs6ufq5r.fsf@kernel.org> From: Azeem Shaikh Date: Wed, 14 Jun 2023 09:46:31 -0400 Message-ID: Subject: Re: [PATCH] cfg80211: cfg80211: strlcpy withreturn To: Kalle Valo Cc: Johannes Berg , linux-hardening@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, Jun 14, 2023 at 3:40=E2=80=AFAM Kalle Valo wrote= : > > Azeem Shaikh writes: > > > strlcpy() reads the entire source buffer first. > > This read may exceed the destination size limit. > > This is both inefficient and can lead to linear read > > overflows if a source string is not NUL-terminated [1]. > > In an effort to remove strlcpy() completely [2], replace > > strlcpy() here with strscpy(). > > > > Direct replacement is safe here since WIPHY_ASSIGN is only used by > > TRACE macros and the return values are ignored. > > > > [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strl= cpy > > [2] https://github.com/KSPP/linux/issues/89 > > > > Signed-off-by: Azeem Shaikh > > The title should be: > > wifi: cfg80211: replace strlcpy() with strlscpy() > Ack. Sent out a v2. > -- > https://patchwork.kernel.org/project/linux-wireless/list/ > > https://wireless.wiki.kernel.org/en/developers/documentation/submittingpa= tches