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=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 101A8C04E53 for ; Wed, 15 May 2019 10:58:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D70A9217D4 for ; Wed, 15 May 2019 10:58:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557917913; bh=IDSfyyVtTppBd7d4I/r6YphAvNbicpX1/1cHlU4Wcao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XSepzskY7H256WAb5mXrQz5KHc9bdZtCoW1zZRdUUCi28MfLuZqL/czggYdLIom0H wHY2WvJbdRSEROOHdn3T1rY5J0mfOxCFYNG1YmGp07vFvD0HTJVC/fWOOyxV/5EgaD aB/lrzHCCoeRf3dKT5KIr0W71gB2iVTwuUGK5QAA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726887AbfEOK6d (ORCPT ); Wed, 15 May 2019 06:58:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:54796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbfEOK6b (ORCPT ); Wed, 15 May 2019 06:58:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3D2DF2166E; Wed, 15 May 2019 10:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557917910; bh=IDSfyyVtTppBd7d4I/r6YphAvNbicpX1/1cHlU4Wcao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vmf3GqIsGaxMMVH6VFEYS5nVVIAlmf/LsSvOZ8MoTNZ2GGjSgHjWwve142KmZNdl1 xuJN+tHevMQMAtgFZEeXeuWz0lSn6BCy1u9QXQ+eN/JEhEIjrouH3htKO+qOW/4C5z d6khVaAeZ2mXraQWGDiQy/lT8a4mTEpPTzvYvU4k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+659574e7bcc7f7eb4df7@syzkaller.appspotmail.com, Florian Westphal , Pablo Neira Ayuso Subject: [PATCH 3.18 09/86] netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON Date: Wed, 15 May 2019 12:54:46 +0200 Message-Id: <20190515090644.373933627@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090642.339346723@linuxfoundation.org> References: <20190515090642.339346723@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Westphal commit 7caa56f006e9d712b44f27b32520c66420d5cbc6 upstream. It means userspace gave us a ruleset where there is some other data after the ebtables target but before the beginning of the next rule. Fixes: 81e675c227ec ("netfilter: ebtables: add CONFIG_COMPAT support") Reported-by: syzbot+659574e7bcc7f7eb4df7@syzkaller.appspotmail.com Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/bridge/netfilter/ebtables.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -2042,7 +2042,8 @@ static int ebt_size_mwt(struct compat_eb if (match_kern) match_kern->match_size = ret; - if (WARN_ON(type == EBT_COMPAT_TARGET && size_left)) + /* rule should have no remaining data after target */ + if (type == EBT_COMPAT_TARGET && size_left) return -EINVAL; match32 = (struct compat_ebt_entry_mwt *) buf;