Repository: kubernetes
Issue: kubelet read wrong cgroup mountpoint while startup, would always kill pods while the cgoup mountpoint disappears
Labels: kind/bug,priority/backlog,sig/node,triage/accepted

### What happened?

1. the minion installed kaspersky(kesl.service)
2.  the kaspersky would add a cpu cgoup mountpoint after  /sys/fs/cgroup/cpu
```
25 18 0:20 / /sys/fs/cgroup ro,nosuid,nodev,noexec shared:8 - tmpfs tmpfs ro,mode=755
26 25 0:21 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime shared:9 - cgroup cgroup rw,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd
27 18 0:22 / /sys/fs/pstore rw,nosuid,nodev,noexec,relatime shared:20 - pstore pstore rw
28 25 0:23 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime shared:10 - cgroup cgroup rw,blkio
29 25 0:24 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:11 - cgroup cgroup rw,cpuset
30 25 0:25 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime shared:12 - cgroup cgroup rw,devices
31 25 0:26 / /sys/fs/cgroup/perf_event rw,nosuid,nodev,noexec,relatime shared:13 - cgroup cgroup rw,perf_event
32 25 0:27 / /sys/fs/cgroup/hugetlb rw,nosuid,nodev,noexec,relatime shared:14 - cgroup cgroup rw,hugetlb
33 25 0:28 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:15 - cgroup cgroup rw,cpuacct,cpu
34 25 0:29 / /sys/fs/cgroup/net_cls,net_prio rw,nosuid,nodev,noexec,relatime shared:16 - cgroup cgroup rw,net_prio,net_cls
35 25 0:30 / /sys/fs/cgroup/pids rw,nosuid,nodev,noexec,relatime shared:17 - cgroup cgroup rw,pids
36 25 0:31 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime shared:18 - cgroup cgroup rw,freezer
37 25 0:32 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:19 - cgroup cgroup rw,memory
248 24 0:28 / /run/cgroups/cpu rw,relatime shared:38 - cgroup none rw,cpuacct,cpu
```
3. the kubelet startup, would read the /run/cgroups/cpu as the cpu cgroup root path, as it's shorter than  /sys/fs/cgroup/cpu, introduced by this pr(https://github.com/kubernetes/kubernetes/pull/96594)

![CjYS1WaHPo-AWvp6AACy5LvHEkU080](https://github.com/kubernetes/kubernetes/assets/18046309/eaa9d717-59b5-4719-9950-918f3a66f2e3)

4. then if stop the kesl service,   the /run/cgroups/cpu mountpoint would be umounted and disappeared
5.  the kubelet would always kill pods when syncing pod and check cgroup not exists
![2024-07-08_112118](https://github.com/kubernetes/kubernetes/assets/18046309/8ae32fc8-b1bc-4629-9481-d601d64985a4)


### What did you expect to happen?

kubelet should prioritize using the subsystem cgroups read first, unless the lastest one is the prefix of the previous,  we should not always read the shortest as the sys/fs/cgroup should be correct generally 

### How can we reproduce it (as minimally and precisely as possible)?

see what happened

### Anything else we need to know?

_No response_

### Kubernetes version

<details>

```console
$ kubectl version
# paste output here
```
kubernetes v1.28.11
</details>


### Cloud provider

<details>

</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```

</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>