Skip to content

uniqMcs use 100% cpu #247

@ningmingxiao

Description

@ningmingxiao

I find when create many selinux labels will cause uniqMcs use 100% cpu when try create more than 1024*(1024-1)/2=523776 labels.

for example
set DefaultCategoryRange = uint32(10) at github.com/opencontainers/selinux/go-selinux/selinux.go make it easier to happen.

package main

import (
	"fmt"

	"github.com/opencontainers/selinux/go-selinux"
)

func main() {
	for i := 0; i <1000; i++ {
		selinux.ContainerLabels()
		fmt.Printf("times %d \n",i)
	}
	fmt.Println("done")
}

can this bug assign a cve? the func never return and use 100 % cpu @kolyshkin @cyphar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions