Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2378334rdb; Mon, 5 Feb 2024 05:01:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTD2IDQU0HJT032b9rGLmZVMoE41VzspXLCWk4PFsaU+sSCh1p53Qk/EgNJbjlgAfztNkx X-Received: by 2002:a17:90a:bd8e:b0:296:42e:d3d3 with SMTP id z14-20020a17090abd8e00b00296042ed3d3mr12040640pjr.13.1707138081774; Mon, 05 Feb 2024 05:01:21 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVld1tD1cMhkbWULYC8ADYZOvXF8xTNqIEOL35+MGvdRuaSsNr1NAXJQfdve716QeKIrYT4LhGVB32BRqsZ8HhdNDHRvmoGqmvKpVwxjA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id r8-20020a17090a560800b002969dd0f084si1516698pjf.51.2024.02.05.05.01.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 05:01:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52672-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-52672-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52672-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7110A280EE1 for ; Mon, 5 Feb 2024 13:01:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 175C1199C2; Mon, 5 Feb 2024 12:58:31 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D69F1CAA4; Mon, 5 Feb 2024 12:58:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707137910; cv=none; b=sMs7SaaNhmkHw7f9jbgqkQvtXErspQkGbBt1EX+RSL35Or9U305HCCT4v/W8B6kqnCfKbnxa3yghWUT3LP+pVnS9Ezxor8hXX/RxMwFV7rAdrAp5unvjSO+HnxX5xGUs6EZmuvsC0fEOXw1wH/iIHrgtKyDm2sNuWsH1uWPahOQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707137910; c=relaxed/simple; bh=uj2ZkYW6W50FTigzL4VxlXJeeEginRsoNkLc1CH9YFw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LuSblXLrlNMnu/RXUJp86o2vLHph+OkQ8raE+tk0ZMUyYu2cP9RK+zX63Ds7lP5upb9//m2lthyqMjTdtqimRaJULXvIGhNV8qDljBGf42UTAaGsqeyAqG6QsZWpeUjpeWtzBxO4g8KWELup0S9TdMNDIovye2aCLBWyxg9vF1Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=fail smtp.mailfrom=kernel.org; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org X-IronPort-AV: E=McAfee;i="6600,9927,10974"; a="406134" X-IronPort-AV: E=Sophos;i="6.05,245,1701158400"; d="scan'208";a="406134" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2024 04:58:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10974"; a="933149291" X-IronPort-AV: E=Sophos;i="6.05,245,1701158400"; d="scan'208";a="933149291" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2024 04:58:25 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rWyYH-000000024fG-31Hx; Mon, 05 Feb 2024 14:58:21 +0200 Date: Mon, 5 Feb 2024 14:58:21 +0200 From: Andy Shevchenko To: Geert Uytterhoeven Cc: Kees Cook , Justin Stitt , linux-hardening@vger.kernel.org, Richard Weinberger , Anton Ivanov , Johannes Berg , Willem de Bruijn , Jason Wang , kernel test robot , Nathan Chancellor , Azeem Shaikh , linux-kernel@vger.kernel.org, linux-um@lists.infradead.org Subject: Re: [PATCH v2 2/4] string: Allow 2-argument strscpy() Message-ID: References: <20240205122916.it.909-kees@kernel.org> <20240205123525.1379299-2-keescook@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 On Mon, Feb 05, 2024 at 01:47:08PM +0100, Geert Uytterhoeven wrote: > On Mon, Feb 5, 2024 at 1:37 PM Kees Cook wrote: .. > > +#define __strscpy1(dst, src, size) sized_strscpy(dst, src, size) > > (dst), (src), (size) etc. No need. .. > > +#define strscpy(dst, src, ...) \ > > + CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__) > > Likewise Likewise -- With Best Regards, Andy Shevchenko