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

Merge tag 'selinux-pr-20220203' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux

Pull selinux fix from Paul Moore:
"One small SELinux patch to ensure that a policy structure field is
properly reset after freeing so that we don't inadvertently do a
double-free on certain error conditions"

* tag 'selinux-pr-20220203' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
selinux: fix double free of cond_list on error paths

+2 -1
+2 -1
security/selinux/ss/conditional.c
··· 152 152 for (i = 0; i < p->cond_list_len; i++) 153 153 cond_node_destroy(&p->cond_list[i]); 154 154 kfree(p->cond_list); 155 + p->cond_list = NULL; 156 + p->cond_list_len = 0; 155 157 } 156 158 157 159 void cond_policydb_destroy(struct policydb *p) ··· 443 441 return 0; 444 442 err: 445 443 cond_list_destroy(p); 446 - p->cond_list = NULL; 447 444 return rc; 448 445 } 449 446