Messages in this thread | | | Date | Tue, 27 Jan 2004 16:41:52 -0800 | From | Chris Wright <> | Subject | Re: NGROUPS 2.6.2rc2 |
| |
* Tim Hockin (thockin@sun.com) wrote: > +/* validate and set current->group_info */ > +int set_current_groups(struct group_info *info) > +{ > + int retval; > + struct group_info *old_info; > + > + retval = security_task_setgroups(info); > + if (retval) > + return retval; > + > + groups_sort(info); > + old_info = current->group_info; > + current->group_info = info; > + put_group_info(old_info); > + > + return 0; > +} <snip> > ===== fs/proc/array.c 1.55 vs edited ===== > --- 1.55/fs/proc/array.c Tue Oct 14 14:00:09 2003 > +++ edited/fs/proc/array.c Tue Jan 27 12:40:02 2004 > @@ -176,8 +176,8 @@ > p->files ? p->files->max_fds : 0); > task_unlock(p); > > - for (g = 0; g < p->ngroups; g++) > - buffer += sprintf(buffer, "%d ", p->groups[g]); > + for (g = 0; g < min(p->group_info->ngroups,NGROUPS_SMALL); g++) > + buffer += sprintf(buffer, "%d ", GROUP_AT(p->group_info,g)); > > buffer += sprintf(buffer, "\n"); > return buffer;
this seems racy with no get/put?
thanks, -chris -- Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |