From patchwork Sun Jun 18 02:51:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liping Zhang X-Patchwork-Id: 777381 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wqzCb6M6lz9s65 for ; Sun, 18 Jun 2017 12:51:55 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.b="ZtqbFqpG"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751949AbdFRCvy (ORCPT ); Sat, 17 Jun 2017 22:51:54 -0400 Received: from m12-17.163.com ([220.181.12.17]:49283 "EHLO m12-17.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751727AbdFRCvx (ORCPT ); Sat, 17 Jun 2017 22:51:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=QMN3oU9CSdpIr8087l jfxKh1E6t/E6VCwQ7EZWc1368=; b=ZtqbFqpGMSz+2oLLI1KdgchHqi9tbz3/iV XXm3CTjWTsw8HPiAou/oSYGCzMzEyj61IYDUOjzqfmsNORUbMKJNZFuR7uffJphU X0JfD5zBD5e85gA9NEye1uIdtgvnhpT6WhkGk6WbdaQzxDlbkyf4+kgd2iM7SqhN KXdifzPAo= Received: from MiWiFi-R2D-srv.localdomain (unknown [180.164.216.164]) by smtp13 (Coremail) with SMTP id EcCowABXo0Wz6kVZIDObLQ--.33634S2; Sun, 18 Jun 2017 10:51:36 +0800 (CST) From: Liping Zhang To: pablo@netfilter.org Cc: netfilter-devel@vger.kernel.org, Liping Zhang , Vishwanath Pai Subject: [PATCH nf] netfilter: ebt_nflog: fix unexpected truncated packet Date: Sun, 18 Jun 2017 10:51:09 +0800 Message-Id: <1497754269-44413-1-git-send-email-zlpnobody@163.com> X-Mailer: git-send-email 2.5.5 X-CM-TRANSID: EcCowABXo0Wz6kVZIDObLQ--.33634S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw13Aw1DKw47Zr4ktw43Wrg_yoWDCwbEk3 9Fvan8ur1rAr92yws7AFZ8G3Z5J3s5u34fXwnFqFW3J3WUAwsYqa97u39ayry5Ca4xGFy7 Zr95Wayjyw18CjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnrR67UUUUU== X-Originating-IP: [180.164.216.164] X-CM-SenderInfo: x2os00perg5qqrwthudrp/xtbBZBr6l1QG88e7LQAAsj Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org From: Liping Zhang "struct nf_loginfo li;" is a local variable, so we should set the flags to 0 explicitly, else, packets maybe truncated unexpectedly when copied to the userspace. Fixes: 7643507fe8b5 ("netfilter: xt_NFLOG: nflog-range does not truncate packets") Cc: Vishwanath Pai Signed-off-by: Liping Zhang --- net/bridge/netfilter/ebt_nflog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/bridge/netfilter/ebt_nflog.c b/net/bridge/netfilter/ebt_nflog.c index c1dc486..da1c2fd 100644 --- a/net/bridge/netfilter/ebt_nflog.c +++ b/net/bridge/netfilter/ebt_nflog.c @@ -30,6 +30,7 @@ ebt_nflog_tg(struct sk_buff *skb, const struct xt_action_param *par) li.u.ulog.copy_len = info->len; li.u.ulog.group = info->group; li.u.ulog.qthreshold = info->threshold; + li.u.ulog.flags = 0; nf_log_packet(net, PF_BRIDGE, xt_hooknum(par), skb, xt_in(par), xt_out(par), &li, "%s", info->prefix);