AppArmor: fix task_setrlimit prototype
Subsystems (2)
PATCH 1/1 AppArmor: fix task_setrlimit prototype
After rlimits tree was merged we get the following errors:security/apparmor/lsm.c:663:2: warning: initialization from incompatible pointer type
It is because AppArmor was merged in the meantime, but uses the old prototype. So fix it by adding struct task_struct as a first parameter of apparmor_task_setrlimit.
NOTE that this is ONLY a compilation warning fix (and crashes caused by that). It needs proper handling in AppArmor depending on who is the 'task'.
--- security/apparmor/lsm.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
security/apparmor/lsm.c +2 -2
@@ -607,8 +607,8 @@ static int apparmor_setprocattr(struct task_struct *task, char *name,return error; } -static int apparmor_task_setrlimit (unsigned int resource, -struct rlimit *new_rlim) +static int apparmor_task_setrlimit (struct task_struct *task, +unsigned int resource,struct rlimit *new_rlim) {struct aa_profile *profile =aa_current_profile ();int error =0 ;
Signature · 1 line
1.7.2.1
John Johansen
maintainerQuoted 23 lines · Jiri Slaby
After rlimits tree was merged we get the following errors:
security/apparmor/lsm.c:663:2: warning: initialization from incompatible pointer typeIt is because AppArmor was merged in the meantime, but uses the old prototype. So fix it by adding struct
task_structas a first parameter ofapparmor_task_setrlimit.NOTE that this is ONLY a compilation warning fix (and crashes caused by that). It needs proper handling in AppArmor depending on who is the 'task'.
Signed-off-by Jiri Slaby <[email protected]>Cc John Johansen <[email protected]>Cc James Morris <[email protected]>--- security/apparmor/lsm.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)security/apparmor/lsm.c +0
-0
security/apparmor/lsm.c static int apparmor_setprocattr(struct task_struct *task, char *name, · line 614
Quoted 10 lines
security/apparmor/lsm.c +2
-2@@ -607,8 +607,8 @@ static int apparmor_setprocattr(struct task_struct *task, char *name,return error; } -static int apparmor_task_setrlimit (unsigned int resource, -struct rlimit *new_rlim) +static int apparmor_task_setrlimit (struct task_struct *task, +unsigned int resource,struct rlimit *new_rlim) {struct aa_profile *profile =aa_current_profile ();int error =0 ;
thanks Jiri, I'll get an update for apparmor handling task part out today.
James Morris
maintainerQuoted 11 lines · John Johansen
security/apparmor/lsm.c static int apparmor_setprocattr(struct task_struct *task, char *name, · line 614
Quoted 7 lines
security/apparmor/lsm.c +2
-2-static int apparmor_task_setrlimit (unsigned int resource, -struct rlimit *new_rlim) +static int apparmor_task_setrlimit (struct task_struct *task, +unsigned int resource,struct rlimit *new_rlim) {struct aa_profile *profile =aa_current_profile ();int error =0 ;thanks Jiri, I'll get an update for apparmor handling task part out today.
Signed-off-by John Johansen <[email protected]>
I added my own merge fix for this before seeing this email -- please send me an update against
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next
Signature · 2 lines
James Morris <[email protected]>