Skip to content

Instantly share code, notes, and snippets.

View Kadalis's full-sized avatar
💭
¯\_(ツ)_/¯

Kadalis

💭
¯\_(ツ)_/¯
  • Russia
View GitHub Profile
@Kadalis
Kadalis / ksu_fix_op_not_permitted.patch
Last active August 1, 2023 17:57
dirty fix for dbus capabilities drop "Operation not permitted" error. IDK why zeroing ambient capabilities helps, same as I don't know what else does it affect.
diff --git a/kernel/core_hook.c b/kernel/core_hook.c
index 83413b47..70f7cdf7 100644
--- a/kernel/core_hook.c
+++ b/kernel/core_hook.c
@@ -134,6 +134,10 @@ void escape_to_root(void)
memcpy(&cred->cap_ambient, &profile->capabilities.effective,
sizeof(cred->cap_ambient));
+ // set ambient caps to all-zero
+ // fixes "operation not permitted" on dbus cap dropping