Thread (44 messages) 44 messages, 4 authors, 2022-09-02

Re: [PATCH bpf-next v9 02/23] bpf/verifier: do not clear meta in check_mem_size

From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Date: 2022-08-26 01:55:30
Also in: bpf, linux-doc, linux-kselftest, lkml, netdev

On Wed, 24 Aug 2022 at 15:41, Benjamin Tissoires
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
The purpose of this clear is to prevent meta->raw_mode to be evaluated
at true, but this also prevents to forward any other data to the other
callees.

Only switch back raw_mode to false so we don't entirely clear meta.

Acked-by: Yonghong Song <redacted>
Signed-off-by: Benjamin Tissoires <redacted>

---

no changes in v9

no changes in v8

no changes in v7

new in v6
---
 kernel/bpf/verifier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index d694f43ab911..13190487fb12 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -5287,7 +5287,7 @@ static int check_mem_size_reg(struct bpf_verifier_env *env,
                 * initialize all the memory that the helper could
                 * just partially fill up.
                 */
-               meta = NULL;
+               meta->raw_mode = false;
But this is adding a side effect, the caller's meta->raw_mode becomes
false, which the caller may not expect...
        if (reg->smin_value < 0) {
                verbose(env, "R%d min value is negative, either use unsigned or 'var &= const'\n",
--
2.36.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help