Message ID | 20241209095019.1732120-4-kevin.brodsky@arm.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B38D2E77173 for <linux-mm@archiver.kernel.org>; Mon, 9 Dec 2024 09:50:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 51D128D0032; Mon, 9 Dec 2024 04:50:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 455D68D0029; Mon, 9 Dec 2024 04:50:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A8648D0032; Mon, 9 Dec 2024 04:50:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 057118D0029 for <linux-mm@kvack.org>; Mon, 9 Dec 2024 04:50:48 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 811BBC02A7 for <linux-mm@kvack.org>; Mon, 9 Dec 2024 09:50:48 +0000 (UTC) X-FDA: 82874950704.21.A509DC9 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf05.hostedemail.com (Postfix) with ESMTP id DFC0010000F for <linux-mm@kvack.org>; Mon, 9 Dec 2024 09:50:07 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733737833; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TXhOkF+BRkbjEZRD727KKe3G5fsf3ooidZDOS5wP8XY=; b=fLX+1GxaMwCTJ3Gm1L9tvvHseJuEIqy3xYBx33M03hwQOLpZSYFh93gjbxPMS7Bbdo7+Co CjHbL4fmT3N0qhK2vFnDIC2RE80f7or7dy3igMFNO9raXhxkWr51tyi6IfpE28lRUFtABm POImlnHfS3d19mynUat7O5uYc2ggv10= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733737833; a=rsa-sha256; cv=none; b=dzkxRFBVuKYGytyA0PgoC2j0cCTsYHmsMo7PtOk0yk2kSsfWmRTwsSU3za4AlTF5HBOq/T 2ctXbnKugjw9rjD7QhFcR+3U89LnGJ1ESbEPHBdIbPfsWTsF8hAoGmu2ZrrDFaArFUFTw+ 0Q0Cg5XorCUde4pMg6dDM/WWz64fVXk= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com; dmarc=pass (policy=none) header.from=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 44BAB143D; Mon, 9 Dec 2024 01:51:14 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3B6F33F720; Mon, 9 Dec 2024 01:50:44 -0800 (PST) From: Kevin Brodsky <kevin.brodsky@arm.com> To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky <kevin.brodsky@arm.com>, akpm@linux-foundation.org, aruna.ramakrishna@oracle.com, catalin.marinas@arm.com, dave.hansen@linux.intel.com, joey.gouly@arm.com, keith.lucas@oracle.com, ryan.roberts@arm.com, shuah@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, x86@kernel.org Subject: [PATCH 03/14] selftests/mm: Fix strncpy() length Date: Mon, 9 Dec 2024 09:50:08 +0000 Message-ID: <20241209095019.1732120-4-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241209095019.1732120-1-kevin.brodsky@arm.com> References: <20241209095019.1732120-1-kevin.brodsky@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: DFC0010000F X-Stat-Signature: szhfqrcec7zixwe346actfuptxe88113 X-Rspam-User: X-HE-Tag: 1733737807-252962 X-HE-Meta: U2FsdGVkX18V2v0II+VronJ80y9LbNmakPUcZoKHZ1dAPfaLCSItWX0ktKQu+imUkinAep/2VePrlT27PqgTuYRhbbVXEC1BuU/sCWFl+EbCkptCqh/lMQaS+JLBWRHwPyXyWC69C6yzWRh1+eJ+DVZSBiDlYPj8a8V1ZdxAeJd9PK2gykYxsKT0NS7dG/Td4cy0WhSE6awRXMgAjfTRSleDs0+Q9bCPgRdEf+xvesnb0H9gLGQlWoNWkz8zmM9boxFfiswWP4a0u0cN7w7L52VW5psbToroLSdCom/KUAKvjb6YDA+xXcLrmcpd1EZAddcdlsN+Brz02/XlcFDNItlVB1EYHM1yNyvCXvvFr7GZ0NYBmXT5I8ili6VjWOKbAQFEZHb6Ye3t3HGLKIxTXG1h4Nad6JzmFzm98Wq5+na+vijOp7wTt3XMKmbXpeq8+C9CoRapEmCpvjoir9NdbA4y2N/hkmKMUOEDlTG+h9xfAVXBf9//KlXHPjPg/Z+P1rMCB9hhgI3o6q5S8I6fi57ZYchEZw27z7ss+Omf+k2JYeDKKPwf63ZV68PMPrhj2fe9m6gbsXi7bg16+x+jQvLcSMvpDJucCK8RALqebYoCrbnEr9OTSE3f5UfgrmXq5ZsTL32bBJbC8VGQjw+SRDwrKY0ywuMF6/pt/3QD369tPRDmFNdEGFaMltV+RwSqs9UkfWNOe/o7OwqJl6aM1RHM2cVShqnJls0t7lDtuQyacsCqing7ondaoAS2kHufHApaxUc2zEokdANL/hWoNN5OEe/JMn6oJn5VgX/mJQyXBT7jlNqv5b49cvxv0ujbmOlWP672yTZk2/pHqKIyvyeKn+Jp32uA6raPGHDJJh1GDgrQfDkF/YzdLn/MuYilU+H3k5m6YHP3djjVuUmmfGdaptCx6CBRu8lWv2fcRtNMj9tRlLpjC2IB7VFc2YmEzU0Xd/x24wgheb1p5H4 kdJbE/C/ 5h1yU+Jzjqt4p90rhAXErrHaT2zNuXPjc8buycVIgC0PQiPWLPOlRm/JWI1clNd+kQ8scJLD4NPBJ/GXAnSC8ZhNp8+kEmaj2JQHvLbYCVP2bAzWiGBbtyoWKVqtWgi76AcUSis8o1Gf03/USaRpZ2IuogDzm4VKuePxt2ZbG149oJ0Fa9KEO/POtYgGu6o8+eQHQZpw5HfnmrbM6O0DPXyEnQfYqDbAfubYXe5O8u1fi1PvpB6CZ8keSxg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
pkeys kselftests improvements
|
expand
|
diff --git a/tools/testing/selftests/mm/write_to_hugetlbfs.c b/tools/testing/selftests/mm/write_to_hugetlbfs.c index 1289d311efd7..34c91f7e6128 100644 --- a/tools/testing/selftests/mm/write_to_hugetlbfs.c +++ b/tools/testing/selftests/mm/write_to_hugetlbfs.c @@ -89,7 +89,7 @@ int main(int argc, char **argv) size = atoi(optarg); break; case 'p': - strncpy(path, optarg, sizeof(path)); + strncpy(path, optarg, sizeof(path) - 1); break; case 'm': if (atoi(optarg) >= MAX_METHOD) {
GCC complains (with -O2) that the length is equal to the destination size, which is indeed invalid. Subtract 1 from the size of the array to leave room for '\0'. Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com> --- tools/testing/selftests/mm/write_to_hugetlbfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)