Commit df387a1
kernel: kp_ksud: add security_bounded_transition hook for < 4.14 (tiann#1704)
- torvalds/linux@af63f41
- SELinux domain transitions under NNP/nosuid environment was introduced in 4.14 by
the above commit, for older kernels, we need to make sure our domain transitions
are allowed when calling ksud at boot from the init
- Adapted from tiann#270 (comment)
tiann@0950fbb
- tiann#1704
tiann@d664fe3
Difference to tiann's version:
- use a kretprobe to force a 0 return
- grab sids outside of kprobe context to avoid stuckups / hangups
Logs:
daisy:/ # dmesg | grep -E "transition|grab_sids"
[ 5.977810] KernelSU: ksud_grab_sids: got init sid: 62
[ 5.977907] KernelSU: ksud_grab_sids: got su sid: 537
[ 5.980497] KernelSU: kp_ksud: register kretprobe: security_bounded_transition ret: 0
[ 32.008560] KernelSU: kp_ksud: security_bounded_transition: allowing init (62) -> su (537)
[ 32.008663] type=1401 audit(2247197.199:61): op=security_bounded_transition seresult=denied oldcontext=u:r:init:s0 newcontext=u:r:su:s0
[ 36.946527] KernelSU: kp_ksud: security_bounded_transition: allowing init (62) -> su (537)
[ 61.202278] KernelSU: kp_ksud: security_bounded_transition: allowing init (62) -> su (537)
[ 61.202395] type=1401 audit(1761288080.219:1045): op=security_bounded_transition seresult=denied oldcontext=u:r:init:s0 newcontext=u:r:su:s0
daisy:/ # uname -a
Linux localhost 4.9.337+64-daikura/db23b17 tiann#634 SMP PREEMPT Fri Oct 24 14:37:19 PST 2025 aarch64 Toybox
Signed-off-by: backslashxx <[email protected]>1 parent a46ffe4 commit df387a1
2 files changed
+97
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
201 | 287 | | |
202 | 288 | | |
203 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
| |||
208 | 213 | | |
209 | 214 | | |
210 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
211 | 222 | | |
212 | 223 | | |
213 | 224 | | |
| |||
0 commit comments