Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751459AbdDBLqm (ORCPT ); Sun, 2 Apr 2017 07:46:42 -0400 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:53698 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966AbdDBLqk (ORCPT ); Sun, 2 Apr 2017 07:46:40 -0400 Date: Sun, 2 Apr 2017 13:45:45 +0200 From: Florian Westphal To: Eric Dumazet Cc: Denys Fedoryshchenko , Linux Kernel Network Developers , Pablo Neira Ayuso , Patrick McHardy , Jozsef Kadlecsik , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-kernel@vger.kernel.org Subject: Re: KASAN, xt_TCPMSS finally found nasty use-after-free bug? 4.10.8 Message-ID: <20170402114545.GA31804@breakpoint.cc> References: <6c6e2f7505f969d8c2998efff24063ba@nuclearcat.com> <1491132259.10124.3.camel@edumazet-glaptop3.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1491132259.10124.3.camel@edumazet-glaptop3.roam.corp.google.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 468 Lines: 8 Eric Dumazet wrote: > - for (i = sizeof(struct tcphdr); i <= tcp_hdrlen - TCPOLEN_MSS; i += optlen(opt, i)) { > + for (i = sizeof(struct tcphdr); i < tcp_hdrlen - TCPOLEN_MSS; i += optlen(opt, i)) { > if (opt[i] == TCPOPT_MSS && opt[i+1] == TCPOLEN_MSS) { > u_int16_t oldmss; maybe I am low on caffeeine but this looks fine, for tcp header with only tcpmss this boils down to "20 <= 24 - 4" so we acccess offsets 20-23 which seems ok.