]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 Jun 2015 23:10:41 +0000 (16:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 Jun 2015 23:10:41 +0000 (16:10 -0700)
added patches:
netfilter-nfnetlink_cthelper-remove-const-and-to-avoid-warnings.patch
netfilter-zero-the-tuple-in-nfnl_cthelper_parse_tuple.patch

queue-3.10/netfilter-nfnetlink_cthelper-remove-const-and-to-avoid-warnings.patch [new file with mode: 0644]
queue-3.10/netfilter-zero-the-tuple-in-nfnl_cthelper_parse_tuple.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/netfilter-nfnetlink_cthelper-remove-const-and-to-avoid-warnings.patch b/queue-3.10/netfilter-nfnetlink_cthelper-remove-const-and-to-avoid-warnings.patch
new file mode 100644 (file)
index 0000000..771a1da
--- /dev/null
@@ -0,0 +1,67 @@
+From b18c5d15e8714336365d9d51782d5b53afa0443c Mon Sep 17 00:00:00 2001
+From: Chen Gang <gang.chen.5i5j@gmail.com>
+Date: Wed, 24 Dec 2014 23:04:54 +0800
+Subject: netfilter: nfnetlink_cthelper: Remove 'const' and '&' to avoid warnings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Chen Gang <gang.chen.5i5j@gmail.com>
+
+commit b18c5d15e8714336365d9d51782d5b53afa0443c upstream.
+
+The related code can be simplified, and also can avoid related warnings
+(with allmodconfig under parisc):
+
+    CC [M]  net/netfilter/nfnetlink_cthelper.o
+  net/netfilter/nfnetlink_cthelper.c: In function ‘nfnl_cthelper_from_nlattr’:
+  net/netfilter/nfnetlink_cthelper.c:97:9: warning: passing argument 1 o ‘memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-array-qualifiers]
+    memcpy(&help->data, nla_data(attr), help->helper->data_len);
+           ^
+  In file included from include/linux/string.h:17:0,
+                   from include/uapi/linux/uuid.h:25,
+                   from include/linux/uuid.h:23,
+                   from include/linux/mod_devicetable.h:12,
+                   from ./arch/parisc/include/asm/hardware.h:4,
+                   from ./arch/parisc/include/asm/processor.h:15,
+                   from ./arch/parisc/include/asm/spinlock.h:6,
+                   from ./arch/parisc/include/asm/atomic.h:21,
+                   from include/linux/atomic.h:4,
+                   from ./arch/parisc/include/asm/bitops.h:12,
+                   from include/linux/bitops.h:36,
+                   from include/linux/kernel.h:10,
+                   from include/linux/list.h:8,
+                   from include/linux/module.h:9,
+                   from net/netfilter/nfnetlink_cthelper.c:11:
+  ./arch/parisc/include/asm/string.h:8:8: note: expected ‘void *’ but argument is of type ‘const char (*)[]’
+   void * memcpy(void * dest,const void *src,size_t count);
+          ^
+
+Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
+Signed-off-by: Pablo Neira Ayuso <pablo@soleta.eu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/netfilter/nfnetlink_cthelper.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/netfilter/nfnetlink_cthelper.c
++++ b/net/netfilter/nfnetlink_cthelper.c
+@@ -83,7 +83,7 @@ nfnl_cthelper_parse_tuple(struct nf_conn
+ static int
+ nfnl_cthelper_from_nlattr(struct nlattr *attr, struct nf_conn *ct)
+ {
+-      const struct nf_conn_help *help = nfct_help(ct);
++      struct nf_conn_help *help = nfct_help(ct);
+       if (attr == NULL)
+               return -EINVAL;
+@@ -91,7 +91,7 @@ nfnl_cthelper_from_nlattr(struct nlattr
+       if (help->helper->data_len == 0)
+               return -EINVAL;
+-      memcpy(&help->data, nla_data(attr), help->helper->data_len);
++      memcpy(help->data, nla_data(attr), help->helper->data_len);
+       return 0;
+ }
diff --git a/queue-3.10/netfilter-zero-the-tuple-in-nfnl_cthelper_parse_tuple.patch b/queue-3.10/netfilter-zero-the-tuple-in-nfnl_cthelper_parse_tuple.patch
new file mode 100644 (file)
index 0000000..5e08721
--- /dev/null
@@ -0,0 +1,48 @@
+From 78146572b9cd20452da47951812f35b1ad4906be Mon Sep 17 00:00:00 2001
+From: Ian Wilson <iwilson@brocade.com>
+Date: Thu, 12 Mar 2015 09:37:58 +0000
+Subject: netfilter: Zero the tuple in nfnl_cthelper_parse_tuple()
+
+From: Ian Wilson <iwilson@brocade.com>
+
+commit 78146572b9cd20452da47951812f35b1ad4906be upstream.
+
+nfnl_cthelper_parse_tuple() is called from nfnl_cthelper_new(),
+nfnl_cthelper_get() and nfnl_cthelper_del().  In each case they pass
+a pointer to an nf_conntrack_tuple data structure local variable:
+
+    struct nf_conntrack_tuple tuple;
+    ...
+    ret = nfnl_cthelper_parse_tuple(&tuple, tb[NFCTH_TUPLE]);
+
+The problem is that this local variable is not initialized, and
+nfnl_cthelper_parse_tuple() only initializes two fields: src.l3num and
+dst.protonum.  This leaves all other fields with undefined values
+based on whatever is on the stack:
+
+    tuple->src.l3num = ntohs(nla_get_be16(tb[NFCTH_TUPLE_L3PROTONUM]));
+    tuple->dst.protonum = nla_get_u8(tb[NFCTH_TUPLE_L4PROTONUM]);
+
+The symptom observed was that when the rpc and tns helpers were added
+then traffic to port 1536 was being sent to user-space.
+
+Signed-off-by: Ian Wilson <iwilson@brocade.com>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/netfilter/nfnetlink_cthelper.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/net/netfilter/nfnetlink_cthelper.c
++++ b/net/netfilter/nfnetlink_cthelper.c
+@@ -74,6 +74,9 @@ nfnl_cthelper_parse_tuple(struct nf_conn
+       if (!tb[NFCTH_TUPLE_L3PROTONUM] || !tb[NFCTH_TUPLE_L4PROTONUM])
+               return -EINVAL;
++      /* Not all fields are initialized so first zero the tuple */
++      memset(tuple, 0, sizeof(struct nf_conntrack_tuple));
++
+       tuple->src.l3num = ntohs(nla_get_be16(tb[NFCTH_TUPLE_L3PROTONUM]));
+       tuple->dst.protonum = nla_get_u8(tb[NFCTH_TUPLE_L4PROTONUM]);
index 2d037b0873f8ecdd1435d8e170d0416776d21ef9..ec855bec3dc8002503acc8551a3a330acf4ce39c 100644 (file)
@@ -1,3 +1,5 @@
 fput-turn-list_head-delayed_fput_list-into-llist_head.patch
 get-rid-of-s_files-and-files_lock.patch
 config-enable-need_dma_map_state-by-default-when-swiotlb-is-selected.patch
+netfilter-nfnetlink_cthelper-remove-const-and-to-avoid-warnings.patch
+netfilter-zero-the-tuple-in-nfnl_cthelper_parse_tuple.patch