-
Notifications
You must be signed in to change notification settings - Fork 82
Implements LOGIN_APPLICATION and LOGIN_USER_APPLICATION #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: optee
Are you sure you want to change the base?
Changes from all commits
cd30df4
80fa328
77807de
8896662
cc033c2
f3ac939
36ea285
d01ca7e
53aff13
5d92e7f
57841ba
d0ab07c
9eda7bf
5f13fd3
b39bb52
ca2a2ef
4da2533
a267ac0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
#include <linux/cred.h> | ||
#include <linux/fs.h> | ||
#include <linux/idr.h> | ||
#include <linux/mm.h> | ||
#include <linux/module.h> | ||
#include <linux/slab.h> | ||
#include <linux/tee_core.h> | ||
|
@@ -222,6 +223,11 @@ int tee_session_calc_client_uuid(uuid_t *uuid, u32 connection_method, | |
* For TEEC_LOGIN_GROUP: | ||
* gid=<gid> | ||
* | ||
* For TEEC_LOGIN_APPLICATION: | ||
* path=<command line path> | ||
* | ||
* For TEEC_LOGIN_USER_APPLICATION: | ||
* uid=<uid>,path=<command line path> | ||
*/ | ||
|
||
name = kzalloc(TEE_UUID_NS_NAME_SIZE, GFP_KERNEL); | ||
|
@@ -254,6 +260,38 @@ int tee_session_calc_client_uuid(uuid_t *uuid, u32 connection_method, | |
} | ||
break; | ||
|
||
case TEE_IOCTL_LOGIN_APPLICATION: | ||
{ | ||
char path[PATH_MAX]; | ||
if (get_cmdline(current, path, sizeof(path)) >= sizeof(path)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How accurate is this when taking chroot and different techniques into account? |
||
rc = -E2BIG; | ||
goto out_free_name; | ||
} | ||
name_len = snprintf(name, TEE_UUID_NS_NAME_SIZE, "path=%s", | ||
path); | ||
if (name_len >= TEE_UUID_NS_NAME_SIZE) { | ||
rc = -E2BIG; | ||
goto out_free_name; | ||
} | ||
} | ||
break; | ||
|
||
case TEE_IOCTL_LOGIN_USER_APPLICATION: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please update the comment block above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
{ | ||
char path[PATH_MAX]; | ||
if (get_cmdline(current, path, sizeof(path)) >= sizeof(path)) { | ||
rc = -E2BIG; | ||
goto out_free_name; | ||
} | ||
name_len = snprintf(name, TEE_UUID_NS_NAME_SIZE, "uid=%x,path=%s", | ||
current_euid().val, path); | ||
if (name_len >= TEE_UUID_NS_NAME_SIZE) { | ||
rc = -E2BIG; | ||
goto out_free_name; | ||
} | ||
} | ||
break; | ||
|
||
default: | ||
rc = -EINVAL; | ||
goto out_free_name; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the comment block above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done