Logo
Explore Help
Register Sign In
leandrof/linux
1
0
Fork 0
You've already forked linux
Code Issues Pull Requests Packages Projects Releases Wiki Activity
Files
25966e893143f1cf9b1294bc6e33e3a6b51ed2ad
linux/drivers/firmware/efi/libstub/skip_spaces.c

12 lines
180 B
C
Raw Normal View History

efi/libstub: Clean up command line parsing routine We currently parse the command non-destructively, to avoid having to allocate memory for a copy before passing it to the standard parsing routines that are used by the core kernel, and which modify the input to delineate the parsed tokens with NUL characters. Instead, we call strstr() and strncmp() to go over the input multiple times, and match prefixes rather than tokens, which implies that we would match, e.g., 'nokaslrfoo' in the stub and disable KASLR, while the kernel would disregard the option and run with KASLR enabled. In order to avoid having to reason about whether and how this behavior may be abused, let's clean up the parsing routines, and rebuild them on top of the existing helpers. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2020-02-10 17:02:46 +01:00
// SPDX-License-Identifier: GPL-2.0
#include <linux/ctype.h>
#include <linux/types.h>
char *skip_spaces(const char *str)
{
while (isspace(*str))
++str;
return (char *)str;
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.1 Page: 480ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API