mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
bpf/verifier: track signed and unsigned min/max values
Allows us to, sometimes, combine information from a signed check of one bound and an unsigned check of the other. We now track the full range of possible values, rather than restricting ourselves to [0, 1<<30) and considering anything beyond that as unknown. While this is probably not necessary, it makes the code more straightforward and symmetrical between signed and unsigned bounds. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f1174f77b5
commit
b03c9f9fdc
4 changed files with 461 additions and 317 deletions
|
@ -17,6 +17,8 @@ struct tnum {
|
|||
struct tnum tnum_const(u64 value);
|
||||
/* A completely unknown value */
|
||||
extern const struct tnum tnum_unknown;
|
||||
/* A value that's unknown except that @min <= value <= @max */
|
||||
struct tnum tnum_range(u64 min, u64 max);
|
||||
|
||||
/* Arithmetic and logical ops */
|
||||
/* Shift a tnum left (by a fixed shift) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue