[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <nycvar.YSQ.7.76.1802201125210.31644@knanqh.ubzr>
Date: Tue, 20 Feb 2018 11:26:28 -0500 (EST)
From: Nicolas Pitre <nicolas.pitre@...aro.org>
To: Richard Weinberger <richard@....at>
cc: Masahiro Yamada <yamada.masahiro@...ionext.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kate Stewart <kstewart@...uxfoundation.org>,
Nicholas Piggin <npiggin@...il.com>,
Kees Cook <keescook@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>, david@...ma-star.at,
kbuild-all@...org, Sam Ravnborg <sam@...nborg.org>,
Arnaud Lacombe <lacombar@...il.com>,
Nick Bowler <nbowler@...iptictech.com>,
Michal Marek <mmarek@...e.cz>,
Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [PATCH v2] kbuild: Don't source kernel config
On Tue, 20 Feb 2018, Richard Weinberger wrote:
> An alternate approach would be this:
> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index 5c12dc91ef34..ff0a7c62344b 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -161,6 +161,13 @@ static int conf_set_sym_val(struct symbol *sym, int def,
> int def_flags, char *p)
> case S_STRING:
> if (*p++ != '"')
> break;
> +
> + p2 = strpbrk(p, "`$");
> + if (p2 && !(p2[0] == '$' && p2[1] != '(')) {
> + conf_warning("string contains forbidden characters");
> + return 1;
> + }
> +
> for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {
> if (*p2 == '"') {
> *p2 = 0;
>
> That way the conf tool will sanitize the .config before shell scripts will
> source it.
Looks like a much saner approach to me indeed.
Nicolas
Powered by blists - more mailing lists