From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751714AbdDANW2 (ORCPT ); Sat, 1 Apr 2017 09:22:28 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:36098 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751610AbdDANW0 (ORCPT ); Sat, 1 Apr 2017 09:22:26 -0400 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Eric Dumazet" , "Anarcheuz Fritz" Date: Sat, 01 Apr 2017 14:17:53 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.2 1/4] ipv4: keep skb->dst around in presence of IP options In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.2.88-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet Upstream commit 34b2cef20f19c87999fff3da4071e66937db9644 ("ipv4: keep skb->dst around in presence of IP options") incorrectly root caused commit d826eb14ecef ("ipv4: PKTINFO doesnt need dst reference") as bug origin. This patch should fix the issue for 3.2.xx stable kernels, since IPv4 options seem to get more traction these days, after years of oblivion ;) Fixes: f84af32cbca70 ("net: ip_queue_rcv_skb() helper")) Signed-off-by: Eric Dumazet Reported-by: Anarcheuz Fritz Signed-off-by: Ben Hutchings --- --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -1009,7 +1009,8 @@ e_inval: */ int ip_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) { - if (!(inet_sk(sk)->cmsg_flags & IP_CMSG_PKTINFO)) + if (!(inet_sk(sk)->cmsg_flags & IP_CMSG_PKTINFO) && + !IPCB(skb)->opt.optlen) skb_dst_drop(skb); return sock_queue_rcv_skb(sk, skb); }