net: if: Make sure only allowed threads can access syscalls

Make sure that only those threads that have been granted access
to net_if objects, can call the functions that modify net_if data.

The CONFIG_NET_IF_USERSPACE_ACCESS config option is also removed
as it is no longer needed after this change.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2020-06-18 19:05:12 +03:00 committed by Anas Nashif
commit 336bcfa471
4 changed files with 87 additions and 47 deletions

View file

@ -1930,11 +1930,14 @@ bool net_if_need_calc_tx_checksum(struct net_if *iface);
/**
* @brief Get interface according to index
*
* @details This is a syscall only to provide access to the object for purposes
* of assigning permissions.
*
* @param index Interface index
*
* @return Pointer to interface or NULL if not found.
*/
struct net_if *net_if_get_by_index(int index);
__syscall struct net_if *net_if_get_by_index(int index);
/**
* @brief Get interface index according to pointer