Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2600967rdb; Fri, 22 Sep 2023 03:36:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOfuh79Cg9PkkXFvFdNCQAP/YdbVlY0objk9Ilq4oIPgu+DI2/md28Hs2k3E8EEjGvl3EZ X-Received: by 2002:a05:6a20:3d15:b0:149:44d9:bbb0 with SMTP id y21-20020a056a203d1500b0014944d9bbb0mr8829250pzi.43.1695379008585; Fri, 22 Sep 2023 03:36:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695379008; cv=none; d=google.com; s=arc-20160816; b=pWAyY1Bw3rAuINf7suc8BzYC3eCQGEzC7/ZA16AgeRUMz5jSOzI5xMPjf3uKzd+blR LD+IlVRbJ2dZfiDUmI5sLlvYsWS5qJhryftydVBvMgeSlXjUv8oOV27W+yPMfdCCXaSd itHHSPZ2GVL9xU/MSxMt7KADy5tFNPVPvsRCm/9PZZH4LPxqchRhAFspeeobllkIvZ+F s/REDlr/IVZEQpuXZR2/svya8NVpdE9hcaTpc3gJP5eegHeX0HETi8PDNgvaBKkCWbcb P6KiggB4pFr3w1fB4By0LBAS545R+/sRBeMOo0CBwOu5lgvIQvLtLIGEX3Kg0ikguk1g ymFA== 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:date :message-id:subject:references:in-reply-to:cc:to:from:dkim-signature; bh=ixAI2miTzHSOfo9FXyFNySnIT8pmm0VLsgPKryiNcos=; fh=jad6pKPAr8rcspTx/XO+pmFUfIFME7p0XiJ+08wl1BM=; b=xoDWCpeL/ctOWtivFl5ujLJY5IS9QOuwvWuXT8KVIwNe/RmGU+k1Q42tMtNdqCgRxv EMbY1oqXXyYT0Vx9hyicfigpyH4k4nQQtVqqmNa/n7EfZ7AGyuKitvxsTqhPWp3g8VHO 15VSY/5sZDYDMJGDBjmwjzk1wBlebcAvN2beH3Z9Lg9nnvTwgR0cCDIwkyXoedbqoKyk IZ0WebIR9JpCKnWRWTthx8UVScEy/Auao5QKrhjxZwrc7Uox+akMzFaG1P14eS2vLzsq 96j0KmxsOkmER/P9lrgi+FnOcQ426tgfmmGB7BwShqXsffGn1V73uVG0nxiafptszh8H c8bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IADJUGvi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g15-20020a17090a300f00b00268137c2f12si6034212pjb.2.2023.09.22.03.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 03:36:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IADJUGvi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7B7AC836F415; Fri, 22 Sep 2023 03:30:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233379AbjIVKaI (ORCPT + 99 others); Fri, 22 Sep 2023 06:30:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233355AbjIVKaD (ORCPT ); Fri, 22 Sep 2023 06:30:03 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CFBE195; Fri, 22 Sep 2023 03:29:56 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87E39C433C9; Fri, 22 Sep 2023 10:29:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695378596; bh=/i1zbZoU5NiY0diHT4erelvkPZqClSw6bwMm0Z9t+t8=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=IADJUGviHeBuvuTH9yNkK952Wx+KotbLb4IKe11tLF6OGjsTpcJtU/9jQ/B824Xhu lgcWVGiMsYgB5YJq9W/BdxtiD1xYtR5rm9QX4q2/z+nyq8KKN6V6xBGd0e9G+LnssH 6EyEB/dK81Jz4+0JN6PTrreZu4tQUpZA7weSrr9XP0sKy+uraBJa80sykqa1q0Uwy0 1c8Nm9RYjTCyr69bwWOMniICTYxAi49F2aUBnvYF2IUnqv5wHcA9JZ0LVYHmCjQfXZ Mf+kRkUX3Z/uVDlR8wIpuMRWrLJFZwEfj3HMsw7QVQakaZlvBdc/WRQFa8aswQAw6H K2x+Z4Lcy27bw== From: Leon Romanovsky To: Dennis Dalessandro , Jason Gunthorpe , Justin Stitt Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org In-Reply-To: =?utf-8?q?=3C20230921-strncpy-drivers-infiniband-hw-qib-qib=5Fi?= =?utf-8?q?ba7322-c-v1-1-373727763f5b=40google=2Ecom=3E?= References: =?utf-8?q?=3C20230921-strncpy-drivers-infiniband-hw-qib-qib=5Fib?= =?utf-8?q?a7322-c-v1-1-373727763f5b=40google=2Ecom=3E?= Subject: Re: [PATCH] IB/qib: replace deprecated strncpy Message-Id: <169537859190.3339131.7912668348878588064.b4-ty@kernel.org> Date: Fri, 22 Sep 2023 13:29:51 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.12-dev-a055d 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 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-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 22 Sep 2023 03:30:19 -0700 (PDT) On Thu, 21 Sep 2023 07:58:48 +0000, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1] > and as such we should prefer more robust and less ambiguous string > interfaces. > > We know `txselect_list` is expected to be NUL-terminated based on its > use in `param_get_string()`: > | int param_get_string(char *buffer, const struct kernel_param *kp) > | { > | const struct kparam_string *kps = kp->str; > | return scnprintf(buffer, PAGE_SIZE, "%s\n", kps->string); > | } > > [...] Applied, thanks! [1/1] IB/qib: replace deprecated strncpy https://git.kernel.org/rdma/rdma/c/cb7ab7854bc709 Best regards, -- Leon Romanovsky