2021-03-11 16:43:24

by Richard Guy Briggs

[permalink] [raw]
Subject: [PATCH 1/2] audit: document /proc/PID/loginuid

Describe the /proc/PID/loginuid interface in Documentation/ABI/stable that
was added 2005-02-01 by commit 1e2d1492e178 ("[PATCH] audit: handle
loginuid through proc")

Signed-off-by: Richard Guy Briggs <[email protected]>
---
Documentation/ABI/stable/procfs-audit_loginuid | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644 Documentation/ABI/stable/procfs-audit_loginuid

diff --git a/Documentation/ABI/stable/procfs-audit_loginuid b/Documentation/ABI/stable/procfs-audit_loginuid
new file mode 100664
index 000000000000..fae63bef2970
--- /dev/null
+++ b/Documentation/ABI/stable/procfs-audit_loginuid
@@ -0,0 +1,15 @@
+What: Audit Login UID
+Date: 2005-02-01
+KernelVersion: 2.6.11-rc2 1e2d1492e178 ("[PATCH] audit: handle loginuid through proc")
+Contact: [email protected]
+Format: u32
+Users: auditd, libaudit, audit-testsuite, login
+Description:
+ The /proc/$pid/loginuid pseudofile is written to set and
+ read to get the audit login UID of process $pid. If it is
+ unset, permissions are not needed to set it. The accessor must
+ have CAP_AUDIT_CONTROL in the initial user namespace to write
+ it if it has been set. It cannot be written again if
+ AUDIT_FEATURE_LOGINUID_IMMUTABLE is enabled. It cannot be
+ unset if AUDIT_FEATURE_ONLY_UNSET_LOGINUID is enabled.
+
--
2.27.0


2021-03-12 19:18:09

by Paul Moore

[permalink] [raw]
Subject: Re: [PATCH 1/2] audit: document /proc/PID/loginuid

On Thu, Mar 11, 2021 at 11:41 AM Richard Guy Briggs <[email protected]> wrote:
> Describe the /proc/PID/loginuid interface in Documentation/ABI/stable that
> was added 2005-02-01 by commit 1e2d1492e178 ("[PATCH] audit: handle
> loginuid through proc")
>
> Signed-off-by: Richard Guy Briggs <[email protected]>
> ---
> Documentation/ABI/stable/procfs-audit_loginuid | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
> create mode 100644 Documentation/ABI/stable/procfs-audit_loginuid

After ~15 years, it might be time ;)

> diff --git a/Documentation/ABI/stable/procfs-audit_loginuid b/Documentation/ABI/stable/procfs-audit_loginuid
> new file mode 100664
> index 000000000000..fae63bef2970
> --- /dev/null
> +++ b/Documentation/ABI/stable/procfs-audit_loginuid
> @@ -0,0 +1,15 @@
> +What: Audit Login UID
> +Date: 2005-02-01
> +KernelVersion: 2.6.11-rc2 1e2d1492e178 ("[PATCH] audit: handle loginuid through proc")
> +Contact: [email protected]
> +Format: u32

I haven't applied the patch, but I'm going to assume that the "u32"
lines up correctly with the rest of the entries, right?

> +Users: auditd, libaudit, audit-testsuite, login

I think these entries are a bit too specific as I expect the kernel to
outlive most userspace libraries and applications. I would suggest
"audit and login applications" or something similar.

> +Description:
> + The /proc/$pid/loginuid pseudofile is written to set and

I'm really in no position to critique someone's English grammar, but
if we're talking about changes I might add a comma after "set", "...
is written to set, and read to get ...".

> + read to get the audit login UID of process $pid. If it is
> + unset, permissions are not needed to set it. The accessor must
> + have CAP_AUDIT_CONTROL in the initial user namespace to write
> + it if it has been set. It cannot be written again if
> + AUDIT_FEATURE_LOGINUID_IMMUTABLE is enabled. It cannot be
> + unset if AUDIT_FEATURE_ONLY_UNSET_LOGINUID is enabled.

--
paul moore
http://www.paul-moore.com

2021-03-17 17:20:38

by Richard Guy Briggs

[permalink] [raw]
Subject: Re: [PATCH 1/2] audit: document /proc/PID/loginuid

On 2021-03-12 14:15, Paul Moore wrote:
> On Thu, Mar 11, 2021 at 11:41 AM Richard Guy Briggs <[email protected]> wrote:
> > Describe the /proc/PID/loginuid interface in Documentation/ABI/stable that
> > was added 2005-02-01 by commit 1e2d1492e178 ("[PATCH] audit: handle
> > loginuid through proc")
> >
> > Signed-off-by: Richard Guy Briggs <[email protected]>
> > ---
> > Documentation/ABI/stable/procfs-audit_loginuid | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> > create mode 100644 Documentation/ABI/stable/procfs-audit_loginuid
>
> After ~15 years, it might be time ;)
>
> > diff --git a/Documentation/ABI/stable/procfs-audit_loginuid b/Documentation/ABI/stable/procfs-audit_loginuid
> > new file mode 100664
> > index 000000000000..fae63bef2970
> > --- /dev/null
> > +++ b/Documentation/ABI/stable/procfs-audit_loginuid
> > @@ -0,0 +1,15 @@
> > +What: Audit Login UID
> > +Date: 2005-02-01
> > +KernelVersion: 2.6.11-rc2 1e2d1492e178 ("[PATCH] audit: handle loginuid through proc")
> > +Contact: [email protected]
> > +Format: u32
>
> I haven't applied the patch, but I'm going to assume that the "u32"
> lines up correctly with the rest of the entries, right?

Yes, they do. I'm wondering if they should read instead "%u" since the
internal kernel representation isn't as important as what format (number
base) is expected and presented.

> > +Users: auditd, libaudit, audit-testsuite, login
>
> I think these entries are a bit too specific as I expect the kernel to
> outlive most userspace libraries and applications. I would suggest
> "audit and login applications" or something similar.

In other examples, users range from a description to an email address,
to a URI, to a repository name or address, to a package name, to
specific files. I'd prefer to be as specific as reasonably possible
without going into gory detail.

> > +Description:
> > + The /proc/$pid/loginuid pseudofile is written to set and
>
> I'm really in no position to critique someone's English grammar, but
> if we're talking about changes I might add a comma after "set", "...
> is written to set, and read to get ...".

This would be the Oxford comma debate, and has a sronger preference by
USA-ians that Brits. It can help disambiguate meaning in a list of
three or more items.

> > + read to get the audit login UID of process $pid. If it is
> > + unset, permissions are not needed to set it. The accessor must
> > + have CAP_AUDIT_CONTROL in the initial user namespace to write
> > + it if it has been set. It cannot be written again if
> > + AUDIT_FEATURE_LOGINUID_IMMUTABLE is enabled. It cannot be
> > + unset if AUDIT_FEATURE_ONLY_UNSET_LOGINUID is enabled.
>
> paul moore

- RGB

--
Richard Guy Briggs <[email protected]>
Sr. S/W Engineer, Kernel Security, Base Operating Systems
Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635