[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAHM1nT3ERh0MzLst2GLxOZkwD_4grZHXSaZOJrPiOFd13Gauyw@mail.gmail.com>
Date: Tue, 12 Feb 2019 15:05:22 -0800
From: IMBRIUS AGER <imbrius.ager@...il.com>
To: netdev@...r.kernel.org
Subject: Is it safe to modify the data directly instead of bpf helper function
in tc direct-action mode?
I tried the 3 line code:
__builtin_memcpy(skb, &ip->saddr, &src, sizeof(src);
__builtin_memcpy(skb, &ip->daddr, &dst, sizeof(dst);
ip->check = 0x12;
To my surprise, tc dit not reject the code in direct-action mode.
IIRC, since skb must stays uncloned, the verifier will detect all the
writes, which means we need to do the 'data + X > data_end' check
after each write.
Did I miss anything?
Best wishes
Powered by blists - more mailing lists