From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x226LsuAGbGZQrs2jwDGgASX5Qb2bbPyuqGs4A3F/wbH5u/mC4Gx6RUz0cQCSuRGaTXOqEmZR ARC-Seal: i=1; a=rsa-sha256; t=1517256886; cv=none; d=google.com; s=arc-20160816; b=1ATdg9nmy3TvmzuIz5TJU1akwX7MeYF5cgVnbzkGaXSh16vvirMfcbVqIpUyRpaBQn y5ENq65rPCHPZA9pFy8btbZSsn1KCxADvFFjL4llp5x0CLjBBo5lylvz3iPFyqTYy/JT SlNi1+IFNUZYUX2Ouip32ZFIp8moeorpPzAz8Rfe4+iCGTEx3bl066jsfGpgcPx22ZQA 6YuBfQNr4FU0sXALZ6Ms41r4mTdgUP0j30yflkeMAqQAoLKwkhJ5NrMlTWuqcZtUH5j/ uS4oDd139mJtvcRddyOashU0UNLLDcl5AAGzcVHIpo/7TjzyzupENlKkIUEhs0/n/x3P ZBjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=2Jb0U/GthXq5iJKT0A5VP2FLxOrJjVYLy97mAx2nYVQ=; b=dyrBvxXMRejLN0r3XuIHUuQk7xPjKYjGNUVq9HhL+thovUlc9Wkr9w5Ab9i8P9xeX+ qi/YqvkIOtDLgISyn6pOZlsYCFL15kTv2QbPsjSzh1Nt4YFYpyMu5AqO2p4Pk1jjvuyZ ZftotHk8d43fcQjZ94Hf5p3hKfl2H6ebyFfZE2mKZY+Ppmtv387hcGpaZTK+kejM4rtJ 2Dqp1CQQ+D3aPzU8o8hC+WqI2TgXxdXDE0jwOa4Y6R+unOuGWaCLJ/1PisBdJmxlBge7 OmV5Oaat4WQuntwYJxW9D07Al9YnXn6J4nq+UbhUE1jKYbn+JpfIYAa0UZTI7N016bKd xUbg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liping Zhang , Pablo Neira Ayuso , Michal Kubecek Subject: [PATCH 4.4 33/74] netfilter: nf_ct_expect: remove the redundant slash when policy name is empty Date: Mon, 29 Jan 2018 13:56:38 +0100 Message-Id: <20180129123849.085500619@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123847.507563674@linuxfoundation.org> References: <20180129123847.507563674@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590959070834769492?= X-GMAIL-MSGID: =?utf-8?q?1590959156801100957?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Liping Zhang commit b173a28f62cf929324a8a6adcc45adadce311d16 upstream. The 'name' filed in struct nf_conntrack_expect_policy{} is not a pointer, so check it is NULL or not will always return true. Even if the name is empty, slash will always be displayed like follows: # cat /proc/net/nf_conntrack_expect 297 l3proto = 2 proto=6 src=1.1.1.1 dst=2.2.2.2 sport=1 dport=1025 ftp/ ^ Fixes: 3a8fc53a45c4 ("netfilter: nf_ct_helper: allocate 16 bytes for the helper and policy names") Signed-off-by: Liping Zhang Signed-off-by: Pablo Neira Ayuso Acked-by: Michal Kubecek Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_conntrack_expect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/netfilter/nf_conntrack_expect.c +++ b/net/netfilter/nf_conntrack_expect.c @@ -560,7 +560,7 @@ static int exp_seq_show(struct seq_file helper = rcu_dereference(nfct_help(expect->master)->helper); if (helper) { seq_printf(s, "%s%s", expect->flags ? " " : "", helper->name); - if (helper->expect_policy[expect->class].name) + if (helper->expect_policy[expect->class].name[0]) seq_printf(s, "/%s", helper->expect_policy[expect->class].name); }