Skip to content

eBPF-based security platform

upatches: list the kernel-obs DNS parser gaps in its README

Daniel Borkmanna71b2a7805aa
diff --git a/Documentation/developer-guide.rst b/Documentation/developer-guide.rst
index 94ee34b9..c8fcdfdb 100644
--- a/Documentation/developer-guide.rst
+++ b/Documentation/developer-guide.rst
@@ -224,8 +224,6 @@ software TPM on the host for development without a VM.
Cases no test covers yet, for whoever adds the next tamperproof test:
-* creating a BPF map from an executable other than shirudo's, beside the
- loader's own creation as the positive control;
* obtaining or passing shirudo's map descriptors through
``/proc/<pid>/fd``, ``pidfd_getfd`` or ``SCM_RIGHTS``, and using one to
change a protected map;
@@ -245,16 +243,3 @@ every resource, scope and metric attribute of the OTLP payload; export
failure and drain across timer intervals; S3 with ``AWS_CA_BUNDLE``; and
the bounds of transport timeouts, response buffers and compression.
``upatch get`` is checked for the loaded source, not its JSON form.
-
-The kernel-obs DNS parser correlates a UDP response with its request by the
-network namespace, addresses, ports and transaction ID. It does not yet
-compare the response's question name and class with the request's, check
-its opcode, RCODE and TC bits, keep A and AAAA answers to the family asked
-for, or age out pending requests; it does not reject fragments, check the
-IP and UDP lengths against the packet or walk IPv6 extension headers; it
-lets an embedded NUL through in a label and does not bound every
-compression pointer it skips; and it counts neither a full pending table,
-LRU displacement, stale responses nor answers past its cap of 75. A live
-packet harness would let the target tests cover malformed packets, which
-``end2end/dns_obs_matrix.py`` today only constructs. DNS over TCP, TLS or
-HTTPS and ports other than 53 are outside its scope.
diff --git a/upatches/kernel-obs/README.md b/upatches/kernel-obs/README.md
index e29569a2..74ee43de 100644
--- a/upatches/kernel-obs/README.md
+++ b/upatches/kernel-obs/README.md
@@ -153,6 +153,28 @@ from the exporter.
## Limits
DNS over TCP, TLS and HTTPS is not parsed; the resolvers are on the
-watch list instead. IPv6 extension headers are not walked. Forwarded
-traffic does not pass the cgroup hooks and is not counted. shirudo's
-developer guide lists the remaining DNS parser gaps.
+watch list instead, and DNS on ports other than 53 is not looked at.
+IPv6 extension headers are not walked. Forwarded traffic does not pass
+the cgroup hooks and is not counted.
+
+## Open work
+
+The DNS parser correlates a UDP response with its request by network
+namespace, addresses, ports and transaction ID. It does not yet:
+
+- [ ] compare the response's question name, case-insensitively, and its
+ class with the request's;
+- [ ] check the response's opcode, RCODE and TC bits, and decide whether a
+ truncated response yields no record or a partial one;
+- [ ] keep A answers to A queries and AAAA answers to AAAA queries;
+- [ ] age out pending requests, so a late response cannot match a later
+ reuse of the same flow and ID;
+- [ ] reject IP fragments, check the IP and UDP lengths against the packet
+ and hold the 1232-byte parsing budget on the packet itself;
+- [ ] walk IPv6 extension headers, or reject packets that carry one;
+- [ ] reject an embedded NUL in a label and bound every compression
+ pointer it skips, against loops and out-of-packet targets;
+- [ ] count a full pending table, LRU displacement, stale responses and
+ answers past its cap of 75, instead of dropping them silently;
+- [ ] cover malformed packets on the target, which needs a live packet
+ harness; `dns_obs_matrix.py` in shirudo's tests only builds them.