zephyr/subsys
Andrew Boie c951d71eba net: check permissions on net contexts
The original sockets system calls used file descriptors which
were actually net_context pointers. For all socket system calls,
any calls from user mode would check if the caller had permission
to use the net context.

This was later changed to not stuff net_context pointers into file
descriptors, but all the permission checking was unintentionally
lost, allowing all threads on the system to
read/write all socket file descriptors in the system at will, with
no way to isolate applications running on the same microcontroller
from each other's network activity.

This patch restores the permission checks on network context objects
for socket system calls that originated from user mode.

The call to z_object_recycle() was never removed from
zsock_socket_internal(); this is again leveraged to grant the
caller who opened the socket permission on the net_context
associated with the returned file descriptor.

To ensure that all socket calls do this checking, all uses of
z_get_fd_obj_and_vtable() have been routed through get_sock_vtable().

Objects have initialization state set and thread permissions
reset to just the caller in common zsock_socket() code.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-03 22:33:32 +02:00
..
bluetooth bluetooth: host: fix unpacked l2cap struct 2020-05-29 17:43:32 +02:00
canbus canbus: canopen: program: add missing include for FLASH_AREA 2020-05-25 13:26:28 +02:00
console console: Port to the new timeout API 2020-05-07 11:01:55 +02:00
cpp kconfig: Replace some single-symbol 'if's with 'depends on' 2020-02-08 08:32:42 -05:00
debug debug: Fix BOOT_TIME_MEASUREMENT dependencies 2020-05-19 17:25:36 +02:00
dfu flash: Convert DT_FLASH_AREA to FLASH_AREA macros 2020-05-13 21:22:53 +02:00
disk devicetree: remove DT_HAS_NODE_STATUS_OKAY 2020-05-13 18:24:42 +02:00
fb subsys/cfb: move MSB_FIRST down to font capabilities 2020-04-27 13:27:03 +02:00
fs flash: Convert DT_FLASH_AREA to FLASH_AREA macros 2020-05-13 21:22:53 +02:00
jwt kconfig: Replace some single-symbol 'if's with 'depends on' 2020-02-08 08:32:42 -05:00
logging logging: set 'log_backend_rtt:panic_mode' before 'log_backend_std_panic' 2020-05-28 11:45:42 +02:00
mgmt mgmt: smp: add UDP transport for SMP 2020-04-17 10:16:25 +03:00
net net: check permissions on net contexts 2020-06-03 22:33:32 +02:00
power power: Let's have core device setup in case of CONFIG_NET_TEST 2020-05-26 21:41:00 +02:00
random drivers: entropy: replace CONFIG_ENTROPY_NAME with DT macro 2020-04-13 09:14:21 -05:00
settings settings_fcb: Fix storing the data 2020-05-21 17:42:20 +02:00
shell shell: fix showing 'command not found' 2020-06-03 10:23:24 +02:00
stats
storage storage/stream: fix possible unaligned write on buffer flush 2020-05-26 16:35:19 +02:00
testsuite subsys/testsuite: Shorten the assertion messages 2020-05-13 16:23:39 +02:00
tracing tracing: cpu_stats: add missing macro 2020-05-21 11:01:50 +02:00
usb flash: Convert DT_FLASH_AREA to FLASH_AREA macros 2020-05-13 21:22:53 +02:00
CMakeLists.txt tracing: move tracing under subsys/ 2020-02-07 15:58:05 -05:00
Kconfig tracing: move tracing under subsys/ 2020-02-07 15:58:05 -05:00