Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

apparmor: guard against free routines being called with a NULL

aa_free_data() and free_attachment() don't guard against having
a NULL parameter passed to them. Fix this.

Reviewed-by: Ryan Lee <ryan.lee@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>

+6
+6
security/apparmor/policy.c
··· 232 232 { 233 233 struct aa_data *data = ptr; 234 234 235 + if (!ptr) 236 + return; 237 + 235 238 kvfree_sensitive(data->data, data->size); 236 239 kfree_sensitive(data->key); 237 240 kfree_sensitive(data); ··· 243 240 static void free_attachment(struct aa_attachment *attach) 244 241 { 245 242 int i; 243 + 244 + if (!attach) 245 + return; 246 246 247 247 for (i = 0; i < attach->xattr_count; i++) 248 248 kfree_sensitive(attach->xattrs[i]);