Skip to content
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

interfaces/default: allow owner read on @{PROC}/@{pid}/sessionid #14673

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ZeyadYasser
Copy link
Contributor

This is used by auditd, and is generally safe to expose.

This is used by auditd, and is generally safe to expose.

Signed-off-by: Zeyad Gouda <[email protected]>
@ZeyadYasser ZeyadYasser added the Needs security review Can only be merged once security gave a :+1: label Oct 25, 2024
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.97%. Comparing base (96ea7b0) to head (9dc3de1).
Report is 19 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #14673      +/-   ##
==========================================
+ Coverage   78.95%   78.97%   +0.02%     
==========================================
  Files        1084     1085       +1     
  Lines      146638   147119     +481     
==========================================
+ Hits       115773   116183     +410     
- Misses      23667    23713      +46     
- Partials     7198     7223      +25     
Flag Coverage Δ
unittests 78.97% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@zyga zyga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

The sessionid is somewhat unexpectedly the audit session ID and not anything else:

static ssize_t proc_sessionid_read(struct file * file, char __user * buf,
          size_t count, loff_t *ppos)
{
  struct inode * inode = file_inode(file);
  struct task_struct *task = get_proc_task(inode);
  ssize_t length;
  char tmpbuf[TMPBUFLEN];

  if (!task)
    return -ESRCH;
  length = scnprintf(tmpbuf, TMPBUFLEN, "%u",
        audit_get_sessionid(task));
  put_task_struct(task);
  return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
}

Copy link
Contributor

@bboozzoo bboozzoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@alexmurray alexmurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - this is world-readable by default in the kernel and doesn't contain any sensitive information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs security review Can only be merged once security gave a :+1:
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants