public inbox for linux-hardening@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>, Josh Law <objecting@objecting.org>,
	kees@kernel.org, linux-hardening@vger.kernel.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 1/1] ACPI: processor: idle: Replace strlcat() with better alternative
Date: Mon, 16 Mar 2026 18:01:58 +0100	[thread overview]
Message-ID: <20260316170158.1596857-1-andriy.shevchenko@linux.intel.com> (raw)

strlcpy() and strlcat() are confusing APIs and the former one already gone
from the kernel. In preparation to kill strlcat() replace it with the better
alternative.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/processor_idle.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 45b5d17443cf..498d88f5d5c9 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1010,9 +1010,7 @@ static bool combine_lpi_states(struct acpi_lpi_state *local,
 	result->arch_flags = parent->arch_flags;
 	result->index = parent->index;
 
-	strscpy(result->desc, local->desc, ACPI_CX_DESC_LEN);
-	strlcat(result->desc, "+", ACPI_CX_DESC_LEN);
-	strlcat(result->desc, parent->desc, ACPI_CX_DESC_LEN);
+	snprintf(result->desc, ACPI_CX_DESC_LEN, "%s+%s", local->desc, parent->desc);
 	return true;
 }
 
-- 
2.50.1


             reply	other threads:[~2026-03-16 17:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 17:01 Andy Shevchenko [this message]
2026-03-16 18:43 ` [PATCH v1 1/1] ACPI: processor: idle: Replace strlcat() with better alternative Josh Law
2026-03-16 18:47   ` Andy Shevchenko
2026-03-16 18:49     ` Josh Law
2026-03-16 19:42       ` Andy Shevchenko
2026-03-16 19:51         ` Josh Law
2026-03-17  8:17 ` kernel test robot
2026-03-17  8:29   ` Andy Shevchenko
2026-03-20 19:17 ` Kees Cook
2026-03-20 19:25   ` Andy Shevchenko
2026-03-20 19:26     ` Kees Cook
2026-03-20 19:31     ` Josh Law
2026-03-20 19:39       ` Andy Shevchenko
2026-03-20 19:34     ` Kees Cook
2026-03-20 19:39       ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260316170158.1596857-1-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=kees@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=objecting@objecting.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox