Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jul 2007 12:20:53 -0500
From:      "Christian S.J. Peron" <csjp@FreeBSD.org>
To:        Christian Peron <cperon@seccuris.com>
Cc:        current@freebsd.org
Subject:   Re: Removing NET_NEEDS_GIANT: first patch
Message-ID:  <20070727172053.GA49562@sub>
In-Reply-To: <12A5576E06117043AB644E4A998703B7C1F877@Exc01.seccuris.local>
References:  <12A5576E06117043AB644E4A998703B7C1F877@Exc01.seccuris.local>

next in thread | previous in thread | raw e-mail | index | archive | help
Robert,

Just thought of a couple things:

[..]
> 
> Index: ip_divert.c
> ===================================================================
> RCS file: /data/fbsd-cvs/ncvs/src/sys/netinet/ip_divert.c,v
> retrieving revision 1.128
> diff -u -r1.128 ip_divert.c
> --- ip_divert.c	11 May 2007 10:20:50 -0000	1.128
> +++ ip_divert.c	27 Jul 2007 14:25:09 -0000
> @@ -61,6 +61,7 @@
>   #include <vm/uma.h>
> 
>   #include <net/if.h>
> +#include <net/netisr.h>
>   #include <net/route.h>
> 
>   #include <netinet/in.h>
> @@ -378,7 +379,7 @@
>   				    ((so->so_options & SO_DONTROUTE) ?
>   				    IP_ROUTETOIF : 0) |
>   				    IP_ALLOWBROADCAST | IP_RAWOUTPUT,
> -				    inp->inp_moptions, NULL);
> +				    inp->inp_moptions, inp);

Here we are passing the inp associated with the divert socket.  I am not
sure how accurate this is, since it's quite possible that the packet could
belong to another TCP/UDP socket owned by a completely different user and
socket for that matter.

This will result in the firewalls attributing the packet to the user of
whoever created the divert socket (probably root), instead of attributing
the packet to the subject who created the original TCP/UDP socket.

-- 
Christian S.J. Peron
csjp@FreeBSD.ORG
FreeBSD Committer



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070727172053.GA49562>