Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4821999ybl; Wed, 22 Jan 2020 05:24:19 -0800 (PST) X-Google-Smtp-Source: APXvYqzJGAwiZrbx02cOUuDVrkkeCK0sE8UWgSbOhvbGwN5p2n4JNBYbKX4DF5YBv/6e/eVP/uhL X-Received: by 2002:aca:814:: with SMTP id 20mr6864798oii.159.1579699459016; Wed, 22 Jan 2020 05:24:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699459; cv=none; d=google.com; s=arc-20160816; b=DteZxBPUi7KBgBN+NhltdEzQVnsiwFWcjdqdTkw3h4nH6Oz7LuwzQi2D+MZyCrMOKs 16BKBKwLVUxUYnwbGug44JRMZPW6ACQneSOReKj7qYb16RG09TNR/sjFCPHXyHQIy9Jh 5lUoFAD6zA47582vNKzcS0OMNV41FZPgtZGSV0ZBfC5D1qOeQB/7olsikf2KrhgQ8a9F tyuvW+Px7LISL+YYun7yp+Anke6KYPDw5GTigqjULozFYJTm5f5avFUiEuiYF7F2gVSN De1pdDcQXTuEMyygH7SgeZPnEBSRz0wdbF2u+dHVqS6CzDrBJfUBxZUGbhwgZokgNyAr ZUgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vzd9zQp4vapi479ocTcS0oJrsGy6kDlGP1qVJgRjKAk=; b=YVMhkgfCjSs+TCA0Ms14GKIwuaWplih/XJA2EAZzRWMIKByInUedsBDQoadwZ7i0p6 kNyEKY2kf/99jnLyEDuL05Jvmrs7fP5VgXiYGzHXj0/LpBcXOhxhdp/g0fZ20ZwHOh2o IbMAvjCb1+dstduBD0hAqg7hvbDTEUIZlVZIbtg+eCU08sRjigIDEr3G+issUb3ob2YQ RXVDwD+4jJdiKadk/4imUQiWj9ES3fqq+bvNiElOLrmCf2ENRE13gfrTEz5LUOUUm5tw BxF3Tn/NI8bGNqKZ9fF6Kpb5hKOknPTc3VpshrCKw6TqKta4TQx72iPq5XsiYEICYyM8 uy4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=p9XP3D8D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l204si20818968oig.31.2020.01.22.05.24.07; Wed, 22 Jan 2020 05:24:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=p9XP3D8D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730304AbgAVNXF (ORCPT + 99 others); Wed, 22 Jan 2020 08:23:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:40938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729327AbgAVNXA (ORCPT ); Wed, 22 Jan 2020 08:23:00 -0500 Received: from localhost (unknown [84.241.205.26]) (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 6ADC72468C; Wed, 22 Jan 2020 13:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699380; bh=VMpHdUqH22/DvoyrLKi+8RnqH5XZgUWcbk35nYMzkqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p9XP3D8DzlTmrnpGhM1w22S9KMt53EHX1q/BdEZ0sCiaYCOS6XXWhsOziKqyGI7YA SmDMBOptPZwRX+Kw0NlVvLx2m6xgCor6LeW26IYODtmqyOzOPbOPwu2tFfc4tTNlDc M+wTj+8H6JQ+jDHNWSMyoj8Nzgbo5RF5MyiNNxTY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+76d0b80493ac881ff77b@syzkaller.appspotmail.com, Florian Westphal , Pablo Neira Ayuso Subject: [PATCH 5.4 127/222] netfilter: nft_tunnel: fix null-attribute check Date: Wed, 22 Jan 2020 10:28:33 +0100 Message-Id: <20200122092842.844012730@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@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 1c702bf902bd37349f6d91cd7f4b372b1e46d0ed upstream. else we get null deref when one of the attributes is missing, both must be non-null. Reported-by: syzbot+76d0b80493ac881ff77b@syzkaller.appspotmail.com Fixes: aaecfdb5c5dd8ba ("netfilter: nf_tables: match on tunnel metadata") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nft_tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/netfilter/nft_tunnel.c +++ b/net/netfilter/nft_tunnel.c @@ -76,7 +76,7 @@ static int nft_tunnel_get_init(const str struct nft_tunnel *priv = nft_expr_priv(expr); u32 len; - if (!tb[NFTA_TUNNEL_KEY] && + if (!tb[NFTA_TUNNEL_KEY] || !tb[NFTA_TUNNEL_DREG]) return -EINVAL;