Skip to content

Commit f69abbd

Browse files
jrjohansenroxanan1996
authored andcommitted
UBUNTU: SAUCE: apparmor: fix notification header size
BugLink: https://bugs.launchpad.net/bugs/2040250 When strings are appended to the notification the header size should be updated to reflect the correct size. While the size is also directly returned as part of delivering the notification, the header should also be update to conform to specification and allow for verification. If verification is enabled and the notification contains appended strings then notifications fail verification and won't be delivered. Fixes: 9a3b87d ("UBUNTU: SAUCE: apparmor4.0.0 [64/76]: prompt - rework build to use append fn, to simplify adding strings") Signed-off-by: John Johansen <[email protected]> Acked-by: Tim Gardner <[email protected]> Acked-by: Stefan Bader <[email protected]> Signed-off-by: Roxana Nicolescu <[email protected]>
1 parent 3e8ce5d commit f69abbd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

security/apparmor/notify.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,9 @@ static long build_v3_unotif(struct aa_knotif *knotif, void __user *buf,
975975
if (!build_append_str(buf, pos, max_size, knotif->ad->name,
976976
unotif.file.name, size))
977977
return size;
978+
979+
/* set size after appending strings */
980+
unotif.common.len = size;
978981
/* now the struct, at the start of user mem */
979982
if (copy_to_user(buf, &unotif, sizeof(unotif)))
980983
return -EFAULT;

0 commit comments

Comments
 (0)