core: only allow systemd-oomd to use SubscribeManagedOOMCGroups
Attempt to address https://github.com/systemd/systemd/issues/20330#issuecomment-1210028422. Summary of the comment: Unprivileged users can potentially cause a denial of service during systemd-oomd unit subscriptions by spamming requests to SubscribeManagedOOMCGroups. As systemd-oomd.service is the only unit that should be accessing this method, add a check on the caller's unit name to deter them from successfully using this method.
This commit is contained in:
@@ -173,3 +173,4 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(VarlinkServer *, varlink_server_unref);
|
||||
#define VARLINK_ERROR_METHOD_NOT_IMPLEMENTED "org.varlink.service.MethodNotImplemented"
|
||||
#define VARLINK_ERROR_INVALID_PARAMETER "org.varlink.service.InvalidParameter"
|
||||
#define VARLINK_ERROR_SUBSCRIPTION_TAKEN "org.varlink.service.SubscriptionTaken"
|
||||
#define VARLINK_ERROR_PERMISSION_DENIED "org.varlink.service.PermissionDenied"
|
||||
|
||||
Reference in New Issue
Block a user