From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A175C47094 for ; Thu, 10 Jun 2021 16:44:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7FF4860FDA for ; Thu, 10 Jun 2021 16:44:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230197AbhFJQqK (ORCPT ); Thu, 10 Jun 2021 12:46:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230422AbhFJQqG (ORCPT ); Thu, 10 Jun 2021 12:46:06 -0400 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5B72C061574 for ; Thu, 10 Jun 2021 09:44:08 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1lrNma-0002J9-Il; Thu, 10 Jun 2021 18:43:52 +0200 Date: Thu, 10 Jun 2021 18:43:52 +0200 From: Florian Westphal To: Maxim Mikityanskiy Cc: Mat Martineau , Matthieu Baerts , Jakub Kicinski , "David S. Miller" , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , Toke =?iso-8859-15?Q?H=F8iland-J=F8rgensen?= , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Patrick McHardy , Jesper Dangaard Brouer , Paolo Abeni , Christoph Paasch , Peter Krystad , Young Xiao <92siuyang@gmail.com>, netdev@vger.kernel.org, mptcp@lists.linux.dev Subject: Re: [PATCH net v2 1/3] netfilter: synproxy: Fix out of bounds when parsing TCP options Message-ID: <20210610164352.GQ20020@breakpoint.cc> References: <20210610164031.3412479-1-maximmi@nvidia.com> <20210610164031.3412479-2-maximmi@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210610164031.3412479-2-maximmi@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Maxim Mikityanskiy wrote: > The TCP option parser in synproxy (synproxy_parse_options) could read > one byte out of bounds. When the length is 1, the execution flow gets > into the loop, reads one byte of the opcode, and if the opcode is > neither TCPOPT_EOL nor TCPOPT_NOP, it reads one more byte, which exceeds > the length of 1. > > This fix is inspired by commit 9609dad263f8 ("ipv4: tcp_input: fix stack > out of bounds when parsing TCP options."). Reviewed-by: Florian Westphal