diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-11-15 13:16:17 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-11-18 09:29:33 +0000 |
| commit | 8ab4d809712bd2ff7c64a53c7f444005090ea595 (patch) | |
| tree | 4bc48f332ce2720ff04de48f4c2475fe887c77fa /tools | |
| parent | 7ddf5ede47abe686371bbd99e8f712213895e4e0 (diff) | |
tools/syz-declextract: don't generate NLA_REJECT/TYPE_MAX attrs
These are not accepted as inputs (NLA_REJECT is usually used in dump operation).
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/syz-declextract/syz-declextract.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/syz-declextract/syz-declextract.cpp b/tools/syz-declextract/syz-declextract.cpp index 370102ef4..14d444944 100644 --- a/tools/syz-declextract/syz-declextract.cpp +++ b/tools/syz-declextract/syz-declextract.cpp @@ -701,7 +701,7 @@ private: if (type == "BITFIELD32") { // TODO:Extract valued values from NLA_POLICY_BITFIELD32 macro. return "int32"; } - if (type == "UNSPEC" || type == "NESTED" || type == "NESTED_ARRAY" || type == "REJECT" || type == "TYPE_MAX") { + if (type == "UNSPEC" || type == "NESTED" || type == "NESTED_ARRAY") { return nlaArraySubtype(name, type, len, typeOfLen); } fprintf(stderr, "Unsupported netlink type %s\n", type.c_str()); @@ -804,6 +804,9 @@ private: Expr::EvalResult evalResult; fields[i][0]->EvaluateAsConstantExpr(evalResult, *context); // This contains the NLA Enum type const auto &nlaEnum = u8ToNlaEnum[evalResult.Val.getInt().getZExtValue()]; + if (nlaEnum == "REJECT") { + continue; + } auto [structDecl, len] = getNetlinkStruct(fields[i][2]->IgnoreCasts(), context); std::string netlinkStruct; if (!structDecl) { |
