From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 610A0C7EE2C for ; Fri, 25 Aug 2023 09:20:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244127AbjHYJU0 (ORCPT ); Fri, 25 Aug 2023 05:20:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244290AbjHYJUS (ORCPT ); Fri, 25 Aug 2023 05:20:18 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04BBF1FC4; Fri, 25 Aug 2023 02:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692955217; x=1724491217; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=FDMl+onuToDyEOluRAGKzyB6iREgmusYLPjxALDtjeU=; b=gOylUTwJeMv53CVutmmdrBENHVMQFh5Pvve6G77uMFdRcSholTbj9mKJ pFswJ6OmUGfygtxVDirzxku1OCAuuF2IMEoC5zX2EkyAPucP/caaWrV4e TGht/MNqBBcvQH4eZ25Jy3lWCD+WwRkbTz55zoI5XiiBzjqbMf8IPyzND Mn81SBQIusq/vIt6b08cgwnwc6Vjh3r/EzZ2Xo76U60c6yr2/Vp1jdCZP bWdOuGaajGsQ0ClYen//nW/OxDnepuY2PDBaCRCMNh8ikgJcry+eX5JPC HWpkhMPnWwQXqvAv7i6AiWUcLcoobA/SDo1uaJQ/pO8I+hBwzU9aRG5x4 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10812"; a="377412579" X-IronPort-AV: E=Sophos;i="6.02,195,1688454000"; d="scan'208";a="377412579" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2023 02:20:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10812"; a="911228524" X-IronPort-AV: E=Sophos;i="6.02,195,1688454000"; d="scan'208";a="911228524" Received: from joe-255.igk.intel.com (HELO localhost) ([10.91.220.57]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2023 02:20:13 -0700 Date: Fri, 25 Aug 2023 11:20:11 +0200 From: Stanislaw Gruszka To: Justin Stitt Cc: Oded Gabbay , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] habanalabs/gaudi2: refactor deprecated strncpy Message-ID: <20230825092011.GD3748525@linux.intel.com> References: <20230824-strncpy-drivers-accel-habanalabs-gaudi2-gaudi2-c-v1-1-1a37b65576b4@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230824-strncpy-drivers-accel-habanalabs-gaudi2-gaudi2-c-v1-1-1a37b65576b4@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org On Thu, Aug 24, 2023 at 08:45:08PM +0000, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > A suitable replacement is `strscpy` [2] due to the fact that it > guarantees NUL-termination on its destination buffer argument which is > _not_ the case for `strncpy`! > > Link: www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings[1] > Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-hardening@vger.kernel.org > Signed-off-by: Justin Stitt Reviewed-by: Stanislaw Gruszka