From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr680139.outbound.protection.outlook.com ([40.107.68.139]:29328 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729159AbeJAHOT (ORCPT ); Mon, 1 Oct 2018 03:14:19 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Cong Wang , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH AUTOSEL 4.18 51/65] netfilter: xt_hashlimit: use s->file instead of s->private Date: Mon, 1 Oct 2018 00:38:33 +0000 Message-ID: <20181001003754.146961-51-alexander.levin@microsoft.com> References: <20181001003754.146961-1-alexander.levin@microsoft.com> In-Reply-To: <20181001003754.146961-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Cong Wang [ Upstream commit 1286df269f498165061e0cf8092ca212545dbb5a ] After switching to the new procfs API, it is supposed to retrieve the private pointer from PDE_DATA(file_inode(s->file)), s->private is no longer referred. Fixes: 1cd671827290 ("netfilter/x_tables: switch to proc_create_seq_private= ") Reported-by: Sami Farin Signed-off-by: Cong Wang Acked-by: Christoph Hellwig Tested-by: Sami Farin Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/xt_hashlimit.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 9b16402f29af..3e7d259e5d8d 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c @@ -1057,7 +1057,7 @@ static struct xt_match hashlimit_mt_reg[] __read_most= ly =3D { static void *dl_seq_start(struct seq_file *s, loff_t *pos) __acquires(htable->lock) { - struct xt_hashlimit_htable *htable =3D PDE_DATA(file_inode(s->private)); + struct xt_hashlimit_htable *htable =3D PDE_DATA(file_inode(s->file)); unsigned int *bucket; =20 spin_lock_bh(&htable->lock); @@ -1074,7 +1074,7 @@ static void *dl_seq_start(struct seq_file *s, loff_t = *pos) =20 static void *dl_seq_next(struct seq_file *s, void *v, loff_t *pos) { - struct xt_hashlimit_htable *htable =3D PDE_DATA(file_inode(s->private)); + struct xt_hashlimit_htable *htable =3D PDE_DATA(file_inode(s->file)); unsigned int *bucket =3D v; =20 *pos =3D ++(*bucket); @@ -1088,7 +1088,7 @@ static void *dl_seq_next(struct seq_file *s, void *v,= loff_t *pos) static void dl_seq_stop(struct seq_file *s, void *v) __releases(htable->lock) { - struct xt_hashlimit_htable *htable =3D PDE_DATA(file_inode(s->private)); + struct xt_hashlimit_htable *htable =3D PDE_DATA(file_inode(s->file)); unsigned int *bucket =3D v; =20 if (!IS_ERR(bucket)) @@ -1130,7 +1130,7 @@ static void dl_seq_print(struct dsthash_ent *ent, u_i= nt8_t family, static int dl_seq_real_show_v2(struct dsthash_ent *ent, u_int8_t family, struct seq_file *s) { - struct xt_hashlimit_htable *ht =3D PDE_DATA(file_inode(s->private)); + struct xt_hashlimit_htable *ht =3D PDE_DATA(file_inode(s->file)); =20 spin_lock(&ent->lock); /* recalculate to show accurate numbers */ @@ -1145,7 +1145,7 @@ static int dl_seq_real_show_v2(struct dsthash_ent *en= t, u_int8_t family, static int dl_seq_real_show_v1(struct dsthash_ent *ent, u_int8_t family, struct seq_file *s) { - struct xt_hashlimit_htable *ht =3D PDE_DATA(file_inode(s->private)); + struct xt_hashlimit_htable *ht =3D PDE_DATA(file_inode(s->file)); =20 spin_lock(&ent->lock); /* recalculate to show accurate numbers */ @@ -1160,7 +1160,7 @@ static int dl_seq_real_show_v1(struct dsthash_ent *en= t, u_int8_t family, static int dl_seq_real_show(struct dsthash_ent *ent, u_int8_t family, struct seq_file *s) { - struct xt_hashlimit_htable *ht =3D PDE_DATA(file_inode(s->private)); + struct xt_hashlimit_htable *ht =3D PDE_DATA(file_inode(s->file)); =20 spin_lock(&ent->lock); /* recalculate to show accurate numbers */ @@ -1174,7 +1174,7 @@ static int dl_seq_real_show(struct dsthash_ent *ent, = u_int8_t family, =20 static int dl_seq_show_v2(struct seq_file *s, void *v) { - struct xt_hashlimit_htable *htable =3D PDE_DATA(file_inode(s->private)); + struct xt_hashlimit_htable *htable =3D PDE_DATA(file_inode(s->file)); unsigned int *bucket =3D (unsigned int *)v; struct dsthash_ent *ent; =20 @@ -1188,7 +1188,7 @@ static int dl_seq_show_v2(struct seq_file *s, void *v= ) =20 static int dl_seq_show_v1(struct seq_file *s, void *v) { - struct xt_hashlimit_htable *htable =3D PDE_DATA(file_inode(s->private)); + struct xt_hashlimit_htable *htable =3D PDE_DATA(file_inode(s->file)); unsigned int *bucket =3D v; struct dsthash_ent *ent; =20 @@ -1202,7 +1202,7 @@ static int dl_seq_show_v1(struct seq_file *s, void *v= ) =20 static int dl_seq_show(struct seq_file *s, void *v) { - struct xt_hashlimit_htable *htable =3D PDE_DATA(file_inode(s->private)); + struct xt_hashlimit_htable *htable =3D PDE_DATA(file_inode(s->file)); unsigned int *bucket =3D v; struct dsthash_ent *ent; =20 --=20 2.17.1