From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] fs/proc01.c:add known issues
Date: Mon, 18 Jan 2021 06:04:57 -0500 (EST) [thread overview]
Message-ID: <830441383.33482781.1610967897529.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <202101181134453606602@chinatelecom.cn>
----- Original Message -----
> thanks for good question.
> i check the source linux-source-5.8.0,in filesecurity/smack/smack_lsm.c:
> smack_getprocattr
> directly return -EINVAL.
> static int smack_getprocattr(struct task_struct *p, char *name, char **value)
> {
> struct smack_known *skp = smk_of_task_struct(p);
> char *cp;
> int slen;
> if (strcmp(name, "current") != 0 && strcmp(name, "context") != 0)
> return -EINVAL;
That doesn't look correct, strcmp when reading "current" returns 0, so you condition above
shouldn't be hit.
I'm guessing you don't have smack enabled, and EINVAL is the default LSM ret value
in such case:
LSM_HOOK(int, -EINVAL, getprocattr, struct task_struct *p, char *name,
char **value)
int security_getprocattr(struct task_struct *p, const char *lsm, char *name,
char **value)
{
struct security_hook_list *hp;
hlist_for_each_entry(hp, &security_hook_heads.getprocattr, list) {
if (lsm != NULL && strcmp(lsm, hp->lsm))
continue;
return hp->hook.getprocattr(p, name, value);
}
return LSM_RET_DEFAULT(getprocattr);
}
> cp = kstrdup(skp->smk_known, GFP_KERNEL);
> if (cp == NULL)
> return -ENOMEM;
> slen = strlen(cp);
> *value = cp;
> return slen;
> }
> > From: Jan Stancek
>
> > Date: 2021-01-15 22:54
>
> > To: Xinpeng Liu
>
> > CC: ltp
>
> > Subject: Re: [LTP] [PATCH] fs/proc01.c:add known issues
>
> > ----- Original Message -----
>
> > > Test in ubuntu20.10,there are several failure tests.
>
> > >
>
> > > proc01 1 TFAIL : proc01.c:396: read failed:
>
> > > /proc/self/task/61595/attr/smack/current: errno=EINVAL(22): Invalid
> > > argument
>
> > > proc01 2 TFAIL : proc01.c:396: read failed:
>
> > > /proc/self/task/61595/attr/apparmor/prev: errno=EINVAL(22): Invalid
> > > argument
>
> > > proc01 3 TFAIL : proc01.c:396: read failed:
>
> > > /proc/self/task/61595/attr/apparmor/exec: errno=EINVAL(22): Invalid
> > > argument
>
> > > proc01 4 TFAIL : proc01.c:396: read failed:
>
> > > /proc/self/attr/smack/current: errno=EINVAL(22): Invalid argument
>
> > > proc01 5 TFAIL : proc01.c:396: read failed:
>
> > > /proc/self/attr/apparmor/prev: errno=EINVAL(22): Invalid argument
>
> > > proc01 6 TFAIL : proc01.c:396: read failed:
>
> > > /proc/self/attr/apparmor/exec: errno=EINVAL(22): Invalid argument
>
> > I'm OK with ignoring it, but commit log could explain more why we get
> > EINVAL
>
> > on read here.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210118/0a7d2e0a/attachment.htm>
next prev parent reply other threads:[~2021-01-18 11:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 0:53 [LTP] [PATCH] fs/proc01.c:add known issues Xinpeng Liu
2021-01-15 10:49 ` Joerg Vehlow
2021-01-15 14:54 ` Jan Stancek
2021-01-18 3:34 ` liuxp11
2021-01-18 11:04 ` Jan Stancek [this message]
2021-01-18 11:35 ` liuxp11
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=830441383.33482781.1610967897529.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox