From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABD832DC334 for ; Wed, 6 May 2026 03:37:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778038629; cv=none; b=kpEF5Gy1ZyBY/NVq9CGz/betSY6WHyuzvrTwnlhorlLWQ037VJMY7IXmgyzOHz9QmTIOCFLjfOo2qxk2RPyoPOPrkY5C5+jpCP3mvbh4LJ4UCM+Ucj4ztk5s12xD0CO090z4YXN3ae5K97+BekY2X4QkZ0dUF2MHy6D7+oCQJoo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778038629; c=relaxed/simple; bh=Dnalo/bvssUGcoLarmW0Mu3puh5kNsorR2ARqUyrXJk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CUElEwjmo/CEe11W0/uDuseXu2BVlZs6KGAJM3Ysmp/50UaPedPToEnf/QSCchH1IDkmNDKOzx0+W6lRNAOzN1+rEfD1tWDeCh2j2EsYYdx8k/7NQ35bSR5+b+jjMXdL3gA1GOu1rBB2fILzHey0KBBIwyB+5aJUpWIefa1TOYc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=I6duAIPW; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="I6duAIPW" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-48984d29fe3so84663315e9.0 for ; Tue, 05 May 2026 20:37:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778038626; x=1778643426; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=fCDCxjBslsLzg12I6kYRv855qs8zfp4TUfhArChtOWM=; b=I6duAIPWtwJ45oiONA/GIOmbF1luEnLqMt6+hVgRis+irUglqrMh6dn8iusRBHXAd/ yPJ5tuOIXK0UKEjH4Nsah0WMzSaE/pgQgPvpkGZ3hdAZ+yH1b7/0ndkWuA5+QWQOTonJ QIdYDc3iM9Z58+ut4GVmbsCXb+0/2UHS1tA2AZiYKixdL1eXSgMR89FMvpSpiegBLdDQ eR0CY7omJyHE58lxHfPor4fLZSeFbcyDiDv+MJBI8Nu6Q20E4wTVqzccQYYTq1EAyw1Q 5fzvXtWLnG6pR2ymvajj5Skvuh3SIIJNAxuapEficyuQDnK+45076nm2g+6XrYN9FWRk mbfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778038626; x=1778643426; h=user-agent:in-reply-to:content-disposition:mime-version:references :reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fCDCxjBslsLzg12I6kYRv855qs8zfp4TUfhArChtOWM=; b=JtwqW62bwDWJt+oREHkkHM6Ko1vdOc4AckjtL6SOt/B1HeLPMdLgpbfWD/wUtEESXf isIYg4LHWdhahuGp4UfFXuvBV82UKtUnI22ZdP3RskUn03p2ca9yEH8q9gkmPShhmgMA D+/prDJeFb2RTt6SZJTbbbVz5FPJCXCytC67i991uWkn89nIP9l7YBRysVW/Ofi9FZwC tmXXASKkc2EPrBvuUnxKFLntVZkRlN4G845araNzILj2LEDPZicRUKKfTqgQueEoGHFx XzRFvteigMhSgG+Wx1/ibHmwbfdi65e8Gi0rcjbs65+wxb6PC/dQfi8VooUTBJ6+R25I wL3g== X-Forwarded-Encrypted: i=1; AFNElJ8Vvw005VyMz4NOlOs82YLRk/uB2Z5dl/Xs/ziGNEhfVPz7TzHcLyJ6Y5yaKFC7norY3cYkdHXbgzZYFhg=@vger.kernel.org X-Gm-Message-State: AOJu0Yw2Rn2FKKEtBrb2jgMkdjVuBVNbpo567RVqpOrI8rYlbIpyDl/0 5gSXxf6UqsUds9aV8Z/U96Jd43XM9M5RYnygykjJ46FWrK/W2PCQoW8F X-Gm-Gg: AeBDievh8XdSag+8temxhfv3Nefwx2VefzjI29FR2Fwgw0/u+Go+6IeDf91Hn7ZvWfb nh4MJooGx/jXFloJeCEu0nztrqZ83ZngGNX71OsAqzFglFRUNb68O+ttnnSXuygIww+2qQ/5yH4 3AOJ5JdgrjktHeKOZQm6aRgH6iL18qR0atd+M7hMDWiZfAVXdTpS0oPF53kBtksGH48V/s/s0eE X6loEJ3MX7bc06TYnkdS4yLVN5pGXPmuO0Ha7dsGnOO7jFWqaqbE0VbtA8au0FA7wlOoogDhFEN CJQQw45aJjQ5Nl/0DaRce++Juye4Cd7FGLXqnuXBc1aoZaI8XN9NwRiJlV5AQLkZa/k0ZS3m2x5 PW8aoZyWKWnVR744H+kHYkgDY0vmtkmhcCaI2NYsQ83vygtImOv+7yOkkOy1a/Zu+8CeaWxsvQ0 BGGGEr2Ohr523UMbmBuz2hs9MiI9JBoQGd X-Received: by 2002:a05:600c:3e05:b0:488:9ed3:1492 with SMTP id 5b1f17b1804b1-48e51f2a997mr29947945e9.10.1778038625870; Tue, 05 May 2026 20:37:05 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e530b19besm7463115e9.7.2026.05.05.20.37.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 May 2026 20:37:05 -0700 (PDT) Date: Wed, 6 May 2026 03:37:04 +0000 From: Wei Yang To: Maxwell Doose Cc: rppt@kernel.org, richard.weiyang@gmail.com, linux-gpio@vger.kernel.org, open list , linux-mm@kvack.org, Lucas Poupeau Subject: Re: [RFC] Precarious macro in tools/include/linux/string.h Message-ID: <20260506033704.bpqcp2ydhoc45yda@master> Reply-To: Wei Yang References: 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: User-Agent: NeoMutt/20170113 (1.7.2) On Mon, May 04, 2026 at 11:21:35PM -0500, Maxwell Doose wrote: >Hello Wei and Mike, > >I was recently helping a new contributor with their patch replacing >strcpy() with strscpy() in tools/gpio. After some research I put a >hold on that and realized that strscpy was defined as strcpy, which is >extremely precarious and goes against the ideas the kernel has been >fighting for for years, and I traced that change back to commit >9e3d665 authored by Wei and merged by Mike. I'm currently working with >said contributor to get this alias removed and the proper function >definition added, just wanted to give you a heads up. Thanks for the effort. > >Are there any tools or dependencies that rely on strscpy() being >aliased to strcpy() before we replace it with the real definition? > The alias is introduced to fix the test case in tools/testing/memblock, since reserved_mem_add() use strscpy() but there is no definition in tools/. So replace the alias with proper function definition looks good to me. >best regards, >max -- Wei Yang Help you, Help me