mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Muhammad Bilal <meatuni001@gmail.com>,
	Kees Cook <kees@kernel.org>,  Andy Shevchenko <andy@kernel.org>,
	linux-hardening@vger.kernel.org,
	 LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] lib/string_helpers: add ESCAPE_BACKSLASH flag to string_escape_mem()
Date: Mon, 28 Sep 2026 15:59:51 +0300 (EEST)	[thread overview]
Message-ID: <a2687bd9-8cf7-1d08-41fc-9d6e69b5ca17@linux.intel.com> (raw)
In-Reply-To: <CAHp75Vdj8qVY-hCoCxxd1Pg2JaaDjc+QgAK-G=w+Cb=FTYYJEQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]

On Mon, 28 Sep 2026, Andy Shevchenko wrote:

> On Sat, Sep 26, 2026 at 11:57 PM Muhammad Bilal <meatuni001@gmail.com> wrote:
> >
> > ESCAPE_SPECIAL escapes '\\', '\a', '\e' and '"' as one group. A caller
> > that wants '\\' escaped but needs '"' left untouched, because it has
> > its own handling for quotes or because quoting is not meaningful in
> > its output, currently has no way to pull just the backslash case out
> > of that set.
> >
> > Add ESCAPE_BACKSLASH, which escapes only '\\'. It can be combined with
> > ESCAPE_SPACE, or used on its own, without pulling in ESCAPE_SPECIAL's
> > quote and control-character handling.
> 
> But why? I believe it can be done in the current implementation using
> the last argument @only (id est use the list of the characters you
> want to escape).

Ah, that's my fault for suggesting this and not noticing there was way to 
negatively filter them.

> > This only adds a new opt-in flag; no existing caller changes
> > behavior.
> 
> No test cases --> automatically NAK.
> 
> ...
> 
> Also you missed printk() update and respective documentation.
> 
> 

-- 
 i.

  parent reply	other threads:[~2026-09-28 12:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26 20:56 Muhammad Bilal
2026-09-26 20:56 ` [PATCH 2/2] platform/x86: hp-bioscfg: fix heap OOB read and non-ASCII truncation in hp_get_string_from_buffer() Muhammad Bilal
2026-09-28 11:32   ` Ilpo Järvinen
2026-09-28  8:11 ` [PATCH 1/2] lib/string_helpers: add ESCAPE_BACKSLASH flag to string_escape_mem() Andy Shevchenko
2026-09-28  8:17   ` Andy Shevchenko
2026-09-28 12:59   ` Ilpo Järvinen [this message]
2026-09-28 13:38     ` Andy Shevchenko
2026-09-28 20:08       ` Muhammad Bilal

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=a2687bd9-8cf7-1d08-41fc-9d6e69b5ca17@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meatuni001@gmail.com \
    /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

all inboxes | Powered by JetHome®