aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/documentation-file-ref-check
diff options
context:
space:
mode:
authorWenwen Wang <[email protected]>2019-04-20 01:49:29 +0000
committerPaul Moore <[email protected]>2019-04-22 15:22:03 +0000
commit70c4cf17e445264453bc5323db3e50aa0ac9e81f (patch)
treed4ac7a73d1e877e885a1b9310654c21a55235c85 /scripts/documentation-file-ref-check
parentntp: Audit NTP parameters adjustment (diff)
downloadkernel-70c4cf17e445264453bc5323db3e50aa0ac9e81f.tar.gz
kernel-70c4cf17e445264453bc5323db3e50aa0ac9e81f.zip
audit: fix a memory leak bug
In audit_rule_change(), audit_data_to_entry() is firstly invoked to translate the payload data to the kernel's rule representation. In audit_data_to_entry(), depending on the audit field type, an audit tree may be created in audit_make_tree(), which eventually invokes kmalloc() to allocate the tree. Since this tree is a temporary tree, it will be then freed in the following execution, e.g., audit_add_rule() if the message type is AUDIT_ADD_RULE or audit_del_rule() if the message type is AUDIT_DEL_RULE. However, if the message type is neither AUDIT_ADD_RULE nor AUDIT_DEL_RULE, i.e., the default case of the switch statement, this temporary tree is not freed. To fix this issue, only allocate the tree when the type is AUDIT_ADD_RULE or AUDIT_DEL_RULE. Signed-off-by: Wenwen Wang <[email protected]> Reviewed-by: Richard Guy Briggs <[email protected]> Signed-off-by: Paul Moore <[email protected]>
Diffstat (limited to 'scripts/documentation-file-ref-check')
0 files changed, 0 insertions, 0 deletions