Extended Berkeley Packet Filter(BPF)is an in-kernel, register-based virtual machine in the Linux operating system that allows non-superusers to execute code at specific points within the Linux kernel. To ensure that such user code is safe within the kernel, BPF relies on an in-kernel static analyzer that proves properties such as bounded memory access and the absence of illegal operations. This static analyzer uses an abstract domain, which it calls tnums (tristate numbers), to over-approximate the set of values that a variable may store. This abstract domain is implemented efficiently with bitwise and arithmetic operations. This paper formalizes the semantics and various properties of tnums and provides the first proofs of soundness and precision of arithmetic and logical operations with tnums. We describe a novel sound algorithm for multiplying two tnums that is more precise and efficient (runs 55% faster on average) than the Linux kernel's tnum multiplication.
翻译:伯克利扩展包件过滤器( BPF) 是 Linux 操作系统中的一个内核、 注册的虚拟机器, 它允许非超级用户在 Linux 内核的特定点执行代码。 为确保这些用户代码在内核内的安全, BPF 依赖于一个内核静态分析器, 以证明内核内核内核内核内存存访问和没有非法操作等属性。 这个静态分析器使用一个抽象域, 它叫做 tnums( 三角数), 以超近变量可能存储的一组值。 这个抽象域以比特和算操作有效执行。 此文件将语句的语义和各种属性正式化, 并提供数学和逻辑操作的音精度和精度的初步证据 。 我们描述比 Linux 内核内核的倍增精度更精确、更高效( 平均速度为 55% ) 的新声音算法 。