]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
seccomp: drop misleading argument name inherited from the OCI spec
authorFelix Abecassis <fabecassis@nvidia.com>
Fri, 1 Jun 2018 23:01:22 +0000 (16:01 -0700)
committerFelix Abecassis <fabecassis@nvidia.com>
Fri, 1 Jun 2018 23:02:17 +0000 (16:02 -0700)
The last (optional) argument was named "valueTwo", which seems to
originate from the OCI runtime spec:
https://github.com/opencontainers/runtime-spec/blob/master/config-linux.md#seccomp

In proper seccomp terminology, "value" is "datum_a" and "valueTwo" is "datum_b".

However, LXC's "valueTwo" was used as the mask for SCMP_CMP_MASKED_EQ,
while the mask is supposed to be "datum_a".

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
src/lxc/seccomp.c

index e32c23b43d764674d62b4f422dcf7107265b5458..4ea3c2a7cae040bb793fb89e6cfc98d669d9ba4d 100644 (file)
@@ -184,14 +184,14 @@ static enum scmp_compare parse_v2_rule_op(char *s)
 
 /*
  * This function is used to parse the args string into the structure.
- * args string format:[index,value,op,valueTwo] or [index,value,op]
+ * args string format:[index,value,op,mask] or [index,value,op]
  * index: the index for syscall arguments (type uint)
  * value: the value for syscall arguments (type uint64)
  * op: the operator for syscall arguments(string),
         a valid list of constants as of libseccomp v2.3.2 is
         SCMP_CMP_NE,SCMP_CMP_LE,SCMP_CMP_LE, SCMP_CMP_EQ, SCMP_CMP_GE,
         SCMP_CMP_GT, SCMP_CMP_MASKED_EQ, or !=,<=,==,>=,>,&=
- * valueTwo: the value for syscall arguments only used for mask eq (type uint64, optional)
+ * mask: the mask to apply on "value" for SCMP_CMP_MASKED_EQ (type uint64, optional)
  * Returns 0 on success, < 0 otherwise.
  */
 static int get_seccomp_arg_value(char *key, struct seccomp_v2_rule_args *rule_args)