Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1360073rdb; Mon, 19 Feb 2024 12:48:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWVzRuaxlra4jwJyn/JPk3PMG9x+2zpaWsKvbYRN2lJudgCzV3KXNXoDADgX3r5Em1bmEMCom8tAmyisWubZ5pG0YRwNEsCF+Y/55w5Gg== X-Google-Smtp-Source: AGHT+IE7c1oM61rUKnvJCrVUK0wQ0CUSRdL2kHoeSNz71f2LGFl3vPY71vgVhDLBeeWoK8/cSlb9 X-Received: by 2002:a05:6e02:12c2:b0:364:2328:22ba with SMTP id i2-20020a056e0212c200b00364232822bamr17856176ilm.12.1708375724041; Mon, 19 Feb 2024 12:48:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708375724; cv=pass; d=google.com; s=arc-20160816; b=U0WS+AvCBwX+XpFeuhkp4H8GqTvX5RXaOrfw6eeCsh9nia3eE0VbROKZ9g5g4rmYg0 x9/cWHla1WQUoXWNgIsaybpFn2A4Kmm2Vuwai58NApYCI1hn/jYaOUFCOXF7Tlb9gQ5r WImRMnbUazCNYTuLvprakk8v6aLN/sVyuAeu1BR5CBOPYAfhSCEtyk15wv2Ary0cuqlA G7VEJDzicsZLCxJFxnz1Lk0vjRgdV2YgLoO4B8xtUefHxDYVbb2UPMtYHKJZvMVSqnIy Ytw86GmJ9UcWLSJ31k5SC+7VeWO1f7kFqoLsnNOV+bJKjPbRwMVI79GTeyXsPXo8tFWK XFKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=V8YybLsICZj2mjsl1V+zecGuZDfKHHRJdcjQNYhMmt4=; fh=E9+ko7sPlyxPjcJvXPlA8k/l1NtMODP18pGC6Tm/ghk=; b=RBZtprDhNyeyWCxnjs1tsYDEm2BDZnRsxfHgggGHnOoMz4NtIwMaac6KvkR2yFWSu4 LVRZgvEfLYkBPqxSpBqi7sjqovcyB+ENOPoYr9XXBcQPpj/mh8h7qzbj4wIMJ1QzHx52 h8EA1dYS/siK/CAfHadZdQnQ08xsawSspuP8OlrXYMEOthnE5krzb/u9la7UEUyxRuJG zm75OWiA4mPNdjgEoCtKXvdZ3M7gRB3ABBavwKWFVU+OXtlZC9eEsU7L7+OfphV22rb7 e+fL4Qwl9XcXNTX7WbfAiv/0lXQVyLOSoTr0znk17NmUkR2f8JwHxUYVcVDZpYnrYJd5 osmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=1wt.eu); spf=pass (google.com: domain of linux-kernel+bounces-71986-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71986-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n27-20020a63721b000000b005d549553c07si4839676pgc.598.2024.02.19.12.48.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 12:48:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71986-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=pass (i=1 spf=pass spfdomain=1wt.eu); spf=pass (google.com: domain of linux-kernel+bounces-71986-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71986-linux.lists.archive=gmail.com@vger.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 BB1BE283C48 for ; Mon, 19 Feb 2024 20:48:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35D89535CD; Mon, 19 Feb 2024 20:48:38 +0000 (UTC) Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E72EC1EEE3 for ; Mon, 19 Feb 2024 20:48:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=163.172.96.212 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708375717; cv=none; b=m0Kq12H6iQ5oXr1J3dBefqa7jaItnu4qUWkTfC4to9jcVSezB+v0qsFbxZeChL3iA6Hkkky080T2hvdfJ7f/KN+Q5o2twDZ+s3Fv6e2fxBnORmnC0KHZijmEnSvP/PJeEI9MjB6EGOFhQ4F7ejyXF0sofJT/zJDSKQmcfG6IEgU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708375717; c=relaxed/simple; bh=hsIQy+euu5gHabYwqp91w8v7ot17RD1Hbvntagxcb4Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oUQ+kuuAk/rNz7K4YVtFHwXVepOuN3Hlzzls4A01LgXV9Jfu/ISjJls1cYE6aOCqIB8AEA1+/DrTZndShv9Jk+pw/vJaIwO8tRHOwcq+Smqw6GDF/MNV2I/iTlfpEbpOVX8b0FMldkH4eBVtrBdMBGxMPFTypX30u+2QBPxBwsM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=1wt.eu; spf=pass smtp.mailfrom=1wt.eu; arc=none smtp.client-ip=163.172.96.212 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=1wt.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=1wt.eu Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 41JKmLNZ017647; Mon, 19 Feb 2024 21:48:21 +0100 Date: Mon, 19 Feb 2024 21:48:21 +0100 From: Willy Tarreau To: Rodrigo Campos Cc: Thomas =?iso-8859-1?Q?Wei=DFschuh?= , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 0/4] Misc fixes for strlcpy() and strlcat() Message-ID: <20240219204821.GA9819@1wt.eu> References: <20240218195110.1386840-1-rodrigo@sdfg.com.ar> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240218195110.1386840-1-rodrigo@sdfg.com.ar> User-Agent: Mutt/1.10.1 (2018-07-13) Hi Rodrigo, On Sun, Feb 18, 2024 at 04:51:02PM -0300, Rodrigo Campos wrote: > As requested by Willy and Thomas[1], here go some more fixes and tests for > strlcpy() and strlcat(). > > The first patch just fixes the compilation when the compiler might replace some > code with its strlen() implementation, which will not be found. Therefore, we > just export it as that can happen also on user-code, outside of nolibc. > > The rest of the commits: > * Fix the return code of both functions > * Make sure to always null-terminate the dst buffer > * Honor the size parameter as documented > * Add tests for both functions > > All has been checked against the corresponding libbsd implementation[2]. > > Let me know what you think ? This time everything looked good to me and I queued them into the fixes branch since they address a real corner-case bug. I finally decided not to change your comment for '/*' on a single line because it turns out that the file in question almost exclusively uses the shorter, net-style comments like you did, and you were probably inspired by the surrounding ones. Many thanks for your work and your patience ;-) Willy