Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5537038pxb; Wed, 26 Jan 2022 14:26:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxt7ymPlUSDT/CZ6+JRSVVQSB24tIIemF99ROyxXzMThUomsPcs1mWljCvIfq9k5spfjlu+ X-Received: by 2002:a05:6402:3552:: with SMTP id f18mr991083edd.189.1643236011583; Wed, 26 Jan 2022 14:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643236011; cv=none; d=google.com; s=arc-20160816; b=zjo8ymMPXoxD+KJ0ngjcKSq9wszR4NJaNvaf6YTUbV6XdKBWfxFgmhIqG6UolElrBm vt0vNvdFg9F9ggj+Z86la7FexBzkaVedBK0cJ1NrovkNViyvsos1eH+l8PI39gyADg3Z n6Svh7BF7JWMGPlaJUjuSZgFvKvHU/i0MLYCAYpW0xHhYZ9Hb61g2iUicmPK355GmI6n iRq5NGyyA7mfOVGcnxtst2ldO0kBb0VLXMf46HAAQyhHNBdpjP93cWsv6PT5xd7WxCOD HdSMfSqD4duWmLSIYIQ69xhwVw6myBy2IlZJdNoyS1dW1uGrd1NPXG/5DP3+PVcVgAiX kzJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=g4vLktA9dut1ZZ6t7RXp8CZMzzW5klGtrtc+4Lu3mLo=; b=raQuAFVs23ymE29/2cyXM239AWwZdHDUdy6j7OMpBiSYXIIjXIhMVm/55bweygH7IR 9yyNGFD9q+JgXzYf2OHltQA2iU73HO47B2MR88AdrEEZb+7gedrKgQIV3GHu879ANlx9 yUe/68OzSuMos59Yd54a+AhVl6qg1gGXQJsMlIYsFoIZEUN3GTOfJWaVcg9U33pbLQzB xowQ0mHeLTylnswKf8fyT8blzyYiwX/5/g1x9MLTcg/hN0MhpFUUkR7Yx4VXEgOUPIic xxuinQdeJ6D4o/t8I769hRepaoduPGckkvUnCF2DyqxJeQnwH8uclRR3HesJtMimtl8L yglg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KVDjhZDf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si261487ejl.347.2022.01.26.14.26.26; Wed, 26 Jan 2022 14:26:51 -0800 (PST) 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=@intel.com header.s=Intel header.b=KVDjhZDf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242913AbiAZSIu (ORCPT + 99 others); Wed, 26 Jan 2022 13:08:50 -0500 Received: from mga11.intel.com ([192.55.52.93]:59238 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236949AbiAZSIt (ORCPT ); Wed, 26 Jan 2022 13:08:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643220529; x=1674756529; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=630S9s/e9vVdb20f/VudwkoJcZwibuloW7Wrp/l56J4=; b=KVDjhZDfsIY047V98+sEvBVb1VFIxHLxYJHBXwptd0uuhZsaDXymanBj LU29PXtZD5Fz8iDHXWrc8597N7EYAFPK9EGLh8/cSuvYspiNtKhysyIGO ZP+G/8vJcnrb0EO91ECqcYcheWkoRmD7DkY0MwFJ/wsgxf7cpC3xOBmx9 dNWeZ/atWlFD27y43nEihMRMBjvwQLVsSzwNt1XAv0npUW8lP9giO0GvS hQZgF+FvAZpEXYLxE+XC4sAq4QWxbPZ0ghEWYjtgdpS+wKDiifORxj+sN L8WqveENdY1idzRva6BzLfdkSRDJ5yZ2UdYkxa1ngwRna28QcJbk0KqN8 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="244212239" X-IronPort-AV: E=Sophos;i="5.88,318,1635231600"; d="scan'208";a="244212239" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 10:08:49 -0800 X-IronPort-AV: E=Sophos;i="5.88,318,1635231600"; d="scan'208";a="563485914" Received: from smile.fi.intel.com ([10.237.72.61]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 10:08:45 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nCmhn-00EheX-LF; Wed, 26 Jan 2022 20:07:39 +0200 Date: Wed, 26 Jan 2022 20:07:39 +0200 From: Andy Shevchenko To: Nick Desaulniers Cc: Kees Cook , Francis Laniel , Petr Mladek , linux-kernel@vger.kernel.org, Andy Shevchenko , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes , kernel test robot , Nathan Chancellor Subject: Re: [PATCH v3 1/3] string: Make stpcpy() possible to use Message-ID: References: <20220126141917.75399-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 26, 2022 at 09:49:38AM -0800, Nick Desaulniers wrote: > On Wed, Jan 26, 2022 at 6:19 AM Andy Shevchenko > wrote: > > > > It is a good rule to avoid submitting code without users. > > Currently the stpcpy() is unusable due to missed declaration. > > Any attempts to use it will bring something like: > > > > error: implicit declaration of function ‘stpcpy’ [-Werror=implicit-function-declaration] > > > > Move declaration to the header and guard it as other string functions. ... > Recall the discussion from Kees: > https://lore.kernel.org/lkml/CAK7LNAQXo5-5W6hvNMEVPBPf3tRWaf-pQdSR-0OHyi4RCGhjsQ@mail.gmail.com/ > and > https://lore.kernel.org/lkml/202008150921.B70721A359@keescook/ > I'm guessing that the 0day bot report was on the third patch in this > series, which looks to use stpcpy: > https://lore.kernel.org/lkml/20220126141917.75399-3-andriy.shevchenko@linux.intel.com/ > > for patch 3, Yes. It was Rasmus' suggestion. > I'd s/"compress"/de-duplicate/ or s/"compress"/merge/. I'll fix it locally. > Kees, I'm curious if we can do something like require the string > length to be known at compile time otherwise BUILD_BUG_ON? Perhaps static_assert() is better. -- With Best Regards, Andy Shevchenko