lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170124190349.GA9757@salvia>
Date:   Tue, 24 Jan 2017 20:03:49 +0100
From:   Pablo Neira Ayuso <pablo@...filter.org>
To:     Andreas Schultz <aschultz@...p.net>
Cc:     netdev@...r.kernel.org,
        Lionel Gauthier <Lionel.Gauthier@...ecom.fr>,
        openbsc@...ts.osmocom.org, Harald Welte <laforge@...monks.org>
Subject: Re: [PATCH 5/5] gtp: let userspace handle packets for invalid tunnels

Hi Andreas,

On Tue, Jan 24, 2017 at 06:24:02PM +0100, Andreas Schultz wrote:
> enable userspace to send error replies for invalid tunnels
> 
> Signed-off-by: Andreas Schultz <aschultz@...p.net>
> ---
>  drivers/net/gtp.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
> index 912721e..c607333 100644
> --- a/drivers/net/gtp.c
> +++ b/drivers/net/gtp.c
> @@ -198,12 +198,12 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb,
>  	pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid));
>  	if (!pctx) {
>  		netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb);
> -		return -1;
> +		return 1;
>  	}
>  
>  	if (!gtp_check_src_ms(skb, pctx, hdrlen)) {
>  		netdev_dbg(gtp->dev, "No PDP ctx for this MS\n");
> -		return -1;
> +		return 1;

So userspace gets the packet that we cannot forward. I guess your
userspace codebase performs this sanity checks again so you can send
the appropriate error reply?

>  	}
>  
>  	/* Get rid of the GTP + UDP headers. */
> @@ -247,12 +247,12 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb,
>  	pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid));
>  	if (!pctx) {
>  		netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb);
> -		return -1;
> +		return 1;
>  	}
>  
>  	if (!gtp_check_src_ms(skb, pctx, hdrlen)) {
>  		netdev_dbg(gtp->dev, "No PDP ctx for this MS\n");
> -		return -1;
> +		return 1;
>  	}
>  
>  	/* Get rid of the GTP + UDP headers. */
> -- 
> 2.10.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ