Re: [PATCH] Realtime LSM

Kronos
2004-09-12T15:50:26Z

Lee Revell <rlrevell@joe-job.com> ha scritto:
> The realtime-lsm Linux Security Module, written by Torben Hohn and Jack
> O'Quin, selectively grants realtime capabilities to specific user groups
> or applications.

Hi,
just a couple of comments:

> diff -ruN -X /home/joq/bin/kdiff.exclude linux-2.6.8.1/security/realtime.c linux-2.6.8.1-rt/security/realtime.c
> --- linux-2.6.8.1/security/realtime.c Wed Dec 31 18:00:00 1969
> +++ linux-2.6.8.1-rt/security/realtime.c Fri Sep 10 11:09:09 2004
[...]
> +#ifdef NGROUPS_SMALL /* using new groups struct? */
> + get_group_info(current->group_info);
> + for (i = 0; i < current->group_info->ngroups; ++i) {
> + if (gid == GROUP_AT(current->group_info, i)) {
> + rt_ok = 1;
> + break;
> + }
> + }
> + put_group_info(current->group_info);
> +#else /* old task struct */
> + for (i = 0; i < NGROUPS; ++i) {
> + if (gid == current->groups[i]) {
> + rt_ok = 1;
> + break;
> + }
> + }
> +#endif /* NGROUPS_SMALL */

Since you are targeting linux 2.6.9 this ifdef can go away.

> +#ifdef LSM_UNSAFE_SHARE /* version >= 2.6.6 */
> + .bprm_apply_creds = cap_bprm_apply_creds,
> +#else
> + .bprm_compute_creds = cap_bprm_compute_creds,
> +#endif

Same here.

> +#define MY_NAME THIS_MODULE->name

This is ugly :P

Luca
--
Home: http://kronoz.cjb.net
Se alla sera, dopo una strepitosa vittoria, guardandoti allo
specchio dovessi notare un secondo paio di palle, che il tuo
cuore non si riempia d'orgoglio, perche` vuol dire che ti
stanno inculando -- Saggio Cinese