Skip to content
  • Daniel P. Berrangé's avatar
    9a1565a0
    seccomp: don't kill process for resource control syscalls · 9a1565a0
    Daniel P. Berrangé authored
    
    
    The Mesa library tries to set process affinity on some of its threads in
    order to optimize its performance. Currently this results in QEMU being
    immediately terminated when seccomp is enabled.
    
    Mesa doesn't consider failure of the process affinity settings to be
    fatal to its operation, but our seccomp policy gives it no choice in
    gracefully handling this denial.
    
    It is reasonable to consider that malicious code using the resource
    control syscalls to be a less serious attack than if they were trying
    to spawn processes or change UIDs and other such things. Generally
    speaking changing the resource control setting will "merely" affect
    quality of service of processes on the host. With this in mind, rather
    than kill the process, we can relax the policy for these syscalls to
    return the EPERM errno value. This allows callers to detect that QEMU
    does not want them to change resource allocations, and apply some
    reasonable fallback logic.
    
    The main downside to this is for code which uses these syscalls but does
    not check the return value, blindly assuming they will always
    succeeed. Returning an errno could result in sub-optimal behaviour.
    Arguably though such code is already broken & needs fixing regardless.
    
    Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Signed-off-by: default avatarEduardo Otubo <otubo@redhat.com>
    9a1565a0
    seccomp: don't kill process for resource control syscalls
    Daniel P. Berrangé authored
    
    
    The Mesa library tries to set process affinity on some of its threads in
    order to optimize its performance. Currently this results in QEMU being
    immediately terminated when seccomp is enabled.
    
    Mesa doesn't consider failure of the process affinity settings to be
    fatal to its operation, but our seccomp policy gives it no choice in
    gracefully handling this denial.
    
    It is reasonable to consider that malicious code using the resource
    control syscalls to be a less serious attack than if they were trying
    to spawn processes or change UIDs and other such things. Generally
    speaking changing the resource control setting will "merely" affect
    quality of service of processes on the host. With this in mind, rather
    than kill the process, we can relax the policy for these syscalls to
    return the EPERM errno value. This allows callers to detect that QEMU
    does not want them to change resource allocations, and apply some
    reasonable fallback logic.
    
    The main downside to this is for code which uses these syscalls but does
    not check the return value, blindly assuming they will always
    succeeed. Returning an errno could result in sub-optimal behaviour.
    Arguably though such code is already broken & needs fixing regardless.
    
    Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Signed-off-by: default avatarEduardo Otubo <otubo@redhat.com>
Loading