Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1569475lqe; Mon, 8 Apr 2024 12:53:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVt2GFrJrvgeZmD7dP/IVP/lKcg5QFpbr5lpRbkaOd8sR9vUfTtxvGMX82SO8vqmVf4MDHLjJmn5eDHQnkfzNl9TfuA+AzLjcUsW22Vmg== X-Google-Smtp-Source: AGHT+IHHqT6k+WyJq5j3Z+yemt2rE43ZrCDsdInT9TFpCsK783Vse6yNOCFD6hGA9FLvx+l30qiz X-Received: by 2002:a05:622a:1a8d:b0:434:83e9:dcb1 with SMTP id s13-20020a05622a1a8d00b0043483e9dcb1mr890656qtc.15.1712606007794; Mon, 08 Apr 2024 12:53:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712606007; cv=pass; d=google.com; s=arc-20160816; b=eI6zX+4XlBKW6EDRKmNnb4BLpSDu2tmR/Ji6wA9ib5b8TtVH2UXujmCoJa/Kt5v1Z6 Y5AbbfNHDwyWYRhbHsrIoejCM04qGlSKUHf5E32VuCsXQibhZUUv/AAAt/TnVmKXFkcc R1fASLWZrJaXikT+Qr6NHQpiMQp7hh/bT9/HMbp0VYHTchJ/DEdqerUxgDhBP0aY6/nX 8UDe+htTaryPqHz6u0wBknQOFr69wlXcJFeoERfuQywGws6c3eFDZ0vJ6yR0r0p8W51G jUYae3rQTgaG5M9X1pPW6GD1F33X279xsQBICJ9wl+Wm1K05GwoahfmAJlMJSHVLDm2k +h+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=M2AGkVcZDY5nhM/OCU0iqlvLzvTbYOvupbbnUFtFSug=; fh=icREsiykAfVJxdzMXw3j8oQzgWQH/lqhgBmg0DH9E/U=; b=j1XYXRGX5WSlX/cLs2SEnYMdl+LAWkQL3bDeu0RenXwcLIqjGZJMYXbbr9zTClScRK 0zUOQ82wL5pkw8mUTbbEoS/HDEvDZzyKbVlOPvo/iTBAHJ9X3oxflijbFpbHtoFRxe80 y3O9g1i+daj9JlOocOFhFfDuEmCalG/dStskLT68ElCTMp/viPOEXWVFBXEshoLhHLkf 9sKce3cSDwY9uY2StZbfsTZUNfIlSwj9CbiGs7cHCVE3DMApqLE4Iq9lNYLVBlD7o3Fd tS8qvgJyFxXKOVCxnuJQDNGRS4ygKLB+rejR/MA3eyhfMkPPpqHS9alV1azHg5aU8fAA 4WZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=XIK8PiHu; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-135890-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135890-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 4-20020ac85904000000b00434ac4fba04si2124078qty.639.2024.04.08.12.53.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 12:53:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135890-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=XIK8PiHu; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-135890-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135890-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 83CA01C22318 for ; Mon, 8 Apr 2024 19:53:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC8A514658E; Mon, 8 Apr 2024 19:53:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="XIK8PiHu" Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 6F11053368 for ; Mon, 8 Apr 2024 19:53:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712606000; cv=none; b=lbNLaavuIW/1mFNFvG3vIGXJsu9grXGbh8mkkPG9y9DhTEkp9fxuFRiWlxhyi1zQlkhE/XQdRFgKTYfHiwjXK36IL6X38wqDdZMy47mAY/bc5D9YWl5pj7lsyA+svjTN9fWjuEdBk+JKIBfikZvnjIuFkS5g1R17lOl9IgjJeUE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712606000; c=relaxed/simple; bh=J1CPpEryYaTGUfxmUhg8z5Ww9EQAIWCkFK5iQn4gbp8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=rcPpunGqdg2ix1RCK11h+XUlwllr/loOX0H2S1AOP8qelNjRVI5kpXW5JGQaQKEkUvy1QqilnVdnn3N92lMLSFnsCmUHvF2iIZqfqZOOIlUZ6giu6XE4NB/JSZkF0haukDrV3dsJR64vqVLfYiG+b2ICK8teCRJEpota3gr50pY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=XIK8PiHu; arc=none smtp.client-ip=209.85.167.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-516d0161e13so5244366e87.3 for ; Mon, 08 Apr 2024 12:53:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712605996; x=1713210796; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=M2AGkVcZDY5nhM/OCU0iqlvLzvTbYOvupbbnUFtFSug=; b=XIK8PiHuYaqH4sxrkxjXvaIKRnC1tY+A68uZYV0pDJYLA+fGv0nWlATZdho2LFiU+R CdKN3KN+9/DyCWhwWdLzHjE2kRsgExVK46vWB13tOuAPT8Uf22pyuNobX4RIm6QShdUp ZbNbU8dEJk2YamtX1Neg2/7FiageqZQ/7iHf7vT1p7JxoTOPzbu73SPexoh0EBR7oza4 fjIFzqnxc7DyRKl1Nu51gXg3yVz07rehxEJgvvVtBxeR9ThMl8HERtjVoNb1NIVCN2f2 qX+TQ3HHqk/GuGOtDSPbyWtBAmmN8o9nSgpst5G2o6C6Yp2Nb4NxksMGjRe9wTMqqj2k m96g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712605996; x=1713210796; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M2AGkVcZDY5nhM/OCU0iqlvLzvTbYOvupbbnUFtFSug=; b=KpRh9Kr6dhM6bWeCO+LR/XUuvsJV77Ce7G7CI542kTQQZcWbeKzGhYYFkGNYKOPqia kVqk9dHCkdAb+eDyAqDsj1bc8S+4+5Y9AjSBkGtTurgVuHJS5UdHBCllb6bjAR1vSr69 0WGK0D6qhrwjzs1l4XlRZ0KYfx0/rfKUzA4S3St08zMJwS7CXzoaMhpl+Yw+yp2RdpIX 9v0JYeXGQx5IXKHAsQn2DzSQhSWdYNBkcahuOOfvZ8MciT/YE002xa8apuwrKVJSo5E3 6u2B0InAYh1y2k7SNZwCjH6S0PNWyVusZxY+gGCq7sKvzw1fdVc6PrITXLbQwHp6DxF/ irMg== X-Forwarded-Encrypted: i=1; AJvYcCUXCyX/EmvvR8MKx30TyT19pqj8h6HH3cseK6S6CSsgZRE/ytskcH2qOF7oDnDWzwZ7U8RsDaC6ZaIk+E+/MGLdg3D42vYXMfALymXE X-Gm-Message-State: AOJu0YyKKBEab8aCJA5k0a4U2AgLw148e+Qpa19Uz5hX3kh85wDsichz LeCFHF2JiqiaKPXLADTD4yFqy+H9r/1W779TkVqNchqAjYROlakjtEdjV6o8eI002BdEsWPGIhw L5OsHG/lc6zzxIrm0PPUzwlB7bCFNM9oZH+6f4Myzwx7gai3ZU+p6jTo= X-Received: by 2002:a05:6512:3993:b0:516:e8b1:177d with SMTP id j19-20020a056512399300b00516e8b1177dmr4743559lfu.65.1712605996374; Mon, 08 Apr 2024 12:53:16 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240328140512.4148825-1-arnd@kernel.org> <20240328140512.4148825-6-arnd@kernel.org> <8b771062-7ce9-4b00-a488-91b231a1476e@app.fastmail.com> In-Reply-To: <8b771062-7ce9-4b00-a488-91b231a1476e@app.fastmail.com> From: Justin Stitt Date: Mon, 8 Apr 2024 12:53:04 -0700 Message-ID: Subject: Re: [PATCH 05/11] test_hexdump: avoid string truncation warning To: Arnd Bergmann Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, Andrew Morton Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Mon, Apr 8, 2024 at 8:38=E2=80=AFAM Arnd Bergmann wrote: > > You are correct. I do understand the nuances between strncpy() > and strscpy(), but I failed to read this file properly. Arnd, I know you understand these differences. I did not intend to patronize, so sorry about that. My intention was to provide ample context for future travelers/reviewers. These replacements can be tricky sometimes. > > I'm still not entirely sure, but from my current reading, I think > we can just use memcpy() to replace the strncpy() here, as both > the input string data_b[] and the output real[TEST_HEXDUMP_BUF_SIZE] > are sized to cover every possible 'len' value. This also follows > what Linus did for the other original strncpy in b1286ed7158e > ("test_hexdump: use memcpy instead of strncpy()"). > > I've reworked the patch based on that assumption now and rewritten > the changelog text accordingly. Great! This helps towards https://github.com/KSPP/linux/issues/90 > > Arnd Thanks Justin