twtiger / gosecco

Go seccomp parser and compiler
GNU Lesser General Public License v3.0
53 stars 7 forks source link

Inclusion expressions should handle other expressions #30

Closed chelseakomlo closed 8 years ago

chelseakomlo commented 8 years ago

I believe the types of expressions we should support are:

5 IN [(2 + arg0.low), (3 - arg1.hi)]

(arg0.low + 4) IN [3, 4, 5]

(arg0.low * 2) IN [(arg3.low * 2), (arg4 \ 2)]

chelseakomlo commented 8 years ago

Should also support binary negation expressions

chelseakomlo commented 8 years ago

Specifically, we shouldn't need to handle expressions that reduce to Booleans.

Furthermore, if an expression is on either side of the inclusion expression, the comparison will only be on 32 bits, as opposed to this case: arg0 IN [arg1, arg2, 93]

olabini commented 8 years ago

It should handle any kind of expression.

olabini commented 8 years ago

And not dealing with 64 bit is not acceptable either, since arg0 IN [1,2,3] needs to work

chelseakomlo commented 8 years ago

Right now, we handle arguments, numeric literals, and arithmetic expressions. I'm not sure why it should be able to handle boolean expressions, as this should reduce to a comparison expression, no?

For arguments to numeric literal comparisons, we compare against 64 bits. However, if we compare a numeric literal or an argument to an expression, we can only compare 32 bits (as our arithmetic expressions only work on 32 bits).

olabini commented 8 years ago

Please just ignore this for the weekend. There seems to be a lot of confusion.