From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk1-f169.google.com (mail-vk1-f169.google.com [209.85.221.169]) (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 C8E81373C04 for ; Mon, 11 May 2026 11:41:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778499671; cv=none; b=DEEXqx6O3ZdPfuyhHd+wet2Ml9TVGne93f/3Tf93nNL3VGqNKNazxpjgJXasha9nQmEkGXjSv2SvZb0tBzbW52ea0dUoZ9TN17PPDTfUf81826slJ1rKuXnb40Gr+DKHTyFwpV1GMmwswAHvKNRVY7lHbCq2jBDWaltys/NBIWk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778499671; c=relaxed/simple; bh=J1mvWJW2oCBok8Riaab8tqKELNru6gCS/PJVbbJOYS4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=NQNaxjSAu+kXEyQk9+2DV5qoyIqhBemQWRWtvZdy5NSCyVHm+qGZUAD1JdOHB83j3EpQ0lD4u00dkMujubcZzv4iMPJah17SVgM5XZWDdbqwbMWoB5u0mnFLGuNaqdjOKm9mM+dtYTyj/ABHTWymxkYSmQRY1rWccKhxCuyE0RQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vk1-f169.google.com with SMTP id 71dfb90a1353d-5751b7d147aso1316193e0c.2 for ; Mon, 11 May 2026 04:41:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778499669; x=1779104469; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=C22/kjYSfB+yUgZZw3ZuBJFKG5aBQVepFgZk32x5tBE=; b=Pj1gkxmE28aaqU4QR+LqpPgnmXTjSL5xB7Bags6Wlhkwt2RH9ehlwkOptoqm+VP44z tgj1A32fifLbWQE2YAIZ07vhXch0LbGtqWErTradVRLZHmud10DTtaTZ94eJIBjCbQPv yKJe7KPatwsXHaWpWd+dD5ThCm29+IcmfiX69CclKaGrK/afAA7EQZDTHknEA/tfErHx KM3B0uXBtVeN4MFGOUBNDNZ9UBYEsv2zu/rFw7nGBARfwk+b+i8ob6Fyky6URtLGK+u+ Gi7kIaaXtgDPKSLf9kZmwBq4tWLJ506b8R1MP7xMhc90DtTkQZqxQvX5QMoSQtazD3cL 5IJw== X-Forwarded-Encrypted: i=1; AFNElJ/EkE7VNdY7WVX3C+UZsakHy7tbGuM66lQrRmdkcnH78N9RWSEzFy7jyZ32HKAWSTsQHCrtp/yvaQfYFBI=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0HvHCIOOFyw9wCUZHp0Qxteg/meGkphAcFGoIU7HaQSjFLlvo sbEGYGlFZrE1z0BikGNNKdqVEQvdH+odl57m62bY4PC3KGTaBvbTC9C3OFHs4qmd X-Gm-Gg: Acq92OG9LiUpnEVHbQL9ppCgO3xeB3s1/2+OAsTLmvovosSTvhzJuxGoSFvlLIsHk4G Zgqd+XokBCb1MxvSze/+seED/YlMiCi9fWRTWBkbgAUpObNZfUsoBEAi48svG/Fx1NclerVwvgJ ILoLfp7QJkGyScf+A+PGywq0LBExMek9j+3fqn5dChSVogENWLcZSp2Rdh3KqOx8D0XucjO5lxS Km/ADkMNcV8wf91JyN1X6O/xU6isum81LzF8/eqDHFZIV8sEGpZgLsB/tco4iAS+zIS8d8tNDlx TsLwJG0lhs7fItu483eJuAcaEeHcIZ57E8DD/VK4Bm0HCMWJlmjMkTp3hXfeoGRQ0uHfBEcFAz8 jDDS4DWCiIZdrW58xUTiM4SlSB927rX/hKV+SPA2zpdc8SgfRkt26b33HSSloo7jdOAOibDzoGQ j4/+e6OQOnnX92EGCg9LymX8E36YPu1RR+65xQUbf9u8FpKuy57tXXihLClyNWrjJ4rCQxIf4= X-Received: by 2002:a05:6122:1d12:b0:56d:9e98:4676 with SMTP id 71dfb90a1353d-575597446e8mr12143230e0c.13.1778499668729; Mon, 11 May 2026 04:41:08 -0700 (PDT) Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com. [209.85.217.50]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-57576d13773sm7130036e0c.16.2026.05.11.04.41.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2026 04:41:06 -0700 (PDT) Received: by mail-vs1-f50.google.com with SMTP id ada2fe7eead31-6324ee4040cso524911137.0 for ; Mon, 11 May 2026 04:41:06 -0700 (PDT) X-Forwarded-Encrypted: i=1; AFNElJ9fSp7RhYsTDGAo0M82WFeQpRQtbZQwoFEGriBUSlucizme57w6OhSuf/7XsZgVX2d89KUZ5xqS5wev+Ms=@vger.kernel.org X-Received: by 2002:a05:6102:809c:b0:631:3b92:9d9f with SMTP id ada2fe7eead31-6313b92abc7mr5876321137.23.1778499666060; Mon, 11 May 2026 04:41:06 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260510164907.57176-2-manuelebner@mailbox.org> <20260510165159.57457-2-manuelebner@mailbox.org> In-Reply-To: <20260510165159.57457-2-manuelebner@mailbox.org> From: Geert Uytterhoeven Date: Mon, 11 May 2026 13:40:55 +0200 X-Gmail-Original-Message-ID: X-Gm-Features: AVHnY4KiXj1yHPwMyogp79HByon-acSWkydfvm9oUlpH2lGIbbScMPZbFEOzbds Message-ID: Subject: Re: [PATCH 1/2] [PATCH 1/2] Doc: deprecated.rst: add strlcat() To: Manuel Ebner Cc: andy.shevchenko@gmail.com, apw@canonical.com, corbet@lwn.net, dwaipayanray1@gmail.com, joe@perches.com, kees@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com, skhan@linuxfoundation.org, workflows@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Hi Manuel, On Sun, 10 May 2026 at 18:52, Manuel Ebner wrote: > add strlcat and alternatives Thanks for your patch! > --- a/Documentation/process/deprecated.rst > +++ b/Documentation/process/deprecated.rst > @@ -162,6 +162,12 @@ if a source string is not NUL-terminated. The safe replacement is strscpy(), > though care must be given to any cases where the return value of strlcpy() > is used, since strscpy() will return negative errno values when it truncates. > > +strlcat() > +--------- > +strlcat() must re-scan the destination string from the beginning on each > +call (O(n^2) behavior). Alternatives are seq_buf_puts(), seq_buf_printf(), > +snprintf() and scnprintf() The last two not only require the caller to keep track of the offset in the buffer, but also using "%s" when storing passed strings. I hope we won't see mindless conversions lacking the "%s", introducing new security issues: -strlcat(buf, s, size); +scnprintf(buf + off, size - off, s); > + > %p format specifier > ------------------- > Traditionally, using "%p" in format strings would lead to regular address Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds