mirror of
https://github.com/torvalds/linux.git
synced 2026-05-01 13:02:35 -04:00
perf tests: Use scandirat for shell script finding
Avoid filename appending buffers by using openat, faccessat and scandirat more widely. Turn the script's path back to a file name using readlink from /proc/<pid>/fd/<fd>. Read the script's description using api/io.h to avoid fdopen conversions. Whilst reading perform additional sanity checks on the script's contents. Signed-off-by: Ian Rogers <irogers@google.com> Cc: James Clark <james.clark@arm.com> Cc: Justin Stitt <justinstitt@google.com> Cc: Bill Wendling <morbo@google.com> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Yang Jihong <yangjihong1@huawei.com> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com> Cc: llvm@lists.linux.dev Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20240221034155.1500118-7-irogers@google.com
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#define TESTS_SCRIPTS_H
|
||||
|
||||
struct script_file {
|
||||
char *dir;
|
||||
char *file;
|
||||
char *desc;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user