BACKPORT: Smack: File receive audit correction
authorCasey Schaufler <casey@schaufler-ca.com>
Tue, 31 Dec 2013 01:37:45 +0000 (17:37 -0800)
committerRafal Krypa <r.krypa@samsung.com>
Tue, 29 Dec 2015 12:26:48 +0000 (13:26 +0100)
Eric Paris politely points out:

    Inside smack_file_receive() it seems like you are initting the audit
    field with LSM_AUDIT_DATA_TASK.  And then use
    smk_ad_setfield_u_fs_path().

    Seems like LSM_AUDIT_DATA_PATH would make more sense.  (and depending
    on how it's used fix a crash...)

He is correct. This puts things in order.

Targeted for git://git.gitorious.org/smack-next/kernel.git

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
(cherry-picked from upstream 4482a44f6a3221cd0076eb6af65672a7e198d8da)

security/smack/smack_lsm.c

index 888e1be1fdd3a8131fd67f723e8ca2b6e2e172fc..df82d43cef21589c968ee14f4d92262e5e29c84c 100644 (file)
@@ -1354,7 +1354,7 @@ static int smack_file_receive(struct file *file)
        int may = 0;
        struct smk_audit_info ad;
 
-       smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_TASK);
+       smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH);
        smk_ad_setfield_u_fs_path(&ad, file->f_path);
        /*
         * This code relies on bitmasks.