Return-Path: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50438 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751161AbbEDXcd (ORCPT ); Mon, 4 May 2015 19:32:33 -0400 Message-ID: <1430782341.4113.209.camel@decadent.org.uk> Subject: Re: [PATCH] ipvs: uninitialized data with IP_VS_IPV6 From: Ben Hutchings To: Pablo Neira Ayuso Cc: stable@vger.kernel.org, Dan Carpenter , Simon Horman Date: Tue, 05 May 2015 00:32:21 +0100 In-Reply-To: <1422270525-4353-1-git-send-email-pablo@netfilter.org> References: <1422270525-4353-1-git-send-email-pablo@netfilter.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-1GTX/HDtPd0BFCkySQzE" Mime-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: --=-1GTX/HDtPd0BFCkySQzE Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2015-01-26 at 12:08 +0100, Pablo Neira Ayuso wrote: > From: Dan Carpenter >=20 > [ upstream commit 3b05ac3824ed9648c0d9c02d51d9b54e4e7e874f ] >=20 > The app_tcp_pkt_out() function expects "*diff" to be set and ends up > using uninitialized data if CONFIG_IP_VS_IPV6 is turned on. >=20 > The same issue is there in app_tcp_pkt_in(). Thanks to Julian Anastasov > for noticing that. Queued up for 3.2, thanks. Ben. > Cc: # 3.2.x > Cc: # 3.4.x > Cc: # 3.10.x > Cc: # 3.14.x > Cc: # 3.17.x > Cc: # 3.18.x > Signed-off-by: Dan Carpenter > Acked-by: Julian Anastasov > Signed-off-by: Simon Horman > --- > net/netfilter/ipvs/ip_vs_ftp.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ft= p.c > index 1d5341f..5d3daae 100644 > --- a/net/netfilter/ipvs/ip_vs_ftp.c > +++ b/net/netfilter/ipvs/ip_vs_ftp.c > @@ -183,6 +183,8 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struc= t ip_vs_conn *cp, > struct nf_conn *ct; > struct net *net; > =20 > + *diff =3D 0; > + > #ifdef CONFIG_IP_VS_IPV6 > /* This application helper doesn't work with IPv6 yet, > * so turn this into a no-op for IPv6 packets > @@ -191,8 +193,6 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struc= t ip_vs_conn *cp, > return 1; > #endif > =20 > - *diff =3D 0; > - > /* Only useful for established sessions */ > if (cp->state !=3D IP_VS_TCP_S_ESTABLISHED) > return 1; > @@ -322,6 +322,9 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct= ip_vs_conn *cp, > struct ip_vs_conn *n_cp; > struct net *net; > =20 > + /* no diff required for incoming packets */ > + *diff =3D 0; > + > #ifdef CONFIG_IP_VS_IPV6 > /* This application helper doesn't work with IPv6 yet, > * so turn this into a no-op for IPv6 packets > @@ -330,9 +333,6 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct= ip_vs_conn *cp, > return 1; > #endif > =20 > - /* no diff required for incoming packets */ > - *diff =3D 0; > - > /* Only useful for established sessions */ > if (cp->state !=3D IP_VS_TCP_S_ESTABLISHED) > return 1; --=20 Ben Hutchings Once a job is fouled up, anything done to improve it makes it worse. --=-1GTX/HDtPd0BFCkySQzE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIVAwUAVUgBiee/yOyVhhEJAQpNBw//cAQrKxcCPOl0VKaBHoZjDDehvPfLOd4W x+urJHuBEp4q0vQTYOmWslJRxba8VLRIe2DlEuSR1A9eJDzQWYNDTKvYTVx7h6fu OamaRRZz79bHbJ/QrG1pZ9himxIDOWjYLQLRA5KdwrajS9oTqmy8VH12mMq0UgdU 8cYPNP4jjM+az+mxYze8wrsMea5vXB52Pfg8F0uKFOECCAIKZAWREdzqxAX9vIUH 50qRx8RhA0gzF9k7oYtpzg/iKJflJkiAATfSpTXtT0DdpuJi3Bcn/f4dBZYSyzIv RYpo7hkcanoI2SOdoPI5jfVOIjDGlvTkYzf/9LwlBOo3HoxsUXzhWB7YvVTsbK56 WBOT35eZwx63n3lsfHaB3DbCTaKzTjYu64lzKz9W6OwGn4kQeU65s2rOuReV9mii l0zDRpOc8Ss7+4rDjNCI5hXsUM9fO16oPIZp9xlTM5waOHrzjCWrPV1mM9g7GtPh he0P/2dSIpf+qoo4p9Kb7WsQKf/IAT0uQQWLfdYTKfHn+GZA1PIRqxdxXJAcjra2 98FijAB+bFquoGWsQAv4I2nANTB3l46/X5uNgt94BCdAOlIgZLDlXuKzUgLdfZ/1 DDPFjtFlGDv88OETAt/BEivFl3za6AWoaTIUtqRn0aJ5K18ZxCwntP5e1OTmAcSd Q/wP//mEWNA= =OiIZ -----END PGP SIGNATURE----- --=-1GTX/HDtPd0BFCkySQzE--