Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3244629rwo; Fri, 4 Aug 2023 01:31:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXYhnWZLE91lADLwV0jHKA8O0x8j0TrbQs90FC1AGjEa5JyyeusaWHVeeUpqR/OJMaarov X-Received: by 2002:a19:6702:0:b0:4fb:7cea:882a with SMTP id b2-20020a196702000000b004fb7cea882amr680797lfc.3.1691137873938; Fri, 04 Aug 2023 01:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691137873; cv=none; d=google.com; s=arc-20160816; b=ue0p3R93AObXfHPU8A/axDWr7F/4d61ReBwGsW8FlXnTE9EEgygERmVkfG3eDOgudk XnezmnG+obsYwre4DbJ4xnZwC6pWEUSY+K0z/2NpSyxPSEJNoXpTr5G1AI17+odPY3bZ MVk9H9ciVKEx1MjtkwyyPmILdfC1kd4qVvkmSfS2uNgYeU6/ym3pKE4gAWmDhA0yPv9a ac4sz/YXJqi+NE7hWtn6cYQMLWluktcuuQyxu0ZAndXr5aCuhRa6gRa670DOXo+Rhsx1 2hi+aaG9zyiRbX8wpOGYTW1ImFUhXAcpK11Epx0mvmwq3Gku9Hw/PwfSnhk/MA0MESDR UFsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xSQz11o3ul0yNyVq0pFtGQung0CwKOFZmwNl8PJxv+Q=; fh=M4YbP6RDaEOepvFDWmraIJEOF/rR6uztbAxbsnnUK0w=; b=oqBvizd+KFhZw9C4UgaIEaly9ayf7HblroErD1uevBZfvJvWHBxs5awGR+2IqeMPTA Hk4GFsWrcsn/e1Yf0HPJmxtrI9l/JDGwCHn6wjEcBszpgeMjEmyYVT8WwoCxdHAN8BJX Ts55T+BJoe0RMID10STLk6UfmUgRI9vnoJsu4TPmIZBrKJfGjCFAqFNMjmEyu9MA65vb m8h/9att5mFZbjC8MB8ouiSbjr4CVZQ9PVDPHGWUrp4L3p31u1lFDQW3TUKp6C0arQqN B73vpdgQZVX3SL+YxX/1RjMqyoy9UmVN74j5x5KrZ2lXbFVGq06danpOteNbMJdBzBqQ 9+Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=oBVOMrt4; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020aa7da8e000000b0052245c04c89si1259733eds.164.2023.08.04.01.30.58; Fri, 04 Aug 2023 01:31:13 -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=@chromium.org header.s=google header.b=oBVOMrt4; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233425AbjHDIVL (ORCPT + 58 others); Fri, 4 Aug 2023 04:21:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231576AbjHDIVK (ORCPT ); Fri, 4 Aug 2023 04:21:10 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2A621AB for ; Fri, 4 Aug 2023 01:21:08 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1bb119be881so15844895ad.3 for ; Fri, 04 Aug 2023 01:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691137268; x=1691742068; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=xSQz11o3ul0yNyVq0pFtGQung0CwKOFZmwNl8PJxv+Q=; b=oBVOMrt4+1w1zDz9OfBIdQ+ZbW3KAVLf/anefxKNO2eHmC4q38EUevTtWu2e22kSrF VZHd6G8nwCuKTK0yXoCVWhIylifzK96pEGW2UDfzliIQe1Bv3oj41TkXX+MWRUizb1m3 YwJF8o9P6g0JOvBWpytfxl/9hsl1K47r3/JOQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691137268; x=1691742068; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xSQz11o3ul0yNyVq0pFtGQung0CwKOFZmwNl8PJxv+Q=; b=hLzv7bBdrpNfDow+Sh++phzeMzTsgVdkyNHzaF4Wv098Dos2462K95ESxwqb3zArMd iApmJBlwD8A2pmFY1wJf06a6BuswvupgRH4pRHTTTxmj58A7H5EgCuHVi0NeDpQgarbD c3f9BOIY5NveZFgU3bKGAplErg+4/+bdn8gYxZIxi2TrJPqT9KWVX5e9CqOkXMtm9eoS q1WdvyVXe0wOfHcsRWewEb2Hbhs/toM6oTQZaTSEWUfg/xGfTflBGyOM5tJuf0JZLtXH 600SLSrdjICqypgX16x60GfZLIVxNN6RsUjNgCP6y3tSIOaQ23XRwVKgwdgIzYjmXr2q Sqsw== X-Gm-Message-State: AOJu0Yzy4DAhAA/AxPDyPNbGzCWlsBq6YET5rC6CEkF3/V2RP6xauhXK NY4SbdYxjgUsbjZEEmq8nRfUNw== X-Received: by 2002:a17:902:f809:b0:1b8:76fc:5bf6 with SMTP id ix9-20020a170902f80900b001b876fc5bf6mr978656plb.43.1691137268446; Fri, 04 Aug 2023 01:21:08 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id q9-20020a170902b10900b001b8622c1ad2sm1138143plr.130.2023.08.04.01.21.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 01:21:07 -0700 (PDT) Date: Fri, 4 Aug 2023 01:21:07 -0700 From: Kees Cook To: Justin Stitt Cc: Stanislav Yakovlev , Kalle Valo , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2] wifi: ipw2x00: refactor to use kstrtoul Message-ID: <202308040120.183400A04@keescook> References: <20230802-wifi-ipw2x00-refactor-v2-1-d33f765e9cd5@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230802-wifi-ipw2x00-refactor-v2-1-d33f765e9cd5@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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, Aug 02, 2023 at 01:23:06AM +0000, Justin Stitt wrote: > The current implementation seems to reinvent what `kstrtoul` already does > in terms of functionality and error handling. Remove uses of `simple_strtoul()` > in favor of `kstrtoul()`. > > There is the following note at `lib/vsprintf.c:simple_strtoull()` which > further backs this change: > | * This function has caveats. Please use kstrtoull (or kstrtoul) instead. > > And here, simple_str* are explicitly deprecated [3]. > > This patch also removes an instance of the deprecated `strncpy` which helps [2]. > > Link: https://lore.kernel.org/all/202308011602.3CC1C0244C@keescook/ [1] > Link: https://github.com/KSPP/linux/issues/90 [2] > Link: https://docs.kernel.org/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull [3] > Cc: linux-hardening@vger.kernel.org > Suggested-by: Kees Cook > Signed-off-by: Justin Stitt This looks correct to me. I would be curious to hear back from the intel folks if the interface continues to work correctly with real hardware. Reviewed-by: Kees Cook -- Kees Cook