All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Lorenzo Colitti <lorenzo@google.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	hannes@stressinduktion.org, eric.dumazet@gmail.com,
	ek@google.com, tom@herbertland.com, zenczykowski@gmail.com
Subject: Re: [PATCH v7 0/4] Support administratively closing application sockets
Date: Wed, 16 Dec 2015 07:43:34 -0800	[thread overview]
Message-ID: <20151216074334.593a1ad6@xeon-e3> (raw)
In-Reply-To: <1450236605-87170-1-git-send-email-lorenzo@google.com>

On Wed, 16 Dec 2015 12:30:01 +0900
Lorenzo Colitti <lorenzo@google.com> wrote:

> This patchset adds the ability to administratively close a socket
> without any action from the process owning the socket or the
> socket protocol.
> 
> It implements this by adding a new diag_destroy function pointer
> to struct proto. In-kernel callers can access this functionality
> directly by calling sk->sk_prot->diag_destroy(sk, err).
> 
> It also exposes this functionality to userspace via a new
> SOCK_DESTROY operation in the NETLINK_SOCK_DIAG sockets. This
> allows a privileged userspace process, such as a connection
> manager or system administration tool, to close sockets belonging
> to other apps when the network they were established on has
> disconnected. It is needed on laptops and mobile hosts to ensure
> that network switches / disconnects do not result in applications
> being blocked for long periods of time (minutes) in read or
> connect calls on TCP sockets that will never succeed because the
> IP address they are bound to is no longer on the system. Closing
> the sockets causes these calls to fail fast and allows the apps
> to reconnect on another network.
> 
> Userspace intervention is necessary because in many cases the
> kernel does not have enough information to know that a connection
> is now inoperable. The kernel can know if a packet can't be
> routed, but in general it won't know if a TCP connection is stuck
> because it is now routed to a network where its source address is
> no longer valid [5][6].


I see no security checks in the diag infrastructure.
Up until now diag has been read-only access and therefore has been
allowed for all users.

  parent reply	other threads:[~2015-12-16 15:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16  3:30 [PATCH v7 0/4] Support administratively closing application sockets Lorenzo Colitti
2015-12-16  3:30 ` [PATCH v7 1/4] net: diag: split inet_diag_dump_one_icsk into two Lorenzo Colitti
2015-12-16  3:30 ` [PATCH v7 2/4] net: diag: Add the ability to destroy a socket Lorenzo Colitti
2015-12-16  3:30 ` [PATCH v7 3/4] net: diag: Support SOCK_DESTROY for inet sockets Lorenzo Colitti
2015-12-16  3:30 ` [PATCH v7 4/4] net: diag: Support destroying TCP sockets Lorenzo Colitti
2015-12-16  4:27 ` [PATCH v7 0/4] Support administratively closing application sockets David Miller
2015-12-16 15:43 ` Stephen Hemminger [this message]
2015-12-16 15:50   ` Eric Dumazet
2015-12-16 19:55     ` Jamal Hadi Salim
2015-12-16 23:24       ` David Miller
2015-12-16 23:35       ` Eric Dumazet
2015-12-17  0:15         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151216074334.593a1ad6@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=davem@davemloft.net \
    --cc=ek@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=hannes@stressinduktion.org \
    --cc=lorenzo@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=tom@herbertland.com \
    --cc=zenczykowski@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.