tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kauth(9) call inside splnet() in if_bridge.c



On Fri, May 08, 2009 at 05:41:18PM +0300, Elad Efrat wrote:
> Index: if_bridge.c
> ===================================================================
> RCS file: /cvsroot/src/sys/net/if_bridge.c,v
> retrieving revision 1.68
> diff -u -p -r1.68 if_bridge.c
> --- if_bridge.c       4 Apr 2009 15:53:49 -0000       1.68
> +++ if_bridge.c       8 May 2009 14:38:48 -0000
> @@ -445,9 +445,27 @@ bridge_ioctl(struct ifnet *ifp, u_long c
>               struct ifbrparam ifbrparam;
>       } args;
>       struct ifdrv *ifd = (struct ifdrv *) data;
> -     const struct bridge_control *bc;
> +     const struct bridge_control *bc = NULL; /* XXXGCC */
>       int s, error = 0;
>  
> +     /* Authorize command before calling splnet(). */
> +     switch (cmd) {
> +     case SIOCGDRVSPEC:
> +     case SIOCSDRVSPEC:
> +             bc = &bridge_control_table[ifd->ifd_cmd];
> +
> +             /* We only care about BC_F_SUSER at this point. */
> +             if ((bc->bc_flags & BC_F_SUSER) == 0)

We're certainly not interested in skipping the test for ifd_cmd's
validity.

I hope you've been more careful for all the commits you've done the
past couple weeks.

-- 
Quentin Garnier - cube%cubidou.net@localhost - cube%NetBSD.org@localhost
"See the look on my face from staying too long in one place
[...] every time the morning breaks I know I'm closer to falling"
KT Tunstall, Saving My Face, Drastic Fantastic, 2007.

Attachment: pgpnzZFMRSf0Q.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index