v5: allow storing data within program

currently these checks are only done by LDDW/STDW,
but in the future we want to be able to carry payload bytes
via the jmpdata instruction in the program region.

Correct programs will not be affected, garbage programs
are garbage anyway... and the interpreter must be able
to protect against that either way...

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9299d544602a7f009202f173cb4719f8d93747bb
diff --git a/v5/apf_interpreter.c b/v5/apf_interpreter.c
index 11a6f1c..5924643 100644
--- a/v5/apf_interpreter.c
+++ b/v5/apf_interpreter.c
@@ -640,7 +640,6 @@
 #define IN_DATA_BOUNDS(p, size) (ENFORCE_UNSIGNED(p) && \
                                  ENFORCE_UNSIGNED(size) && \
                                  (p) + (size) <= ram_len && \
-                                 (p) >= program_len && \
                                  (p) + (size) >= (p))  /* catch wraparounds */
 /* Accept packet if not within ram bounds */
 #define ASSERT_IN_RAM_BOUNDS(p) ASSERT_RETURN(IN_RAM_BOUNDS(p))
diff --git a/v5/apf_interpreter_source.c b/v5/apf_interpreter_source.c
index cd799c5..d377359 100644
--- a/v5/apf_interpreter_source.c
+++ b/v5/apf_interpreter_source.c
@@ -66,7 +66,6 @@
 #define IN_DATA_BOUNDS(p, size) (ENFORCE_UNSIGNED(p) && \
                                  ENFORCE_UNSIGNED(size) && \
                                  (p) + (size) <= ram_len && \
-                                 (p) >= program_len && \
                                  (p) + (size) >= (p))  // catch wraparounds
 // Accept packet if not within ram bounds
 #define ASSERT_IN_RAM_BOUNDS(p) ASSERT_RETURN(IN_RAM_BOUNDS(p))