From 07522f013fe6e6aaad28c40247f11e6409477f64 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 13 Dec 2024 15:17:06 +0100 Subject: pkg/declextract: change auto_todo type to int8 We use auto_todo type as an element of array for void*. array[int8] is lowered to the buffer type, which is much better handled by the fuzzer engine + closer resembles real blobs. --- tools/syz-declextract/clangtool/output.h | 3 +-- tools/syz-declextract/testdata/file_operations.c.txt | 2 +- tools/syz-declextract/testdata/functions.c.txt | 2 +- tools/syz-declextract/testdata/io_uring.c.txt | 2 +- tools/syz-declextract/testdata/netlink.c.txt | 2 +- tools/syz-declextract/testdata/syscall.c.txt | 2 +- tools/syz-declextract/testdata/types.c.json | 2 +- tools/syz-declextract/testdata/types.c.txt | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/syz-declextract/clangtool/output.h b/tools/syz-declextract/clangtool/output.h index d09881aee..eea86afa2 100644 --- a/tools/syz-declextract/clangtool/output.h +++ b/tools/syz-declextract/clangtool/output.h @@ -298,8 +298,7 @@ inline void print(JSONPrinter& Printer, const NetlinkPolicy& V) { // This type is used when we can't figure out the right type, but need some type to use. inline FieldType TodoType() { return IntType{ - // TODO: use size 1, then arrays will be lowered to buffers. - .ByteSize = 8, + .ByteSize = 1, .Name = "TODO", .Base = "long", }; diff --git a/tools/syz-declextract/testdata/file_operations.c.txt b/tools/syz-declextract/testdata/file_operations.c.txt index e812350a3..f2a0455bc 100644 --- a/tools/syz-declextract/testdata/file_operations.c.txt +++ b/tools/syz-declextract/testdata/file_operations.c.txt @@ -2,7 +2,7 @@ meta automatic -type auto_todo intptr +type auto_todo int8 include include diff --git a/tools/syz-declextract/testdata/functions.c.txt b/tools/syz-declextract/testdata/functions.c.txt index 998d5fb72..cab813f8b 100644 --- a/tools/syz-declextract/testdata/functions.c.txt +++ b/tools/syz-declextract/testdata/functions.c.txt @@ -2,7 +2,7 @@ meta automatic -type auto_todo intptr +type auto_todo int8 include include diff --git a/tools/syz-declextract/testdata/io_uring.c.txt b/tools/syz-declextract/testdata/io_uring.c.txt index 3ddbbcf40..77183198f 100644 --- a/tools/syz-declextract/testdata/io_uring.c.txt +++ b/tools/syz-declextract/testdata/io_uring.c.txt @@ -2,7 +2,7 @@ meta automatic -type auto_todo intptr +type auto_todo int8 include include diff --git a/tools/syz-declextract/testdata/netlink.c.txt b/tools/syz-declextract/testdata/netlink.c.txt index f4042d816..e61244406 100644 --- a/tools/syz-declextract/testdata/netlink.c.txt +++ b/tools/syz-declextract/testdata/netlink.c.txt @@ -2,7 +2,7 @@ meta automatic -type auto_todo intptr +type auto_todo int8 include include diff --git a/tools/syz-declextract/testdata/syscall.c.txt b/tools/syz-declextract/testdata/syscall.c.txt index b55b077c3..de87f1866 100644 --- a/tools/syz-declextract/testdata/syscall.c.txt +++ b/tools/syz-declextract/testdata/syscall.c.txt @@ -2,7 +2,7 @@ meta automatic -type auto_todo intptr +type auto_todo int8 include include diff --git a/tools/syz-declextract/testdata/types.c.json b/tools/syz-declextract/testdata/types.c.json index 944346502..9733798ab 100644 --- a/tools/syz-declextract/testdata/types.c.json +++ b/tools/syz-declextract/testdata/types.c.json @@ -79,7 +79,7 @@ "ptr": { "elem": { "int": { - "byte_size": 8, + "byte_size": 1, "name": "TODO", "base": "long" } diff --git a/tools/syz-declextract/testdata/types.c.txt b/tools/syz-declextract/testdata/types.c.txt index 88da34315..45d451d8a 100644 --- a/tools/syz-declextract/testdata/types.c.txt +++ b/tools/syz-declextract/testdata/types.c.txt @@ -2,7 +2,7 @@ meta automatic -type auto_todo intptr +type auto_todo int8 include include -- cgit mrf-deployment