mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 14:25:52 +00:00
Revert broken 64bit capabilities patch
This commit is contained in:
@@ -610,7 +610,7 @@ int sd_serialize_profile(sd_serialize *p, struct codomain *profile,
|
||||
int flattened)
|
||||
{
|
||||
struct cod_entry *entry;
|
||||
uint64_t allowed_caps;
|
||||
u32 allowed_caps;
|
||||
|
||||
if (!sd_write_struct(p, "profile"))
|
||||
return 0;
|
||||
@@ -650,30 +650,14 @@ int sd_serialize_profile(sd_serialize *p, struct codomain *profile,
|
||||
return 0;
|
||||
if (!sd_write_structend(p))
|
||||
return 0;
|
||||
|
||||
#define low_caps(X) ((u32) (X))
|
||||
#define high_caps(X) ((u32) ((X) >> 32))
|
||||
allowed_caps = (profile->capabilities | profile->set_caps) & ~profile->deny_caps;
|
||||
if (!sd_write32(p, low_caps(allowed_caps & 0xff)))
|
||||
if (!sd_write32(p, allowed_caps))
|
||||
return 0;
|
||||
if (!sd_write32(p, low_caps(allowed_caps & profile->audit_caps)))
|
||||
if (!sd_write32(p, allowed_caps & profile->audit_caps))
|
||||
return 0;
|
||||
if (!sd_write32(p, low_caps(profile->deny_caps & profile->quiet_caps)))
|
||||
if (!sd_write32(p, profile->deny_caps & profile->quiet_caps))
|
||||
return 0;
|
||||
if (!sd_write32(p, low_caps(profile->set_caps & ~profile->deny_caps)))
|
||||
return 0;
|
||||
|
||||
if (!sd_write_struct(p, "caps64"))
|
||||
return 0;
|
||||
if (!sd_write32(p, high_caps(allowed_caps & 0xff)))
|
||||
return 0;
|
||||
if (!sd_write32(p, high_caps(allowed_caps & profile->audit_caps)))
|
||||
return 0;
|
||||
if (!sd_write32(p, high_caps(profile->deny_caps & profile->quiet_caps)))
|
||||
return 0;
|
||||
if (!sd_write32(p, high_caps(profile->set_caps & ~profile->deny_caps)))
|
||||
return 0;
|
||||
if (!sd_write_structend(p))
|
||||
if (!sd_write32(p, profile->set_caps & ~profile->deny_caps))
|
||||
return 0;
|
||||
|
||||
if (!sd_serialize_rlimits(p, &profile->rlimits))
|
||||
|
Reference in New Issue
Block a user