Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1365717

Re: [PATCH v2 1/5] string_helpers: add kstrdup_quotable

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/5] string_helpers: add kstrdup_quotable
Date 2016-03-29 01:40 +0200
Message-ID <rhOVj-5VW-1@gated-at.bofh.it> (permalink)
References <rhMJQ-4ie-15@gated-at.bofh.it> <rhMJR-4ie-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 2016-03-28 at 14:14 -0700, Kees Cook wrote:
> Handle allocating and escaping a string safe for logging.
[]
> diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h
[]
> @@ -68,4 +68,6 @@ static inline int string_escape_str_any_np(const char *src, char *dst,
>  	return string_escape_str(src, dst, sz, ESCAPE_ANY_NP, only);
>  }
>  
> +char *kstrdup_quotable(char *src);

char *kstrdup_quotable(const char *src)

but shouldn't this really take a gfp_t like all
the other kstr<string> functions?

> diff --git a/lib/string_helpers.c b/lib/string_helpers.c
[]
> +char *kstrdup_quotable(char *src)
[]
> +	BUG_ON(string_escape_mem(src, slen, dst, dlen, flags, esc) != dlen);

BUG_ON?  why?

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/5] LSM: LoadPin for kernel file loading restrictions Kees Cook <keescook@chromium.org> - 2016-03-28 23:20 +0200
  [PATCH v2 3/5] string_helpers: add kstrdup_quotable_file Kees Cook <keescook@chromium.org> - 2016-03-28 23:20 +0200
  [PATCH v2 2/5] string_helpers: add kstrdup_quotable_cmdline Kees Cook <keescook@chromium.org> - 2016-03-28 23:20 +0200
    Re: [PATCH v2 2/5] string_helpers: add kstrdup_quotable_cmdline Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-03-30 13:10 +0200
      Re: [PATCH v2 2/5] string_helpers: add kstrdup_quotable_cmdline Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-03-30 13:20 +0200
  [PATCH v2 1/5] string_helpers: add kstrdup_quotable Kees Cook <keescook@chromium.org> - 2016-03-28 23:20 +0200
    Re: [PATCH v2 1/5] string_helpers: add kstrdup_quotable Joe Perches <joe@perches.com> - 2016-03-29 01:40 +0200

csiph-web