]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
rds: System panic if RDS netfilter is enabled and RDS/TCP is used
authorKa-Cheong Poon <ka-cheong.poon@oracle.com>
Tue, 31 Oct 2017 15:32:13 +0000 (08:32 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 11 Dec 2017 04:34:26 +0000 (20:34 -0800)
If a transport does not support netfilter, its inc_to_skb is NULL.
The code needs to make sure that it is not NULL before calling it.

Orabug: 26950401

Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
net/rds/recv.c

index a763250c7a2509941394242cf54caa7d3cd90791..591fe75eaa4ff6c29ad147bbb03fde0729e22605 100644 (file)
@@ -361,9 +361,12 @@ void rds_recv_incoming(struct rds_connection *conn, struct in6_addr *saddr,
        /* lets find a socket to which this request belongs */
        rs = rds_find_bound(daddr, inc->i_hdr.h_dport, conn->c_dev_if);
 
-       /* pass it on locally if there is no socket bound, or if netfilter is
-        * disabled for this socket */
-       if (NULL == rs || !rs->rs_netfilter_enabled) {
+       /* Pass it on locally if there is no socket bound, or if netfilter is
+        * disabled for this socket, or if the underlying transport does not
+        * support netfilter.
+        */
+       if (NULL == rs || !rs->rs_netfilter_enabled ||
+           !conn->c_trans->inc_to_skb) {
                rds_recv_local(cp, saddr, daddr, inc, gfp, rs);
 
                /* drop the reference if we had taken one */