Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timgad lsm v1 test #384

Closed
wants to merge 19 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
timgad: add the code to lookup timgad tasks
  • Loading branch information
tixxdz committed Jan 24, 2017
commit 1fefee53435ada0e26bd9902e8c20ac7eb64f193
19 changes: 16 additions & 3 deletions security/timgad/timgad_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,30 @@ struct timgad_task *get_timgad_task(struct task_struct *tsk)
{
struct timgad_task ttask;

return NULL;
rcu_read_lock();
ttask = __lookup_timgad_task(tsk);
if (ttask)
atomic_inc(&ttask->usage);
rcu_read_unlock();

return ttask;
}

void put_timgad_task(struct timgad_task *timgad_tsk)
{
return;
if (timgad_tsk && atomic_dec_and_test(&timgad_tsk->usage))
schedule_work(&timgad_tsk->clean_work);
}

struct timgad_task *lookup_timgad_task(struct task_struct *tsk)
{
return NULL;
struct timgad_task ttask;

rcu_read_lock();
ttask = __lookup_timgad_task(tsk);
rcu_read_unlock();

return ttask;
}

static void reclaim_timgad_task(struct work_struct *work)
Expand Down