1

我读过优先级可以是 0 到 255 之间的值(http://man7.org/linux/man-pages/man3/seccomp_syscall_priority.3.html)。为什么使用 seccomp_export_pfc 的基线优先级是 65535???

 # filter for syscall "exit_group" (231) [priority: 65535]
  if ($syscall == 231)
    action ALLOW;
  # filter for syscall "exit" (60) [priority: 65535]
  if ($syscall == 60)
    action ALLOW;
4

1 回答 1

1

它们是两个不同的东西:使用seccomp_syscall_priority,您提供优先级提示,而seccomp_export_pfc输出libseccomp 的内部优先级

源代码注释中所述,内部优先级包含您的优先级提示(如果有)作为前 16 位。最后 16 位在 tie 的情况下很有用(即,两个过滤器具有相同的高 16 位),在这种情况下,libseccomp 为更容易评估的过滤器提供更高的优先级。

因此,在您的情况下,由于您没有提供任何提示,因此内部优先级等于0x0000FFFF或 65535。

于 2019-08-13T16:33:09.537 回答