Earlier than Linux v4.17, there was no security_cred_getsecid()
and it is used to get secid for task. For the earlier kernel, use
security_task_getsecid() instead.
Change-Id: I7a6284adf4f316efb124a5659a1458adc0b85d1f
Ref: v4.17 commit
3ec30113264a ("security: Add a cred_getsecid hook")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
continue;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
security_cred_getsecid(((struct cred *)task->real_cred), &secid);
+#else
+ security_task_getsecid(task, &secid);
+#endif
if (!security_secid_to_secctx(secid, &label, &label_len)) {
blacklisted = 0;
for (i = 0; i < blacklist_c; i++) {