• Himanshu Shukla's avatar
    smack: parse mnt opts after privileges check · 2097f599
    Himanshu Shukla authored
    In smack_set_mnt_opts()first the SMACK mount options are being
    parsed and later it is being checked whether the user calling
    mount has CAP_MAC_ADMIN capability.
    This sequence of operationis will allow unauthorized user to add
    SMACK labels in label list and may cause denial of security attack
    by adding many labels by allocating kernel memory by unauthorized user.
    Superblock smack flag is also being set as initialized though function
    may return with EPERM error.
    First check the capability of calling user then set the SMACK attributes
    and smk_flags.
    Signed-off-by: default avatarHimanshu Shukla <himanshu.sh@samsung.com>
    Acked-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
    2097f599
smack_lsm.c 116 KB