Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 117c2c04 authored by Yida Wang's avatar Yida Wang
Browse files

seemp: adjust interpretation of rooting report



In the newer versions of EL2 rooting report, a pointer to task_struct
will be supplied as the actor. Extract the pid from the task_struct
and log the pid.

Change-Id: Ic38d0feb8d433f02e614f5e578f21dc12a9d5f38
Signed-off-by: default avatarYida Wang <yidaw@codeaurora.org>
parent 607b49ce
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#define YEAR_BASE 1900

#define EL2_SCM_ID 0x02001902
#define KP_EL2_REPORT_REVISION 0x01000101

static struct seemp_logk_dev *slogk_dev;

@@ -610,6 +611,9 @@ static int seemp_logk_rtic_thread(void *data)
		/ sizeof(struct el2_report_data_t);
	header = (struct el2_report_header_t *) el2_shared_mem;

	if (header->report_version < KP_EL2_REPORT_REVISION)
		return -EINVAL;

	while (!kthread_should_stop()) {
		for (i = 1; i < num_entries + 1; i++) {
			struct el2_report_data_t *report;
@@ -628,7 +632,8 @@ static int seemp_logk_rtic_thread(void *data)
					|| report->sequence_number >
						last_sequence_number)) {
				seemp_logk_rtic(report->report_type,
					report->actor,
					((struct task_struct *) report->actor)
						->pid,
					/* leave this empty until
					 * asset id is provided
					 */
+3 −3
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ static inline void seemp_logk_sendto(int fd, void __user *buff, size_t len,
	seemp_logk_kernel_end(blck);
}

static inline void seemp_logk_rtic(__u8 type, __u64 actor, __u8 asset_id[0x20],
static inline void seemp_logk_rtic(__u8 type, pid_t pid, __u8 asset_id[0x20],
		__u8 asset_category, __u8 response)
{
	char *buf = NULL;
@@ -80,8 +80,8 @@ static inline void seemp_logk_rtic(__u8 type, __u64 actor, __u8 asset_id[0x20],
		return;

	SEEMP_LOGK_RECORD(SEEMP_API_kernel__rtic,
		"app_pid=%llu,rtic_type=%u,asset_id=%s,asset_category=%u,response=%u",
		actor, type, asset_id, asset_category, response);
		"app_pid=%d,rtic_type=%u,asset_id=%s,asset_category=%u,response=%u",
		pid, type, asset_id, asset_category, response);

	seemp_logk_kernel_end(blck);
}