mirror of
https://github.com/SELinuxProject/selinux
synced 2025-05-07 10:08:07 +00:00
libselinux/fuzz: readjust load_mmap() update
Update the fuzzers for the input number parameter addition. Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
e0f61d3b69
commit
d13d13eaee
@ -195,7 +195,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
rc = load_mmap(fp, fcontext_data1_len, &rec, MEMFD_FILE_NAME);
|
rc = load_mmap(fp, fcontext_data1_len, &rec, MEMFD_FILE_NAME, 0);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
assert(errno != 0);
|
assert(errno != 0);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -208,7 +208,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
rc = load_mmap(fp, fcontext_data2_len, &rec, MEMFD_FILE_NAME);
|
rc = load_mmap(fp, fcontext_data2_len, &rec, MEMFD_FILE_NAME, 1);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
assert(errno != 0);
|
assert(errno != 0);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -221,7 +221,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
rc = load_mmap(fp, fcontext_data3_len, &rec, MEMFD_FILE_NAME);
|
rc = load_mmap(fp, fcontext_data3_len, &rec, MEMFD_FILE_NAME, 2);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
assert(errno != 0);
|
assert(errno != 0);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -167,7 +167,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
rc = process_text_file(fp, /*prefix=*/ NULL, &rec, MEMFD_FILE_NAME);
|
rc = process_text_file(fp, /*prefix=*/ NULL, &rec, MEMFD_FILE_NAME, 0);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
assert(errno != 0);
|
assert(errno != 0);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -60,7 +60,7 @@ struct lookup_result {
|
|||||||
struct lookup_result *next;
|
struct lookup_result *next;
|
||||||
};
|
};
|
||||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||||
extern int load_mmap(FILE *fp, const size_t len, struct selabel_handle *rec, const char *path);
|
extern int load_mmap(FILE *fp, const size_t len, struct selabel_handle *rec, const char *path, uint8_t inputno);
|
||||||
extern int process_text_file(FILE *fp, const char *prefix, struct selabel_handle *rec, const char *path, uint8_t inputno);
|
extern int process_text_file(FILE *fp, const char *prefix, struct selabel_handle *rec, const char *path, uint8_t inputno);
|
||||||
extern void free_lookup_result(struct lookup_result *result);
|
extern void free_lookup_result(struct lookup_result *result);
|
||||||
extern struct lookup_result *lookup_all(struct selabel_handle *rec, const char *key, int type, bool partial, bool find_all, struct lookup_result *buf);
|
extern struct lookup_result *lookup_all(struct selabel_handle *rec, const char *key, int type, bool partial, bool find_all, struct lookup_result *buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user