netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: inet: Support UID-based routing
@ 2016-10-27 17:20 Lorenzo Colitti
  2016-10-27 17:20 ` [PATCH net-next 1/3] net: core: Add a UID field to struct sock Lorenzo Colitti
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Lorenzo Colitti @ 2016-10-27 17:20 UTC (permalink / raw)
  To: netdev; +Cc: davem, ek, eric.dumazet, zenczykowski

This patchset adds support for per-UID routing. It allows the
administrator to configure rules such as:

  ip rule add uidrange 100-200 lookup 123

This functionality has been in use by all Android devices since
5.0, which was released in late 2014. It is primarily used to
impose per-app routing policies (on Android, every app has its
own UID) without having to resort to rerouting packets in
iptables, which breaks getsockname() and MTU/MSS calculation,
and generally disrupts end-to-end connectivity.

This patch series is similar to the code currently used on
Android, but has better correctness and performance because
it stores the UID in the socket instead of calling sock_i_uid.
This avoids contention on sk->sk_callback_lock, and makes it
possible to correctly route a socket on which userspace has
called close(), for which sock_i_uid will return 0.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-27 20:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-27 17:20 [PATCH net-next] net: inet: Support UID-based routing Lorenzo Colitti
2016-10-27 17:20 ` [PATCH net-next 1/3] net: core: Add a UID field to struct sock Lorenzo Colitti
2016-10-27 17:36   ` Eric Dumazet
2016-10-27 20:02     ` David Miller
2016-10-27 19:05   ` kbuild test robot
2016-10-27 17:20 ` [PATCH net-next 2/3] net: core: add UID to flows, rules, and routes Lorenzo Colitti
2016-10-27 17:20 ` [PATCH net-next 3/3] net: inet: Support UID-based routing in IP protocols Lorenzo Colitti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).