All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "sock_diag: do not broadcast raw socket destruction" has been added to the 4.4-stable tree
@ 2016-07-06 23:56 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-07-06 23:56 UTC (permalink / raw)
  To: willemb, davem, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    sock_diag: do not broadcast raw socket destruction

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sock_diag-do-not-broadcast-raw-socket-destruction.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Wed Jul  6 16:50:47 PDT 2016
From: Willem de Bruijn <willemb@google.com>
Date: Fri, 24 Jun 2016 16:02:35 -0400
Subject: sock_diag: do not broadcast raw socket destruction

From: Willem de Bruijn <willemb@google.com>

[ Upstream commit 9a0fee2b552b1235fb1706ae1fc664ae74573be8 ]

Diag intends to broadcast tcp_sk and udp_sk socket destruction.
Testing sk->sk_protocol for IPPROTO_TCP/IPPROTO_UDP alone is not
sufficient for this. Raw sockets can have the same type.

Add a test for sk->sk_type.

Fixes: eb4cb008529c ("sock_diag: define destruction multicast groups")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/sock_diag.h |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/include/linux/sock_diag.h
+++ b/include/linux/sock_diag.h
@@ -35,6 +35,9 @@ enum sknetlink_groups sock_diag_destroy_
 {
 	switch (sk->sk_family) {
 	case AF_INET:
+		if (sk->sk_type == SOCK_RAW)
+			return SKNLGRP_NONE;
+
 		switch (sk->sk_protocol) {
 		case IPPROTO_TCP:
 			return SKNLGRP_INET_TCP_DESTROY;
@@ -44,6 +47,9 @@ enum sknetlink_groups sock_diag_destroy_
 			return SKNLGRP_NONE;
 		}
 	case AF_INET6:
+		if (sk->sk_type == SOCK_RAW)
+			return SKNLGRP_NONE;
+
 		switch (sk->sk_protocol) {
 		case IPPROTO_TCP:
 			return SKNLGRP_INET6_TCP_DESTROY;


Patches currently in stable-queue which might be from willemb@google.com are

queue-4.4/sock_diag-do-not-broadcast-raw-socket-destruction.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-06 23:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-06 23:56 Patch "sock_diag: do not broadcast raw socket destruction" has been added to the 4.4-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.