Message ID | 20241030130308.1066299-5-mcanal@igalia.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 2F43FD5CCA9 for <linux-mm@archiver.kernel.org>; Wed, 30 Oct 2024 13:04:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD8986B00C6; Wed, 30 Oct 2024 09:04:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C88C96B00C9; Wed, 30 Oct 2024 09:04:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B015B6B00CB; Wed, 30 Oct 2024 09:04:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8E4546B00C6 for <linux-mm@kvack.org>; Wed, 30 Oct 2024 09:04:03 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 49FD44088F for <linux-mm@kvack.org>; Wed, 30 Oct 2024 13:04:03 +0000 (UTC) X-FDA: 82730285820.18.83B584C Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by imf15.hostedemail.com (Postfix) with ESMTP id 5B7D5A003F for <linux-mm@kvack.org>; Wed, 30 Oct 2024 13:03:35 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=igalia.com header.s=20170329 header.b="AjeU/KsG"; spf=pass (imf15.hostedemail.com: domain of mcanal@igalia.com designates 178.60.130.6 as permitted sender) smtp.mailfrom=mcanal@igalia.com; dmarc=pass (policy=none) header.from=igalia.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730293361; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/lH6a4L8gtRKOjPZ3v2254wh73VRSysBe4phJD9CDEs=; b=N2GqDigEc+trik+LdsKyZ782Op1a6YjTsaN8huE/XpNFPd2hJcN/Lb18AO7n6id1LhwXij 7sz0raAfj0svQXZKaMbX0hT4kXmJfkNJs8MHJ6tAPusKaqy41ZWp0pnVyjpCymGqeG8mFq rfnZAOV8+iH5hesbByJ4Wm0NueB4gxQ= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=igalia.com header.s=20170329 header.b="AjeU/KsG"; spf=pass (imf15.hostedemail.com: domain of mcanal@igalia.com designates 178.60.130.6 as permitted sender) smtp.mailfrom=mcanal@igalia.com; dmarc=pass (policy=none) header.from=igalia.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730293361; a=rsa-sha256; cv=none; b=iMNaKKYrLHowZkl+hGPsn0ACcbhfRLr7rjnPQX2K7+EUU5g7XDvPCz9G98k6Nfv+551Bqu COMwEsDDgdzYrAuyser8DeMnB44Od9MayZrS/4/S2P+/JrbBhk4YPze08bMxmPDOEUzPRN Mzu9UOEw2aYqdyow1Ph4Oh14Hgt1o5s= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/lH6a4L8gtRKOjPZ3v2254wh73VRSysBe4phJD9CDEs=; b=AjeU/KsGJLU50JSiT7VnonXpVh xz162mpXuW5PYT8HVrkynl+V4L5bYQ6ExijZcA+EMXvKfT6YIV+MAjIQJ4gsHzbRp79rnDgZdjgsb upmm9Teb+VtHj3VcJHi4NtlEBRE+XnecY0G26vW2jhQrT4TW46nw65Ed5GVT1hZ9HKRRLCCsDEQ+r sG1XmQcd6BDGZj/lJXYm8hAt9NXjZDSs0ej2GO41/QQC6TAR+iUcAVhs1Tvrrpqfn0X1iC/EtyHWU /RRQGdXOMT6j6rTERDtWG7RAq5YMYsinIfXvvLRGEiuqPZf8FybhAvLw+F78ANejVw4Pj1uJ4n0LO l2zQmP5A==; Received: from [187.36.213.55] (helo=morissey..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1t68MY-00H5h8-CM; Wed, 30 Oct 2024 14:03:50 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= <mcanal@igalia.com> To: Jonathan Corbet <corbet@lwn.net>, Andrew Morton <akpm@linux-foundation.org>, Hugh Dickins <hughd@google.com>, Barry Song <baohua@kernel.org>, David Hildenbrand <david@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, Lance Yang <ioworker0@gmail.com> Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-dev@igalia.com, =?utf-8?q?Ma=C3=ADra_C?= =?utf-8?q?anal?= <mcanal@igalia.com> Subject: [PATCH v3 4/4] mm: huge_memory: Use strscpy() instead of strcpy() Date: Wed, 30 Oct 2024 09:58:58 -0300 Message-ID: <20241030130308.1066299-5-mcanal@igalia.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241030130308.1066299-1-mcanal@igalia.com> References: <20241030130308.1066299-1-mcanal@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-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4JhzsGRAlhIz0w78vlTtSZtrNLX2xQEv8gfG9WRrrRqdDLhwOG9hYu0YMGckYv95dUWqFMk9fCqoiDm+hX5YGqmrHjvPTmHEWDNx8HdkWlOwidb6SJGy+aoMwsIaahySHAWq9YdjIwCzRZLVNpzPQGis1w7VomdjRCQYXLVjFh1WprkUXNUGjbGu1zBucAo2q8Tedw2woq80RUJWYBKCoXU5VjYLSA4BlzHVOAFjRbFUI/HwbnfYSOVVEKBedrRRJoFDHlxLRh7CEn15/efBLNXod5SWlEyp5hXhKVysOf7fmQ4cPzLPx1QJGpjr3ulPugxRmWn8Ashwmym19mJr7NTWEW6ooKEHjgPmsmy/9/glX8OqBdM4tpNr3CH9GVovfSbZugsOBKnu1sHrXA== 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 |
mm: add more kernel parameters to control mTHP
|
expand
|
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index f92068864469..8f41a694433c 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -989,7 +989,7 @@ static int __init setup_thp_anon(char *str) if (!str || strlen(str) + 1 > PAGE_SIZE) goto err; - strcpy(str_dup, str); + strscpy(str_dup, str); always = huge_anon_orders_always; madvise = huge_anon_orders_madvise; @@ -4175,7 +4175,7 @@ static ssize_t split_huge_pages_write(struct file *file, const char __user *buf, tok = strsep(&buf, ","); if (tok) { - strcpy(file_path, tok); + strscpy(file_path, tok); } else { ret = -EINVAL; goto out;
Replace strcpy() with strscpy() in mm/huge_memory.c strcpy() has been deprecated because it is generally unsafe, so help to eliminate it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Maíra Canal <mcanal@igalia.com> --- mm/huge_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)