* [PATCH 0/2] kernel: add error handling / logging to sel_write_load()/sel_make_bools()
@ 2016-12-17 20:48 Gary Tierney
2016-12-17 20:48 ` [PATCH 1/2] selinux: log errors when loading new policy Gary Tierney
2016-12-17 20:48 ` [PATCH 2/2] selinux: default to security isid in sel_make_bools() if no sid is found Gary Tierney
0 siblings, 2 replies; 48+ messages in thread
From: Gary Tierney @ 2016-12-17 20:48 UTC (permalink / raw)
To: selinux; +Cc: paul, sds, Gary Tierney
Adds error logging to sel_write_load() so there is warning/error messages about
what specifically failed. Also prints a warning when security_genfs_sid()
fails in sel_make_bools() and defaults the labeling of the relevant /booleans/*
entries to SECINITSID_SECURITY.
Currently if security_genfs_sid() fails in sel_make_bools() the policy will
fail to load, and the system will consequently fail to complete booting. This
is quite easy to reproduce on Fedora:
# semodule --cil -E base
# sed -i '/genfscon selinuxfs/d' base.cil
# semodule -i base.cil
This will cause load_policy to exit with an error, though it will seem as if
the policy was loaded succesfully (until reboot at least). When rebooting I
see an error message and the system hangs for a while waiting on D-Bus and
eventually fails to start the login service:
SELinux: Could not load policy file /etc/selinux/targeted/policy/policy.30: No such file or directory
... snip ...
[FAILED] Failed to start Login Service.
With the first patch a message will be printed indicating where
sel_write_load() failed and print an error message in sel_make_bools(), the
second will print a warning then also use SECINITSID_SECURITY as a default SID:
[ 1682.776151] SELinux: sel_make_bools: no sid found, defaulting to security isid for /booleans/antivirus_can_scan_system
[ 1682.781782] SELinux: sel_make_bools: no sid found, defaulting to security isid for /booleans/antivirus_use_jit
[ 1682.787027] SELinux: sel_make_bools: no sid found, defaulting to security isid for /booleans/httpd_anon_write
With /sys/fs/selinux/booleans/* showing the correct labels (the security initial SID):
bash-4.3# ls -Z /sys/fs/selinux/booleans/ | head -n 5
system_u:object_r:security_t:s0 abrt_anon_write
system_u:object_r:security_t:s0 abrt_handle_event
system_u:object_r:security_t:s0 abrt_upload_watch_anon_write
system_u:object_r:security_t:s0 antivirus_can_scan_system
system_u:object_r:security_t:s0 antivirus_use_jit
Gary Tierney (2):
selinux: log errors when loading new policy
selinux: default to security isid in sel_make_bools() if no sid is
found
security/selinux/selinuxfs.c | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 48+ messages in thread* [PATCH 1/2] selinux: log errors when loading new policy
2016-12-17 20:48 [PATCH 0/2] kernel: add error handling / logging to sel_write_load()/sel_make_bools() Gary Tierney
@ 2016-12-17 20:48 ` Gary Tierney
2016-12-19 14:43 ` Stephen Smalley
2016-12-17 20:48 ` [PATCH 2/2] selinux: default to security isid in sel_make_bools() if no sid is found Gary Tierney
1 sibling, 1 reply; 48+ messages in thread
From: Gary Tierney @ 2016-12-17 20:48 UTC (permalink / raw)
To: selinux; +Cc: paul, sds, Gary Tierney
Adds error and warning messages to the codepaths which can fail when
loading a new policy. If a policy fails to load, an error message will
be printed to dmesg with a description of what failed. Previously if
there was an error during policy loading there would be no indication
that it failed.
Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
---
security/selinux/selinuxfs.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 0aac402..2139cc7 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -522,20 +522,32 @@ static ssize_t sel_write_load(struct file *file, const char __user *buf,
goto out;
length = security_load_policy(data, count);
- if (length)
+ if (length) {
+ pr_err("SELinux: %s: failed to load policy\n",
+ __func__);
goto out;
+ }
length = sel_make_bools();
- if (length)
+ if (length) {
+ pr_warn("SELinux: %s: failed to load policy booleans\n",
+ __func__);
goto out1;
+ }
length = sel_make_classes();
- if (length)
+ if (length) {
+ pr_warn("SELinux: %s: failed to load policy classes\n",
+ __func__);
goto out1;
+ }
length = sel_make_policycap();
- if (length)
+ if (length) {
+ pr_warn("SELinux: %s: failed to load policy capabilities\n",
+ __func__);
goto out1;
+ }
length = count;
@@ -1299,9 +1311,13 @@ static int sel_make_bools(void)
isec = (struct inode_security_struct *)inode->i_security;
ret = security_genfs_sid("selinuxfs", page, SECCLASS_FILE, &sid);
- if (ret)
+ if (ret) {
+ pr_warn_ratelimited("SELinux: %s: failed to lookup sid for %s\n",
+ __func__, page);
goto out;
+ }
+
isec->sid = sid;
isec->initialized = LABEL_INITIALIZED;
inode->i_fop = &sel_bool_ops;
--
2.7.4
^ permalink raw reply related [flat|nested] 48+ messages in thread* Re: [PATCH 1/2] selinux: log errors when loading new policy
2016-12-17 20:48 ` [PATCH 1/2] selinux: log errors when loading new policy Gary Tierney
@ 2016-12-19 14:43 ` Stephen Smalley
0 siblings, 0 replies; 48+ messages in thread
From: Stephen Smalley @ 2016-12-19 14:43 UTC (permalink / raw)
To: Gary Tierney, selinux; +Cc: linux-audit
On Sat, 2016-12-17 at 20:48 +0000, Gary Tierney wrote:
> Adds error and warning messages to the codepaths which can fail when
> loading a new policy. If a policy fails to load, an error message
> will
> be printed to dmesg with a description of what failed. Previously if
> there was an error during policy loading there would be no indication
> that it failed.
>
> Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> ---
> security/selinux/selinuxfs.c | 26 +++++++++++++++++++++-----
> 1 file changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/security/selinux/selinuxfs.c
> b/security/selinux/selinuxfs.c
> index 0aac402..2139cc7 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -522,20 +522,32 @@ static ssize_t sel_write_load(struct file
> *file, const char __user *buf,
> goto out;
>
> length = security_load_policy(data, count);
> - if (length)
> + if (length) {
> + pr_err("SELinux: %s: failed to load policy\n",
> + __func__);
Not sure about your usage of pr_err() vs pr_warn();
security_load_policy() may simply fail due to invalid policy from
userspace, not a kernel-internal error per se.
I would tend to omit the function name; I don't think it is especially
helpful.
There was an earlier discussion about augmenting the audit logging from
this function, so this might overlap with that. I don't know where
that stands.
> goto out;
> + }
>
> length = sel_make_bools();
> - if (length)
> + if (length) {
> + pr_warn("SELinux: %s: failed to load policy
> booleans\n",
> + __func__);
> goto out1;
> + }
>
> length = sel_make_classes();
> - if (length)
> + if (length) {
> + pr_warn("SELinux: %s: failed to load policy
> classes\n",
> + __func__);
> goto out1;
> + }
>
> length = sel_make_policycap();
> - if (length)
> + if (length) {
> + pr_warn("SELinux: %s: failed to load policy
> capabilities\n",
> + __func__);
> goto out1;
> + }
>
> length = count;
>
> @@ -1299,9 +1311,13 @@ static int sel_make_bools(void)
>
> isec = (struct inode_security_struct *)inode-
> >i_security;
> ret = security_genfs_sid("selinuxfs", page,
> SECCLASS_FILE, &sid);
> - if (ret)
> + if (ret) {
> + pr_warn_ratelimited("SELinux: %s: failed to
> lookup sid for %s\n",
> + __func__, page);
> goto out;
>
> + }
> +
> isec->sid = sid;
> isec->initialized = LABEL_INITIALIZED;
> inode->i_fop = &sel_bool_ops;
--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit
^ permalink raw reply [flat|nested] 48+ messages in thread* Re: [PATCH 1/2] selinux: log errors when loading new policy
@ 2016-12-19 14:43 ` Stephen Smalley
0 siblings, 0 replies; 48+ messages in thread
From: Stephen Smalley @ 2016-12-19 14:43 UTC (permalink / raw)
To: Gary Tierney, selinux; +Cc: paul, linux-audit, Steve Grubb
On Sat, 2016-12-17 at 20:48 +0000, Gary Tierney wrote:
> Adds error and warning messages to the codepaths which can fail when
> loading a new policy. If a policy fails to load, an error message
> will
> be printed to dmesg with a description of what failed. Previously if
> there was an error during policy loading there would be no indication
> that it failed.
>
> Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> ---
> security/selinux/selinuxfs.c | 26 +++++++++++++++++++++-----
> 1 file changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/security/selinux/selinuxfs.c
> b/security/selinux/selinuxfs.c
> index 0aac402..2139cc7 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -522,20 +522,32 @@ static ssize_t sel_write_load(struct file
> *file, const char __user *buf,
> goto out;
>
> length = security_load_policy(data, count);
> - if (length)
> + if (length) {
> + pr_err("SELinux: %s: failed to load policy\n",
> + __func__);
Not sure about your usage of pr_err() vs pr_warn();
security_load_policy() may simply fail due to invalid policy from
userspace, not a kernel-internal error per se.
I would tend to omit the function name; I don't think it is especially
helpful.
There was an earlier discussion about augmenting the audit logging from
this function, so this might overlap with that. I don't know where
that stands.
> goto out;
> + }
>
> length = sel_make_bools();
> - if (length)
> + if (length) {
> + pr_warn("SELinux: %s: failed to load policy
> booleans\n",
> + __func__);
> goto out1;
> + }
>
> length = sel_make_classes();
> - if (length)
> + if (length) {
> + pr_warn("SELinux: %s: failed to load policy
> classes\n",
> + __func__);
> goto out1;
> + }
>
> length = sel_make_policycap();
> - if (length)
> + if (length) {
> + pr_warn("SELinux: %s: failed to load policy
> capabilities\n",
> + __func__);
> goto out1;
> + }
>
> length = count;
>
> @@ -1299,9 +1311,13 @@ static int sel_make_bools(void)
>
> isec = (struct inode_security_struct *)inode-
> >i_security;
> ret = security_genfs_sid("selinuxfs", page,
> SECCLASS_FILE, &sid);
> - if (ret)
> + if (ret) {
> + pr_warn_ratelimited("SELinux: %s: failed to
> lookup sid for %s\n",
> + __func__, page);
> goto out;
>
> + }
> +
> isec->sid = sid;
> isec->initialized = LABEL_INITIALIZED;
> inode->i_fop = &sel_bool_ops;
^ permalink raw reply [flat|nested] 48+ messages in thread* Re: [PATCH 1/2] selinux: log errors when loading new policy
2016-12-19 14:43 ` Stephen Smalley
@ 2016-12-19 15:08 ` Steve Grubb
-1 siblings, 0 replies; 48+ messages in thread
From: Steve Grubb @ 2016-12-19 15:08 UTC (permalink / raw)
To: Stephen Smalley; +Cc: linux-audit, selinux
On Monday, December 19, 2016 9:43:06 AM EST Stephen Smalley wrote:
> On Sat, 2016-12-17 at 20:48 +0000, Gary Tierney wrote:
> > Adds error and warning messages to the codepaths which can fail when
> > loading a new policy. If a policy fails to load, an error message
> > will
> > be printed to dmesg with a description of what failed. Previously if
> > there was an error during policy loading there would be no indication
> > that it failed.
> >
> > Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> > ---
> > security/selinux/selinuxfs.c | 26 +++++++++++++++++++++-----
> > 1 file changed, 21 insertions(+), 5 deletions(-)
> >
> > diff --git a/security/selinux/selinuxfs.c
> > b/security/selinux/selinuxfs.c
> > index 0aac402..2139cc7 100644
> > --- a/security/selinux/selinuxfs.c
> > +++ b/security/selinux/selinuxfs.c
> > @@ -522,20 +522,32 @@ static ssize_t sel_write_load(struct file
> > *file, const char __user *buf,
> > goto out;
> >
> > length = security_load_policy(data, count);
> > - if (length)
> > + if (length) {
> > + pr_err("SELinux: %s: failed to load policy\n",
> > + __func__);
>
> Not sure about your usage of pr_err() vs pr_warn();
> security_load_policy() may simply fail due to invalid policy from
> userspace, not a kernel-internal error per se.
>
> I would tend to omit the function name; I don't think it is especially
> helpful.
>
> There was an earlier discussion about augmenting the audit logging from
> this function, so this might overlap with that. I don't know where
> that stands.
I have a new patch that I'm going to send soon that addresses this. But I also
have a second patch that fixes the setboolean auditing as well, but it
deadlocks the system. I talked about it with Paul and I have an idea on how to
fix the deadlock but I haven't sent the updated patches yet. I plan to get to
them later this week.
-Steve
> > goto out;
> > + }
> >
> > length = sel_make_bools();
> > - if (length)
> > + if (length) {
> > + pr_warn("SELinux: %s: failed to load policy
> > booleans\n",
> > + __func__);
> > goto out1;
> > + }
> >
> > length = sel_make_classes();
> > - if (length)
> > + if (length) {
> > + pr_warn("SELinux: %s: failed to load policy
> > classes\n",
> > + __func__);
> > goto out1;
> > + }
> >
> > length = sel_make_policycap();
> > - if (length)
> > + if (length) {
> > + pr_warn("SELinux: %s: failed to load policy
> > capabilities\n",
> > + __func__);
> > goto out1;
> > + }
> >
> > length = count;
> >
> > @@ -1299,9 +1311,13 @@ static int sel_make_bools(void)
> >
> > isec = (struct inode_security_struct *)inode-
> >
> > >i_security;
> >
> > ret = security_genfs_sid("selinuxfs", page,
> > SECCLASS_FILE, &sid);
> > - if (ret)
> > + if (ret) {
> > + pr_warn_ratelimited("SELinux: %s: failed to
> > lookup sid for %s\n",
> > + __func__, page);
> > goto out;
> >
> > + }
> > +
> > isec->sid = sid;
> > isec->initialized = LABEL_INITIALIZED;
> > inode->i_fop = &sel_bool_ops;
^ permalink raw reply [flat|nested] 48+ messages in thread* Re: [PATCH 1/2] selinux: log errors when loading new policy
@ 2016-12-19 15:08 ` Steve Grubb
0 siblings, 0 replies; 48+ messages in thread
From: Steve Grubb @ 2016-12-19 15:08 UTC (permalink / raw)
To: Stephen Smalley; +Cc: Gary Tierney, selinux, paul, linux-audit
On Monday, December 19, 2016 9:43:06 AM EST Stephen Smalley wrote:
> On Sat, 2016-12-17 at 20:48 +0000, Gary Tierney wrote:
> > Adds error and warning messages to the codepaths which can fail when
> > loading a new policy. If a policy fails to load, an error message
> > will
> > be printed to dmesg with a description of what failed. Previously if
> > there was an error during policy loading there would be no indication
> > that it failed.
> >
> > Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> > ---
> > security/selinux/selinuxfs.c | 26 +++++++++++++++++++++-----
> > 1 file changed, 21 insertions(+), 5 deletions(-)
> >
> > diff --git a/security/selinux/selinuxfs.c
> > b/security/selinux/selinuxfs.c
> > index 0aac402..2139cc7 100644
> > --- a/security/selinux/selinuxfs.c
> > +++ b/security/selinux/selinuxfs.c
> > @@ -522,20 +522,32 @@ static ssize_t sel_write_load(struct file
> > *file, const char __user *buf,
> > goto out;
> >
> > length = security_load_policy(data, count);
> > - if (length)
> > + if (length) {
> > + pr_err("SELinux: %s: failed to load policy\n",
> > + __func__);
>
> Not sure about your usage of pr_err() vs pr_warn();
> security_load_policy() may simply fail due to invalid policy from
> userspace, not a kernel-internal error per se.
>
> I would tend to omit the function name; I don't think it is especially
> helpful.
>
> There was an earlier discussion about augmenting the audit logging from
> this function, so this might overlap with that. I don't know where
> that stands.
I have a new patch that I'm going to send soon that addresses this. But I also
have a second patch that fixes the setboolean auditing as well, but it
deadlocks the system. I talked about it with Paul and I have an idea on how to
fix the deadlock but I haven't sent the updated patches yet. I plan to get to
them later this week.
-Steve
> > goto out;
> > + }
> >
> > length = sel_make_bools();
> > - if (length)
> > + if (length) {
> > + pr_warn("SELinux: %s: failed to load policy
> > booleans\n",
> > + __func__);
> > goto out1;
> > + }
> >
> > length = sel_make_classes();
> > - if (length)
> > + if (length) {
> > + pr_warn("SELinux: %s: failed to load policy
> > classes\n",
> > + __func__);
> > goto out1;
> > + }
> >
> > length = sel_make_policycap();
> > - if (length)
> > + if (length) {
> > + pr_warn("SELinux: %s: failed to load policy
> > capabilities\n",
> > + __func__);
> > goto out1;
> > + }
> >
> > length = count;
> >
> > @@ -1299,9 +1311,13 @@ static int sel_make_bools(void)
> >
> > isec = (struct inode_security_struct *)inode-
> >
> > >i_security;
> >
> > ret = security_genfs_sid("selinuxfs", page,
> > SECCLASS_FILE, &sid);
> > - if (ret)
> > + if (ret) {
> > + pr_warn_ratelimited("SELinux: %s: failed to
> > lookup sid for %s\n",
> > + __func__, page);
> > goto out;
> >
> > + }
> > +
> > isec->sid = sid;
> > isec->initialized = LABEL_INITIALIZED;
> > inode->i_fop = &sel_bool_ops;
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 1/2] selinux: log errors when loading new policy
2016-12-19 14:43 ` Stephen Smalley
@ 2016-12-19 15:19 ` Gary Tierney
-1 siblings, 0 replies; 48+ messages in thread
From: Gary Tierney @ 2016-12-19 15:19 UTC (permalink / raw)
To: sds; +Cc: selinux, linux-audit
On Mon, Dec 19, 2016 at 09:43:06AM -0500, Stephen Smalley wrote:
> On Sat, 2016-12-17 at 20:48 +0000, Gary Tierney wrote:
> > Adds error and warning messages to the codepaths which can fail when
> > loading a new policy. If a policy fails to load, an error message
> > will
> > be printed to dmesg with a description of what failed. Previously if
> > there was an error during policy loading there would be no indication
> > that it failed.
> >
> > Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> > ---
> > security/selinux/selinuxfs.c | 26 +++++++++++++++++++++-----
> > 1 file changed, 21 insertions(+), 5 deletions(-)
> >
> > diff --git a/security/selinux/selinuxfs.c
> > b/security/selinux/selinuxfs.c
> > index 0aac402..2139cc7 100644
> > --- a/security/selinux/selinuxfs.c
> > +++ b/security/selinux/selinuxfs.c
> > @@ -522,20 +522,32 @@ static ssize_t sel_write_load(struct file
> > *file, const char __user *buf,
> > goto out;
> >
> > length = security_load_policy(data, count);
> > - if (length)
> > + if (length) {
> > + pr_err("SELinux: %s: failed to load policy\n",
> > + __func__);
>
> Not sure about your usage of pr_err() vs pr_warn();
> security_load_policy() may simply fail due to invalid policy from
> userspace, not a kernel-internal error per se.
>
The intention was to make a distinction between failures on or after
security_load_policy(). If security_load_policy() fails then no audit message
will be logged about loading a new policy, so it seemed more appropriate to
treat that case as KERN_ERROR. Though with what you said in mind, it is
probably better to change this to pr_warn() as security_load_policy() is
unlikely to cause an actual kernel-internal error.
> I would tend to omit the function name; I don't think it is especially
> helpful.
>
Agreed. It seems to be used as a convention throughout security/selinux,
though am happy to drop it from the patch.
I was planning to send a v2 with pr_err() swapped for pr_warn() and __func__
dropped from the log message, though keeping in mind that Steve has prepared a
patch for this (also, logging to the audit subsystem might be more
appropriate) would it be better to drop #1 and keep #2?
> There was an earlier discussion about augmenting the audit logging from
> this function, so this might overlap with that. I don't know where
> that stands.
>
> > goto out;
> > + }
> >
> > length = sel_make_bools();
> > - if (length)
> > + if (length) {
> > + pr_warn("SELinux: %s: failed to load policy
> > booleans\n",
> > + __func__);
> > goto out1;
> > + }
> >
> > length = sel_make_classes();
> > - if (length)
> > + if (length) {
> > + pr_warn("SELinux: %s: failed to load policy
> > classes\n",
> > + __func__);
> > goto out1;
> > + }
> >
> > length = sel_make_policycap();
> > - if (length)
> > + if (length) {
> > + pr_warn("SELinux: %s: failed to load policy
> > capabilities\n",
> > + __func__);
> > goto out1;
> > + }
> >
> > length = count;
> >
> > @@ -1299,9 +1311,13 @@ static int sel_make_bools(void)
> >
> > isec = (struct inode_security_struct *)inode-
> > >i_security;
> > ret = security_genfs_sid("selinuxfs", page,
> > SECCLASS_FILE, &sid);
> > - if (ret)
> > + if (ret) {
> > + pr_warn_ratelimited("SELinux: %s: failed to
> > lookup sid for %s\n",
> > + __func__, page);
> > goto out;
> >
> > + }
> > +
> > isec->sid = sid;
> > isec->initialized = LABEL_INITIALIZED;
> > inode->i_fop = &sel_bool_ops;
--
Gary Tierney
GPG fingerprint: 412C 0EF9 C305 68E6 B660 BDAF 706E D765 85AA 79D8
https://sks-keyservers.net/pks/lookup?op=get&search=0x706ED76585AA79D8
^ permalink raw reply [flat|nested] 48+ messages in thread* Re: [PATCH 1/2] selinux: log errors when loading new policy
@ 2016-12-19 15:19 ` Gary Tierney
0 siblings, 0 replies; 48+ messages in thread
From: Gary Tierney @ 2016-12-19 15:19 UTC (permalink / raw)
To: sds; +Cc: sgrubb, paul, linux-audit, selinux
On Mon, Dec 19, 2016 at 09:43:06AM -0500, Stephen Smalley wrote:
> On Sat, 2016-12-17 at 20:48 +0000, Gary Tierney wrote:
> > Adds error and warning messages to the codepaths which can fail when
> > loading a new policy. If a policy fails to load, an error message
> > will
> > be printed to dmesg with a description of what failed. Previously if
> > there was an error during policy loading there would be no indication
> > that it failed.
> >
> > Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> > ---
> > security/selinux/selinuxfs.c | 26 +++++++++++++++++++++-----
> > 1 file changed, 21 insertions(+), 5 deletions(-)
> >
> > diff --git a/security/selinux/selinuxfs.c
> > b/security/selinux/selinuxfs.c
> > index 0aac402..2139cc7 100644
> > --- a/security/selinux/selinuxfs.c
> > +++ b/security/selinux/selinuxfs.c
> > @@ -522,20 +522,32 @@ static ssize_t sel_write_load(struct file
> > *file, const char __user *buf,
> > goto out;
> >
> > length = security_load_policy(data, count);
> > - if (length)
> > + if (length) {
> > + pr_err("SELinux: %s: failed to load policy\n",
> > + __func__);
>
> Not sure about your usage of pr_err() vs pr_warn();
> security_load_policy() may simply fail due to invalid policy from
> userspace, not a kernel-internal error per se.
>
The intention was to make a distinction between failures on or after
security_load_policy(). If security_load_policy() fails then no audit message
will be logged about loading a new policy, so it seemed more appropriate to
treat that case as KERN_ERROR. Though with what you said in mind, it is
probably better to change this to pr_warn() as security_load_policy() is
unlikely to cause an actual kernel-internal error.
> I would tend to omit the function name; I don't think it is especially
> helpful.
>
Agreed. It seems to be used as a convention throughout security/selinux,
though am happy to drop it from the patch.
I was planning to send a v2 with pr_err() swapped for pr_warn() and __func__
dropped from the log message, though keeping in mind that Steve has prepared a
patch for this (also, logging to the audit subsystem might be more
appropriate) would it be better to drop #1 and keep #2?
> There was an earlier discussion about augmenting the audit logging from
> this function, so this might overlap with that. I don't know where
> that stands.
>
> > goto out;
> > + }
> >
> > length = sel_make_bools();
> > - if (length)
> > + if (length) {
> > + pr_warn("SELinux: %s: failed to load policy
> > booleans\n",
> > + __func__);
> > goto out1;
> > + }
> >
> > length = sel_make_classes();
> > - if (length)
> > + if (length) {
> > + pr_warn("SELinux: %s: failed to load policy
> > classes\n",
> > + __func__);
> > goto out1;
> > + }
> >
> > length = sel_make_policycap();
> > - if (length)
> > + if (length) {
> > + pr_warn("SELinux: %s: failed to load policy
> > capabilities\n",
> > + __func__);
> > goto out1;
> > + }
> >
> > length = count;
> >
> > @@ -1299,9 +1311,13 @@ static int sel_make_bools(void)
> >
> > isec = (struct inode_security_struct *)inode-
> > >i_security;
> > ret = security_genfs_sid("selinuxfs", page,
> > SECCLASS_FILE, &sid);
> > - if (ret)
> > + if (ret) {
> > + pr_warn_ratelimited("SELinux: %s: failed to
> > lookup sid for %s\n",
> > + __func__, page);
> > goto out;
> >
> > + }
> > +
> > isec->sid = sid;
> > isec->initialized = LABEL_INITIALIZED;
> > inode->i_fop = &sel_bool_ops;
--
Gary Tierney
GPG fingerprint: 412C 0EF9 C305 68E6 B660 BDAF 706E D765 85AA 79D8
https://sks-keyservers.net/pks/lookup?op=get&search=0x706ED76585AA79D8
^ permalink raw reply [flat|nested] 48+ messages in thread* Re: [PATCH 1/2] selinux: log errors when loading new policy
2016-12-19 15:19 ` Gary Tierney
@ 2016-12-19 15:32 ` Stephen Smalley
-1 siblings, 0 replies; 48+ messages in thread
From: Stephen Smalley @ 2016-12-19 15:32 UTC (permalink / raw)
To: Gary Tierney; +Cc: selinux, linux-audit
On Mon, 2016-12-19 at 15:19 +0000, Gary Tierney wrote:
> On Mon, Dec 19, 2016 at 09:43:06AM -0500, Stephen Smalley wrote:
> >
> > On Sat, 2016-12-17 at 20:48 +0000, Gary Tierney wrote:
> > >
> > > Adds error and warning messages to the codepaths which can fail
> > > when
> > > loading a new policy. If a policy fails to load, an error
> > > message
> > > will
> > > be printed to dmesg with a description of what
> > > failed. Previously if
> > > there was an error during policy loading there would be no
> > > indication
> > > that it failed.
> > >
> > > Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> > > ---
> > > security/selinux/selinuxfs.c | 26 +++++++++++++++++++++-----
> > > 1 file changed, 21 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/security/selinux/selinuxfs.c
> > > b/security/selinux/selinuxfs.c
> > > index 0aac402..2139cc7 100644
> > > --- a/security/selinux/selinuxfs.c
> > > +++ b/security/selinux/selinuxfs.c
> > > @@ -522,20 +522,32 @@ static ssize_t sel_write_load(struct file
> > > *file, const char __user *buf,
> > > goto out;
> > >
> > > length = security_load_policy(data, count);
> > > - if (length)
> > > + if (length) {
> > > + pr_err("SELinux: %s: failed to load policy\n",
> > > + __func__);
> >
> > Not sure about your usage of pr_err() vs pr_warn();
> > security_load_policy() may simply fail due to invalid policy from
> > userspace, not a kernel-internal error per se.
> >
>
> The intention was to make a distinction between failures on or after
> security_load_policy(). If security_load_policy() fails then no
> audit message
> will be logged about loading a new policy, so it seemed more
> appropriate to
> treat that case as KERN_ERROR. Though with what you said in mind, it
> is
> probably better to change this to pr_warn() as security_load_policy()
> is
> unlikely to cause an actual kernel-internal error.
Yes, I tend to view them in the reverse; a failure on
security_load_policy() is just a typical userspace-induced (or OOM)
failure, whereas failure on any of the later calls will leave the
kernel in an inconsistent internal state, so if anything, those should
be the pr_err() cases instead, while security_load_policy() failure
might even need/want a pr_warn_ratelimited() since it can be induced by
userspace (albeit only root with :security load_policy permission).
>
> >
> > I would tend to omit the function name; I don't think it is
> > especially
> > helpful.
> >
>
> Agreed. It seems to be used as a convention throughout
> security/selinux,
> though am happy to drop it from the patch.
>
> I was planning to send a v2 with pr_err() swapped for pr_warn() and
> __func__
> dropped from the log message, though keeping in mind that Steve has
> prepared a
> patch for this (also, logging to the audit subsystem might be more
> appropriate) would it be better to drop #1 and keep #2?
Not sure - I'd have to see Steve's patch or at least hear more details
from him to know whether his patch would obsolete yours or just
complement it.
>
> >
> > There was an earlier discussion about augmenting the audit logging
> > from
> > this function, so this might overlap with that. I don't know where
> > that stands.
> >
> > >
> > > goto out;
> > > + }
> > >
> > > length = sel_make_bools();
> > > - if (length)
> > > + if (length) {
> > > + pr_warn("SELinux: %s: failed to load policy
> > > booleans\n",
> > > + __func__);
> > > goto out1;
> > > + }
> > >
> > > length = sel_make_classes();
> > > - if (length)
> > > + if (length) {
> > > + pr_warn("SELinux: %s: failed to load policy
> > > classes\n",
> > > + __func__);
> > > goto out1;
> > > + }
> > >
> > > length = sel_make_policycap();
> > > - if (length)
> > > + if (length) {
> > > + pr_warn("SELinux: %s: failed to load policy
> > > capabilities\n",
> > > + __func__);
> > > goto out1;
> > > + }
> > >
> > > length = count;
> > >
> > > @@ -1299,9 +1311,13 @@ static int sel_make_bools(void)
> > >
> > > isec = (struct inode_security_struct *)inode-
> > > >
> > > > i_security;
> > > ret = security_genfs_sid("selinuxfs", page,
> > > SECCLASS_FILE, &sid);
> > > - if (ret)
> > > + if (ret) {
> > > + pr_warn_ratelimited("SELinux: %s: failed
> > > to
> > > lookup sid for %s\n",
> > > + __func__, page);
> > > goto out;
> > >
> > > + }
> > > +
> > > isec->sid = sid;
> > > isec->initialized = LABEL_INITIALIZED;
> > > inode->i_fop = &sel_bool_ops;
>
--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit
^ permalink raw reply [flat|nested] 48+ messages in thread* Re: [PATCH 1/2] selinux: log errors when loading new policy
@ 2016-12-19 15:32 ` Stephen Smalley
0 siblings, 0 replies; 48+ messages in thread
From: Stephen Smalley @ 2016-12-19 15:32 UTC (permalink / raw)
To: Gary Tierney; +Cc: sgrubb, paul, linux-audit, selinux
On Mon, 2016-12-19 at 15:19 +0000, Gary Tierney wrote:
> On Mon, Dec 19, 2016 at 09:43:06AM -0500, Stephen Smalley wrote:
> >
> > On Sat, 2016-12-17 at 20:48 +0000, Gary Tierney wrote:
> > >
> > > Adds error and warning messages to the codepaths which can fail
> > > when
> > > loading a new policy. If a policy fails to load, an error
> > > message
> > > will
> > > be printed to dmesg with a description of what
> > > failed. Previously if
> > > there was an error during policy loading there would be no
> > > indication
> > > that it failed.
> > >
> > > Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> > > ---
> > > security/selinux/selinuxfs.c | 26 +++++++++++++++++++++-----
> > > 1 file changed, 21 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/security/selinux/selinuxfs.c
> > > b/security/selinux/selinuxfs.c
> > > index 0aac402..2139cc7 100644
> > > --- a/security/selinux/selinuxfs.c
> > > +++ b/security/selinux/selinuxfs.c
> > > @@ -522,20 +522,32 @@ static ssize_t sel_write_load(struct file
> > > *file, const char __user *buf,
> > > goto out;
> > >
> > > length = security_load_policy(data, count);
> > > - if (length)
> > > + if (length) {
> > > + pr_err("SELinux: %s: failed to load policy\n",
> > > + __func__);
> >
> > Not sure about your usage of pr_err() vs pr_warn();
> > security_load_policy() may simply fail due to invalid policy from
> > userspace, not a kernel-internal error per se.
> >
>
> The intention was to make a distinction between failures on or after
> security_load_policy(). If security_load_policy() fails then no
> audit message
> will be logged about loading a new policy, so it seemed more
> appropriate to
> treat that case as KERN_ERROR. Though with what you said in mind, it
> is
> probably better to change this to pr_warn() as security_load_policy()
> is
> unlikely to cause an actual kernel-internal error.
Yes, I tend to view them in the reverse; a failure on
security_load_policy() is just a typical userspace-induced (or OOM)
failure, whereas failure on any of the later calls will leave the
kernel in an inconsistent internal state, so if anything, those should
be the pr_err() cases instead, while security_load_policy() failure
might even need/want a pr_warn_ratelimited() since it can be induced by
userspace (albeit only root with :security load_policy permission).
>
> >
> > I would tend to omit the function name; I don't think it is
> > especially
> > helpful.
> >
>
> Agreed. It seems to be used as a convention throughout
> security/selinux,
> though am happy to drop it from the patch.
>
> I was planning to send a v2 with pr_err() swapped for pr_warn() and
> __func__
> dropped from the log message, though keeping in mind that Steve has
> prepared a
> patch for this (also, logging to the audit subsystem might be more
> appropriate) would it be better to drop #1 and keep #2?
Not sure - I'd have to see Steve's patch or at least hear more details
from him to know whether his patch would obsolete yours or just
complement it.
>
> >
> > There was an earlier discussion about augmenting the audit logging
> > from
> > this function, so this might overlap with that. I don't know where
> > that stands.
> >
> > >
> > > goto out;
> > > + }
> > >
> > > length = sel_make_bools();
> > > - if (length)
> > > + if (length) {
> > > + pr_warn("SELinux: %s: failed to load policy
> > > booleans\n",
> > > + __func__);
> > > goto out1;
> > > + }
> > >
> > > length = sel_make_classes();
> > > - if (length)
> > > + if (length) {
> > > + pr_warn("SELinux: %s: failed to load policy
> > > classes\n",
> > > + __func__);
> > > goto out1;
> > > + }
> > >
> > > length = sel_make_policycap();
> > > - if (length)
> > > + if (length) {
> > > + pr_warn("SELinux: %s: failed to load policy
> > > capabilities\n",
> > > + __func__);
> > > goto out1;
> > > + }
> > >
> > > length = count;
> > >
> > > @@ -1299,9 +1311,13 @@ static int sel_make_bools(void)
> > >
> > > isec = (struct inode_security_struct *)inode-
> > > >
> > > > i_security;
> > > ret = security_genfs_sid("selinuxfs", page,
> > > SECCLASS_FILE, &sid);
> > > - if (ret)
> > > + if (ret) {
> > > + pr_warn_ratelimited("SELinux: %s: failed
> > > to
> > > lookup sid for %s\n",
> > > + __func__, page);
> > > goto out;
> > >
> > > + }
> > > +
> > > isec->sid = sid;
> > > isec->initialized = LABEL_INITIALIZED;
> > > inode->i_fop = &sel_bool_ops;
>
^ permalink raw reply [flat|nested] 48+ messages in thread* Re: [PATCH 1/2] selinux: log errors when loading new policy
2016-12-19 15:32 ` Stephen Smalley
@ 2016-12-19 16:00 ` Gary Tierney
-1 siblings, 0 replies; 48+ messages in thread
From: Gary Tierney @ 2016-12-19 16:00 UTC (permalink / raw)
To: sds; +Cc: selinux, linux-audit
On Mon, Dec 19, 2016 at 10:32:09AM -0500, Stephen Smalley wrote:
> On Mon, 2016-12-19 at 15:19 +0000, Gary Tierney wrote:
> > On Mon, Dec 19, 2016 at 09:43:06AM -0500, Stephen Smalley wrote:
> > >
> > > On Sat, 2016-12-17 at 20:48 +0000, Gary Tierney wrote:
> > > >
> > > > Adds error and warning messages to the codepaths which can fail
> > > > when
> > > > loading a new policy. If a policy fails to load, an error
> > > > message
> > > > will
> > > > be printed to dmesg with a description of what
> > > > failed. Previously if
> > > > there was an error during policy loading there would be no
> > > > indication
> > > > that it failed.
> > > >
> > > > Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> > > > ---
> > > > security/selinux/selinuxfs.c | 26 +++++++++++++++++++++-----
> > > > 1 file changed, 21 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/security/selinux/selinuxfs.c
> > > > b/security/selinux/selinuxfs.c
> > > > index 0aac402..2139cc7 100644
> > > > --- a/security/selinux/selinuxfs.c
> > > > +++ b/security/selinux/selinuxfs.c
> > > > @@ -522,20 +522,32 @@ static ssize_t sel_write_load(struct file
> > > > *file, const char __user *buf,
> > > > goto out;
> > > >
> > > > length = security_load_policy(data, count);
> > > > - if (length)
> > > > + if (length) {
> > > > + pr_err("SELinux: %s: failed to load policy\n",
> > > > + __func__);
> > >
> > > Not sure about your usage of pr_err() vs pr_warn();
> > > security_load_policy() may simply fail due to invalid policy from
> > > userspace, not a kernel-internal error per se.
> > >
> >
> > The intention was to make a distinction between failures on or after
> > security_load_policy(). If security_load_policy() fails then no
> > audit message
> > will be logged about loading a new policy, so it seemed more
> > appropriate to
> > treat that case as KERN_ERROR. Though with what you said in mind, it
> > is
> > probably better to change this to pr_warn() as security_load_policy()
> > is
> > unlikely to cause an actual kernel-internal error.
>
> Yes, I tend to view them in the reverse; a failure on
> security_load_policy() is just a typical userspace-induced (or OOM)
> failure, whereas failure on any of the later calls will leave the
> kernel in an inconsistent internal state, so if anything, those should
> be the pr_err() cases instead, while security_load_policy() failure
> might even need/want a pr_warn_ratelimited() since it can be induced by
> userspace (albeit only root with :security load_policy permission).
>
Noted.
> >
> > >
> > > I would tend to omit the function name; I don't think it is
> > > especially
> > > helpful.
> > >
> >
> > Agreed. It seems to be used as a convention throughout
> > security/selinux,
> > though am happy to drop it from the patch.
> >
> > I was planning to send a v2 with pr_err() swapped for pr_warn() and
> > __func__
> > dropped from the log message, though keeping in mind that Steve has
> > prepared a
> > patch for this (also, logging to the audit subsystem might be more
> > appropriate) would it be better to drop #1 and keep #2?
>
> Not sure - I'd have to see Steve's patch or at least hear more details
> from him to know whether his patch would obsolete yours or just
> complement it.
>
Right, I'll spin up a v2 with the recommended changes and CC in Steve for his
feedback.
> >
> > >
> > > There was an earlier discussion about augmenting the audit logging
> > > from
> > > this function, so this might overlap with that. I don't know where
> > > that stands.
> > >
> > > >
> > > > goto out;
> > > > + }
> > > >
> > > > length = sel_make_bools();
> > > > - if (length)
> > > > + if (length) {
> > > > + pr_warn("SELinux: %s: failed to load policy
> > > > booleans\n",
> > > > + __func__);
> > > > goto out1;
> > > > + }
> > > >
> > > > length = sel_make_classes();
> > > > - if (length)
> > > > + if (length) {
> > > > + pr_warn("SELinux: %s: failed to load policy
> > > > classes\n",
> > > > + __func__);
> > > > goto out1;
> > > > + }
> > > >
> > > > length = sel_make_policycap();
> > > > - if (length)
> > > > + if (length) {
> > > > + pr_warn("SELinux: %s: failed to load policy
> > > > capabilities\n",
> > > > + __func__);
> > > > goto out1;
> > > > + }
> > > >
> > > > length = count;
> > > >
> > > > @@ -1299,9 +1311,13 @@ static int sel_make_bools(void)
> > > >
> > > > isec = (struct inode_security_struct *)inode-
> > > > >
> > > > > i_security;
> > > > ret = security_genfs_sid("selinuxfs", page,
> > > > SECCLASS_FILE, &sid);
> > > > - if (ret)
> > > > + if (ret) {
> > > > + pr_warn_ratelimited("SELinux: %s: failed
> > > > to
> > > > lookup sid for %s\n",
> > > > + __func__, page);
> > > > goto out;
> > > >
> > > > + }
> > > > +
> > > > isec->sid = sid;
> > > > isec->initialized = LABEL_INITIALIZED;
> > > > inode->i_fop = &sel_bool_ops;
> >
--
Gary Tierney
GPG fingerprint: 412C 0EF9 C305 68E6 B660 BDAF 706E D765 85AA 79D8
https://sks-keyservers.net/pks/lookup?op=get&search=0x706ED76585AA79D8
^ permalink raw reply [flat|nested] 48+ messages in thread* Re: [PATCH 1/2] selinux: log errors when loading new policy
@ 2016-12-19 16:00 ` Gary Tierney
0 siblings, 0 replies; 48+ messages in thread
From: Gary Tierney @ 2016-12-19 16:00 UTC (permalink / raw)
To: sds; +Cc: selinux, paul, sgrubb, linux-audit
On Mon, Dec 19, 2016 at 10:32:09AM -0500, Stephen Smalley wrote:
> On Mon, 2016-12-19 at 15:19 +0000, Gary Tierney wrote:
> > On Mon, Dec 19, 2016 at 09:43:06AM -0500, Stephen Smalley wrote:
> > >
> > > On Sat, 2016-12-17 at 20:48 +0000, Gary Tierney wrote:
> > > >
> > > > Adds error and warning messages to the codepaths which can fail
> > > > when
> > > > loading a new policy. If a policy fails to load, an error
> > > > message
> > > > will
> > > > be printed to dmesg with a description of what
> > > > failed. Previously if
> > > > there was an error during policy loading there would be no
> > > > indication
> > > > that it failed.
> > > >
> > > > Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> > > > ---
> > > > security/selinux/selinuxfs.c | 26 +++++++++++++++++++++-----
> > > > 1 file changed, 21 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/security/selinux/selinuxfs.c
> > > > b/security/selinux/selinuxfs.c
> > > > index 0aac402..2139cc7 100644
> > > > --- a/security/selinux/selinuxfs.c
> > > > +++ b/security/selinux/selinuxfs.c
> > > > @@ -522,20 +522,32 @@ static ssize_t sel_write_load(struct file
> > > > *file, const char __user *buf,
> > > > goto out;
> > > >
> > > > length = security_load_policy(data, count);
> > > > - if (length)
> > > > + if (length) {
> > > > + pr_err("SELinux: %s: failed to load policy\n",
> > > > + __func__);
> > >
> > > Not sure about your usage of pr_err() vs pr_warn();
> > > security_load_policy() may simply fail due to invalid policy from
> > > userspace, not a kernel-internal error per se.
> > >
> >
> > The intention was to make a distinction between failures on or after
> > security_load_policy(). If security_load_policy() fails then no
> > audit message
> > will be logged about loading a new policy, so it seemed more
> > appropriate to
> > treat that case as KERN_ERROR. Though with what you said in mind, it
> > is
> > probably better to change this to pr_warn() as security_load_policy()
> > is
> > unlikely to cause an actual kernel-internal error.
>
> Yes, I tend to view them in the reverse; a failure on
> security_load_policy() is just a typical userspace-induced (or OOM)
> failure, whereas failure on any of the later calls will leave the
> kernel in an inconsistent internal state, so if anything, those should
> be the pr_err() cases instead, while security_load_policy() failure
> might even need/want a pr_warn_ratelimited() since it can be induced by
> userspace (albeit only root with :security load_policy permission).
>
Noted.
> >
> > >
> > > I would tend to omit the function name; I don't think it is
> > > especially
> > > helpful.
> > >
> >
> > Agreed. It seems to be used as a convention throughout
> > security/selinux,
> > though am happy to drop it from the patch.
> >
> > I was planning to send a v2 with pr_err() swapped for pr_warn() and
> > __func__
> > dropped from the log message, though keeping in mind that Steve has
> > prepared a
> > patch for this (also, logging to the audit subsystem might be more
> > appropriate) would it be better to drop #1 and keep #2?
>
> Not sure - I'd have to see Steve's patch or at least hear more details
> from him to know whether his patch would obsolete yours or just
> complement it.
>
Right, I'll spin up a v2 with the recommended changes and CC in Steve for his
feedback.
> >
> > >
> > > There was an earlier discussion about augmenting the audit logging
> > > from
> > > this function, so this might overlap with that. I don't know where
> > > that stands.
> > >
> > > >
> > > > goto out;
> > > > + }
> > > >
> > > > length = sel_make_bools();
> > > > - if (length)
> > > > + if (length) {
> > > > + pr_warn("SELinux: %s: failed to load policy
> > > > booleans\n",
> > > > + __func__);
> > > > goto out1;
> > > > + }
> > > >
> > > > length = sel_make_classes();
> > > > - if (length)
> > > > + if (length) {
> > > > + pr_warn("SELinux: %s: failed to load policy
> > > > classes\n",
> > > > + __func__);
> > > > goto out1;
> > > > + }
> > > >
> > > > length = sel_make_policycap();
> > > > - if (length)
> > > > + if (length) {
> > > > + pr_warn("SELinux: %s: failed to load policy
> > > > capabilities\n",
> > > > + __func__);
> > > > goto out1;
> > > > + }
> > > >
> > > > length = count;
> > > >
> > > > @@ -1299,9 +1311,13 @@ static int sel_make_bools(void)
> > > >
> > > > isec = (struct inode_security_struct *)inode-
> > > > >
> > > > > i_security;
> > > > ret = security_genfs_sid("selinuxfs", page,
> > > > SECCLASS_FILE, &sid);
> > > > - if (ret)
> > > > + if (ret) {
> > > > + pr_warn_ratelimited("SELinux: %s: failed
> > > > to
> > > > lookup sid for %s\n",
> > > > + __func__, page);
> > > > goto out;
> > > >
> > > > + }
> > > > +
> > > > isec->sid = sid;
> > > > isec->initialized = LABEL_INITIALIZED;
> > > > inode->i_fop = &sel_bool_ops;
> >
--
Gary Tierney
GPG fingerprint: 412C 0EF9 C305 68E6 B660 BDAF 706E D765 85AA 79D8
https://sks-keyservers.net/pks/lookup?op=get&search=0x706ED76585AA79D8
^ permalink raw reply [flat|nested] 48+ messages in thread* [PATCH v2 0/2]
2016-12-19 16:00 ` Gary Tierney
(?)
@ 2016-12-20 1:28 ` Gary Tierney
2016-12-20 1:28 ` [PATCH v2 1/2] selinux: log errors when loading new policy Gary Tierney
` (2 more replies)
-1 siblings, 3 replies; 48+ messages in thread
From: Gary Tierney @ 2016-12-20 1:28 UTC (permalink / raw)
To: selinux, sds, sgrubb
Have updated the patches to print error messages for failures which result in
indeterminate state and warnings for failures to load policy from userspace.
Also updated the patches to remove the function name from log messages.
Steve,
Does your work on AUDIT_MAC_STATUS_FAIL/AUDIT_MAC_LOAD_FAIL messages (I'm
assuming that's what Stephen's referencing in his previous mail) obsolete the
printk logs in the first patch? An AUDIT_MAC_POLICY_LOAD message would still
be logged presently even if one of sel_make_{bools,classes,policycap} fails, so
I'm not sure if you would also want an
AUDIT_MAC_STATUS_FAIL/AUDIT_MAC_LOAD_FAIL message when that happens, though I
think you might want one in the first case when security_load_policy() fails
(or anything up until that point).
Gary Tierney (2):
selinux: log errors when loading new policy
selinux: default to security isid in sel_make_bools() if no sid is
found
security/selinux/selinuxfs.c | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 48+ messages in thread* [PATCH v2 1/2] selinux: log errors when loading new policy
2016-12-20 1:28 ` [PATCH v2 0/2] Gary Tierney
@ 2016-12-20 1:28 ` Gary Tierney
2016-12-20 15:30 ` Stephen Smalley
2016-12-23 21:14 ` Paul Moore
2016-12-20 1:28 ` [PATCH v2 2/2] selinux: default to security isid in sel_make_bools() if no sid is found Gary Tierney
2016-12-20 3:15 ` [PATCH v2 0/2] Steve Grubb
2 siblings, 2 replies; 48+ messages in thread
From: Gary Tierney @ 2016-12-20 1:28 UTC (permalink / raw)
To: selinux, sds, sgrubb
Adds error logging to the code paths which can fail when loading a new
policy in sel_write_load(). If the policy fails to be loaded from
userspace then a warning message is printed, whereas if a failure occurs
after loading policy from userspace an error message will be printed
with details on where policy loading failed (recreating one of /classes/,
/policy_capabilities/, /booleans/ in the SELinux fs).
Also, if sel_make_bools() fails to obtain an SID for an entry in
/booleans/* an error will be printed indicating the path of the
boolean.
Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
---
security/selinux/selinuxfs.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 0aac402..e667c34 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -522,20 +522,28 @@ static ssize_t sel_write_load(struct file *file, const char __user *buf,
goto out;
length = security_load_policy(data, count);
- if (length)
+ if (length) {
+ pr_warn_ratelimited("SELinux: failed to load policy\n");
goto out;
+ }
length = sel_make_bools();
- if (length)
+ if (length) {
+ pr_err("SELinux: failed to load policy booleans\n");
goto out1;
+ }
length = sel_make_classes();
- if (length)
+ if (length) {
+ pr_err("SELinux: failed to load policy classes\n");
goto out1;
+ }
length = sel_make_policycap();
- if (length)
+ if (length) {
+ pr_err("SELinux: failed to load policy capabilities\n");
goto out1;
+ }
length = count;
@@ -1299,9 +1307,12 @@ static int sel_make_bools(void)
isec = (struct inode_security_struct *)inode->i_security;
ret = security_genfs_sid("selinuxfs", page, SECCLASS_FILE, &sid);
- if (ret)
+ if (ret) {
+ pr_err("SELinux: failed to lookup sid for %s\n", page);
goto out;
+ }
+
isec->sid = sid;
isec->initialized = LABEL_INITIALIZED;
inode->i_fop = &sel_bool_ops;
--
2.7.4
^ permalink raw reply related [flat|nested] 48+ messages in thread* Re: [PATCH v2 1/2] selinux: log errors when loading new policy
2016-12-20 1:28 ` [PATCH v2 1/2] selinux: log errors when loading new policy Gary Tierney
@ 2016-12-20 15:30 ` Stephen Smalley
2016-12-23 21:14 ` Paul Moore
1 sibling, 0 replies; 48+ messages in thread
From: Stephen Smalley @ 2016-12-20 15:30 UTC (permalink / raw)
To: Gary Tierney, selinux, sgrubb
On Tue, 2016-12-20 at 01:28 +0000, Gary Tierney wrote:
> Adds error logging to the code paths which can fail when loading a
> new
> policy in sel_write_load(). If the policy fails to be loaded from
> userspace then a warning message is printed, whereas if a failure
> occurs
> after loading policy from userspace an error message will be printed
> with details on where policy loading failed (recreating one of
> /classes/,
> /policy_capabilities/, /booleans/ in the SELinux fs).
>
> Also, if sel_make_bools() fails to obtain an SID for an entry in
> /booleans/* an error will be printed indicating the path of the
> boolean.
>
> Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
> ---
> security/selinux/selinuxfs.c | 21 ++++++++++++++++-----
> 1 file changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/security/selinux/selinuxfs.c
> b/security/selinux/selinuxfs.c
> index 0aac402..e667c34 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -522,20 +522,28 @@ static ssize_t sel_write_load(struct file
> *file, const char __user *buf,
> goto out;
>
> length = security_load_policy(data, count);
> - if (length)
> + if (length) {
> + pr_warn_ratelimited("SELinux: failed to load
> policy\n");
> goto out;
> + }
>
> length = sel_make_bools();
> - if (length)
> + if (length) {
> + pr_err("SELinux: failed to load policy booleans\n");
> goto out1;
> + }
>
> length = sel_make_classes();
> - if (length)
> + if (length) {
> + pr_err("SELinux: failed to load policy classes\n");
> goto out1;
> + }
>
> length = sel_make_policycap();
> - if (length)
> + if (length) {
> + pr_err("SELinux: failed to load policy
> capabilities\n");
> goto out1;
> + }
>
> length = count;
>
> @@ -1299,9 +1307,12 @@ static int sel_make_bools(void)
>
> isec = (struct inode_security_struct *)inode-
> >i_security;
> ret = security_genfs_sid("selinuxfs", page,
> SECCLASS_FILE, &sid);
> - if (ret)
> + if (ret) {
> + pr_err("SELinux: failed to lookup sid for
> %s\n", page);
> goto out;
>
> + }
> +
> isec->sid = sid;
> isec->initialized = LABEL_INITIALIZED;
> inode->i_fop = &sel_bool_ops;
^ permalink raw reply [flat|nested] 48+ messages in thread* Re: [PATCH v2 1/2] selinux: log errors when loading new policy
2016-12-20 1:28 ` [PATCH v2 1/2] selinux: log errors when loading new policy Gary Tierney
2016-12-20 15:30 ` Stephen Smalley
@ 2016-12-23 21:14 ` Paul Moore
1 sibling, 0 replies; 48+ messages in thread
From: Paul Moore @ 2016-12-23 21:14 UTC (permalink / raw)
To: Gary Tierney; +Cc: selinux, Stephen Smalley, sgrubb
On Mon, Dec 19, 2016 at 8:28 PM, Gary Tierney <gary.tierney@gmx.com> wrote:
> Adds error logging to the code paths which can fail when loading a new
> policy in sel_write_load(). If the policy fails to be loaded from
> userspace then a warning message is printed, whereas if a failure occurs
> after loading policy from userspace an error message will be printed
> with details on where policy loading failed (recreating one of /classes/,
> /policy_capabilities/, /booleans/ in the SELinux fs).
>
> Also, if sel_make_bools() fails to obtain an SID for an entry in
> /booleans/* an error will be printed indicating the path of the
> boolean.
>
> Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> ---
> security/selinux/selinuxfs.c | 21 ++++++++++++++++-----
> 1 file changed, 16 insertions(+), 5 deletions(-)
My apologies for the delay, this looks good to me - merged. Thanks.
> diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
> index 0aac402..e667c34 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -522,20 +522,28 @@ static ssize_t sel_write_load(struct file *file, const char __user *buf,
> goto out;
>
> length = security_load_policy(data, count);
> - if (length)
> + if (length) {
> + pr_warn_ratelimited("SELinux: failed to load policy\n");
> goto out;
> + }
>
> length = sel_make_bools();
> - if (length)
> + if (length) {
> + pr_err("SELinux: failed to load policy booleans\n");
> goto out1;
> + }
>
> length = sel_make_classes();
> - if (length)
> + if (length) {
> + pr_err("SELinux: failed to load policy classes\n");
> goto out1;
> + }
>
> length = sel_make_policycap();
> - if (length)
> + if (length) {
> + pr_err("SELinux: failed to load policy capabilities\n");
> goto out1;
> + }
>
> length = count;
>
> @@ -1299,9 +1307,12 @@ static int sel_make_bools(void)
>
> isec = (struct inode_security_struct *)inode->i_security;
> ret = security_genfs_sid("selinuxfs", page, SECCLASS_FILE, &sid);
> - if (ret)
> + if (ret) {
> + pr_err("SELinux: failed to lookup sid for %s\n", page);
> goto out;
>
> + }
> +
> isec->sid = sid;
> isec->initialized = LABEL_INITIALIZED;
> inode->i_fop = &sel_bool_ops;
> --
> 2.7.4
>
--
paul moore
www.paul-moore.com
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH v2 2/2] selinux: default to security isid in sel_make_bools() if no sid is found
2016-12-20 1:28 ` [PATCH v2 0/2] Gary Tierney
2016-12-20 1:28 ` [PATCH v2 1/2] selinux: log errors when loading new policy Gary Tierney
@ 2016-12-20 1:28 ` Gary Tierney
2016-12-20 15:31 ` Stephen Smalley
2016-12-23 21:20 ` Paul Moore
2016-12-20 3:15 ` [PATCH v2 0/2] Steve Grubb
2 siblings, 2 replies; 48+ messages in thread
From: Gary Tierney @ 2016-12-20 1:28 UTC (permalink / raw)
To: selinux, sds, sgrubb
Use SECINITSID_SECURITY as the default SID for booleans which don't have
a matching SID returned from security_genfs_sid(), also update the
error message to a warning which matches this.
This prevents the policy failing to load (and consequently the system
failing to boot) when there is no default genfscon statement matched for
the selinuxfs in the new policy.
Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
---
security/selinux/selinuxfs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index e667c34..616a8d2 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -1308,9 +1308,9 @@ static int sel_make_bools(void)
isec = (struct inode_security_struct *)inode->i_security;
ret = security_genfs_sid("selinuxfs", page, SECCLASS_FILE, &sid);
if (ret) {
- pr_err("SELinux: failed to lookup sid for %s\n", page);
- goto out;
-
+ pr_warn_ratelimited("SELinux: no sid found, defaulting to security isid for %s\n",
+ page);
+ sid = SECINITSID_SECURITY;
}
isec->sid = sid;
--
2.7.4
^ permalink raw reply related [flat|nested] 48+ messages in thread* Re: [PATCH v2 2/2] selinux: default to security isid in sel_make_bools() if no sid is found
2016-12-20 1:28 ` [PATCH v2 2/2] selinux: default to security isid in sel_make_bools() if no sid is found Gary Tierney
@ 2016-12-20 15:31 ` Stephen Smalley
2016-12-23 21:20 ` Paul Moore
1 sibling, 0 replies; 48+ messages in thread
From: Stephen Smalley @ 2016-12-20 15:31 UTC (permalink / raw)
To: Gary Tierney, selinux, sgrubb
On Tue, 2016-12-20 at 01:28 +0000, Gary Tierney wrote:
> Use SECINITSID_SECURITY as the default SID for booleans which don't
> have
> a matching SID returned from security_genfs_sid(), also update the
> error message to a warning which matches this.
>
> This prevents the policy failing to load (and consequently the system
> failing to boot) when there is no default genfscon statement matched
> for
> the selinuxfs in the new policy.
>
> Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
> ---
> security/selinux/selinuxfs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/security/selinux/selinuxfs.c
> b/security/selinux/selinuxfs.c
> index e667c34..616a8d2 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -1308,9 +1308,9 @@ static int sel_make_bools(void)
> isec = (struct inode_security_struct *)inode-
> >i_security;
> ret = security_genfs_sid("selinuxfs", page,
> SECCLASS_FILE, &sid);
> if (ret) {
> - pr_err("SELinux: failed to lookup sid for
> %s\n", page);
> - goto out;
> -
> + pr_warn_ratelimited("SELinux: no sid found,
> defaulting to security isid for %s\n",
> + page);
> + sid = SECINITSID_SECURITY;
> }
>
> isec->sid = sid;
^ permalink raw reply [flat|nested] 48+ messages in thread* Re: [PATCH v2 2/2] selinux: default to security isid in sel_make_bools() if no sid is found
2016-12-20 1:28 ` [PATCH v2 2/2] selinux: default to security isid in sel_make_bools() if no sid is found Gary Tierney
2016-12-20 15:31 ` Stephen Smalley
@ 2016-12-23 21:20 ` Paul Moore
1 sibling, 0 replies; 48+ messages in thread
From: Paul Moore @ 2016-12-23 21:20 UTC (permalink / raw)
To: Gary Tierney; +Cc: selinux, Stephen Smalley, sgrubb
On Mon, Dec 19, 2016 at 8:28 PM, Gary Tierney <gary.tierney@gmx.com> wrote:
> Use SECINITSID_SECURITY as the default SID for booleans which don't have
> a matching SID returned from security_genfs_sid(), also update the
> error message to a warning which matches this.
>
> This prevents the policy failing to load (and consequently the system
> failing to boot) when there is no default genfscon statement matched for
> the selinuxfs in the new policy.
>
> Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> ---
> security/selinux/selinuxfs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Also merged, thank you.
> diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
> index e667c34..616a8d2 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -1308,9 +1308,9 @@ static int sel_make_bools(void)
> isec = (struct inode_security_struct *)inode->i_security;
> ret = security_genfs_sid("selinuxfs", page, SECCLASS_FILE, &sid);
> if (ret) {
> - pr_err("SELinux: failed to lookup sid for %s\n", page);
> - goto out;
> -
> + pr_warn_ratelimited("SELinux: no sid found, defaulting to security isid for %s\n",
> + page);
> + sid = SECINITSID_SECURITY;
> }
>
> isec->sid = sid;
> --
> 2.7.4
>
--
paul moore
www.paul-moore.com
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH v2 0/2]
2016-12-20 1:28 ` [PATCH v2 0/2] Gary Tierney
2016-12-20 1:28 ` [PATCH v2 1/2] selinux: log errors when loading new policy Gary Tierney
2016-12-20 1:28 ` [PATCH v2 2/2] selinux: default to security isid in sel_make_bools() if no sid is found Gary Tierney
@ 2016-12-20 3:15 ` Steve Grubb
2 siblings, 0 replies; 48+ messages in thread
From: Steve Grubb @ 2016-12-20 3:15 UTC (permalink / raw)
To: Gary Tierney; +Cc: selinux, sds, paul
On Tuesday, December 20, 2016 1:28:45 AM EST Gary Tierney wrote:
> Have updated the patches to print error messages for failures which result
> in indeterminate state and warnings for failures to load policy from
> userspace. Also updated the patches to remove the function name from log
> messages.
>
> Steve,
>
> Does your work on AUDIT_MAC_STATUS_FAIL/AUDIT_MAC_LOAD_FAIL messages (I'm
> assuming that's what Stephen's referencing in his previous mail) obsolete
> the printk logs in the first patch?
No, audit cares only about audit events. We don't care at all about syslog
messages. However, they ought to be singing the same song so to speak.
-Steve
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH 2/2] selinux: default to security isid in sel_make_bools() if no sid is found
2016-12-17 20:48 [PATCH 0/2] kernel: add error handling / logging to sel_write_load()/sel_make_bools() Gary Tierney
2016-12-17 20:48 ` [PATCH 1/2] selinux: log errors when loading new policy Gary Tierney
@ 2016-12-17 20:48 ` Gary Tierney
2016-12-19 14:46 ` Stephen Smalley
1 sibling, 1 reply; 48+ messages in thread
From: Gary Tierney @ 2016-12-17 20:48 UTC (permalink / raw)
To: selinux; +Cc: paul, sds, Gary Tierney
Use SECINITSID_SECURITY as the default SID for booleans which don't have
a matching SID returned from security_genfs_sid().
This prevents the policy failing to load (and consequently the system
failing to boot) when there is no default genfscon statement matched for
the selinuxfs in the new policy.
Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
---
security/selinux/selinuxfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 2139cc7..c282150 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -1312,10 +1312,10 @@ static int sel_make_bools(void)
isec = (struct inode_security_struct *)inode->i_security;
ret = security_genfs_sid("selinuxfs", page, SECCLASS_FILE, &sid);
if (ret) {
- pr_warn_ratelimited("SELinux: %s: failed to lookup sid for %s\n",
+ pr_warn_ratelimited("SELinux: %s: no sid found, defaulting to security isid for %s\n",
__func__, page);
- goto out;
+ sid = SECINITSID_SECURITY;
}
isec->sid = sid;
--
2.7.4
^ permalink raw reply related [flat|nested] 48+ messages in thread* Re: [PATCH 2/2] selinux: default to security isid in sel_make_bools() if no sid is found
2016-12-17 20:48 ` [PATCH 2/2] selinux: default to security isid in sel_make_bools() if no sid is found Gary Tierney
@ 2016-12-19 14:46 ` Stephen Smalley
0 siblings, 0 replies; 48+ messages in thread
From: Stephen Smalley @ 2016-12-19 14:46 UTC (permalink / raw)
To: Gary Tierney, selinux
On Sat, 2016-12-17 at 20:48 +0000, Gary Tierney wrote:
> Use SECINITSID_SECURITY as the default SID for booleans which don't
> have
> a matching SID returned from security_genfs_sid().
>
> This prevents the policy failing to load (and consequently the system
> failing to boot) when there is no default genfscon statement matched
> for
> the selinuxfs in the new policy.
>
> Signed-off-by: Gary Tierney <gary.tierney@gmx.com>
> ---
> security/selinux/selinuxfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/security/selinux/selinuxfs.c
> b/security/selinux/selinuxfs.c
> index 2139cc7..c282150 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -1312,10 +1312,10 @@ static int sel_make_bools(void)
> isec = (struct inode_security_struct *)inode-
> >i_security;
> ret = security_genfs_sid("selinuxfs", page,
> SECCLASS_FILE, &sid);
> if (ret) {
> - pr_warn_ratelimited("SELinux: %s: failed to
> lookup sid for %s\n",
> + pr_warn_ratelimited("SELinux: %s: no sid
> found, defaulting to security isid for %s\n",
> __func__, page);
> - goto out;
>
> + sid = SECINITSID_SECURITY;
I wouldn't include the function name; otherwise, LGTM.
> }
>
> isec->sid = sid;
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH v2 0/2]
@ 2025-07-04 9:03 Rex Chen
0 siblings, 0 replies; 48+ messages in thread
From: Rex Chen @ 2025-07-04 9:03 UTC (permalink / raw)
To: ulf.hansson
Cc: conor.dooley, bartosz.golaszewski, viro, linux-mmc, avri.altman,
shawn.lin, adrian.hunter, wsa+renesas, rex.chen_1
[patch 1/2]
Update based on reviewer comments
[patch 2/2]
No change for patch 2
Rex Chen (2):
mmc: core: SPI mode remove cmd7
mmc: mmc_spi: multiple block read remove read crc ack
drivers/mmc/core/sdio.c | 6 +++++-
drivers/mmc/host/mmc_spi.c | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH v2 0/2]
@ 2024-03-14 11:04 bence.balogh
2024-03-18 18:25 ` Jon Mason
0 siblings, 1 reply; 48+ messages in thread
From: bence.balogh @ 2024-03-14 11:04 UTC (permalink / raw)
To: meta-arm; +Cc: Bence Balogh
From: Bence Balogh <bence.balogh@arm.com>
Changelog :
===========
v2:
* Apply 0043-firmware-psci-Fix-bind_smccc_features-psci-check.patch
only to CS1K, instead of to all platforms.
Bence Balogh (2):
arm-bsp/u-boot: corstone1000: fix SMCCC_ARCH_FEATURES detection in the
PSCI driver
arm-bsp/trusted-firmware-a: corstone1000: remove SMCCC_ARCH_FEATURES
discovery workaround
...tone1000-pass-spsr-value-explicitly.patch} | 0
...URES-discovery-through-PSCI_FEATURES.patch | 29 ---------
...d-remove-EL3-interrupt-registration.patch} | 0
.../trusted-firmware-a-corstone1000.inc | 5 +-
.../u-boot/u-boot-corstone1000.inc | 1 +
...i-Fix-bind_smccc_features-psci-check.patch | 60 +++++++++++++++++++
6 files changed, 63 insertions(+), 32 deletions(-)
rename meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/{0003-fix-corstone1000-pass-spsr-value-explicitly.patch => 0002-fix-corstone1000-pass-spsr-value-explicitly.patch} (100%)
delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/0002-psci-SMCCC_ARCH_FEATURES-discovery-through-PSCI_FEATURES.patch
rename meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/{0004-fix-spmd-remove-EL3-interrupt-registration.patch => 0003-fix-spmd-remove-EL3-interrupt-registration.patch} (100%)
create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0043-firmware-psci-Fix-bind_smccc_features-psci-check.patch
--
2.25.1
^ permalink raw reply [flat|nested] 48+ messages in thread* Re: [PATCH v2 0/2]
2024-03-14 11:04 bence.balogh
@ 2024-03-18 18:25 ` Jon Mason
0 siblings, 0 replies; 48+ messages in thread
From: Jon Mason @ 2024-03-18 18:25 UTC (permalink / raw)
To: meta-arm, bence.balogh
On Thu, 14 Mar 2024 12:04:55 +0100, bence.balogh@arm.com wrote:
> From: Bence Balogh <bence.balogh@arm.com>
>
> Changelog :
> ===========
>
> v2:
>
> [...]
Applied, thanks!
[1/2] arm-bsp/u-boot: corstone1000: fix SMCCC_ARCH_FEATURES detection in the PSCI driver
commit: fb1a85a43c663d9e44047fc5e93af5c02c711c98
[2/2] arm-bsp/trusted-firmware-a: corstone1000: remove SMCCC_ARCH_FEATURES discovery workaround
commit: 0792a314f623b4143652563d6db9a840b2b8226f
Best regards,
--
Jon Mason <jon.mason@arm.com>
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH v2 0/2]
@ 2021-05-05 13:49 Steven Rostedt
2021-05-05 13:51 ` Steven Rostedt
0 siblings, 1 reply; 48+ messages in thread
From: Steven Rostedt @ 2021-05-05 13:49 UTC (permalink / raw)
To: linux-trace-devel; +Cc: Steven Rostedt (VMware)
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
When writing code with libtracefs, I found that it would be very
convenient to have an easy way to enable and disable events.
This patch set adds:
tracefs_event_enable()
tracefs_event_disable()
to allow users to easily enable and disable events in their code.
Changes since v1:
- free the regex of system and event if they are created.
Steven Rostedt (VMware) (2):
libtracefs: Add tracefs_event_enable/disable() API
libtracefs: Update the man page for tracefs_event_enable/disable()
APIs
Documentation/libtracefs-events.txt | 36 +++++++
include/tracefs.h | 3 +
src/tracefs-events.c | 149 ++++++++++++++++++++++++++++
3 files changed, 188 insertions(+)
--
2.29.2
^ permalink raw reply [flat|nested] 48+ messages in thread* [PATCH v2 0/2]
@ 2020-09-25 16:50 Pavel Reichl
0 siblings, 0 replies; 48+ messages in thread
From: Pavel Reichl @ 2020-09-25 16:50 UTC (permalink / raw)
To: linux-xfs
xfs: remove deprecated mount and sysctl options
Hi,
by Eric and Dave's suggestion I prepared a patchset which adds warnings about
using deprecated options. I tried to justify the changes in commit
messages based on the info from Eric and Dave.
If this patchsed should be merged I need to know when the options are
actually eliminated, so documentation can be properly updated.
Thanks.
V2 update:
Added comment to mount options that are being deprecated
Added Sep 2020 to documentation as a planned date of removal
Pavel Reichl (2):
xfs: remove deprecated mount options
xfs: remove deprecated sysctl options
Documentation/admin-guide/xfs.rst | 5 ++++-
fs/xfs/xfs_super.c | 31 +++++++++++++++-----------
fs/xfs/xfs_sysctl.c | 36 +++++++++++++++++++++++++++++--
3 files changed, 56 insertions(+), 16 deletions(-)
--
2.26.2
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 1/1] remote.c: fix handling of push:remote_ref
@ 2020-03-02 13:32 Jeff King
2020-03-03 16:12 ` [PATCH v2 0/2] Damien Robert
0 siblings, 1 reply; 48+ messages in thread
From: Jeff King @ 2020-03-02 13:32 UTC (permalink / raw)
To: Damien Robert; +Cc: git
[dropping J from cc, since my earlier email bounced]
On Sun, Mar 01, 2020 at 11:05:31PM +0100, Damien Robert wrote:
> > Saying "*explicit = 1" here seems weird. Isn't the whole point that
> > these modes _aren't_ explicit?
>
> Well pushremote_for_branch also set explicit=1 if only remote.pushDefault
> is set, so I followed suit.
Yeah, I think the useless "explicit" was a mistake back when the
function was added. See the patch below.
> > It looks like our only caller will ignore our return value unless we say
> > "explicit", though. I have to wonder what the point of that flag is,
> > versus just returning NULL when we don't have anything to return.
>
> I think you looked at the RR_REMOTE_NAME (ref-filter.c:1455), here the
> situation is handled by RR_REMOTE_REF, where explicit is not used at all.
> So we could remove it.
We do look at it, but it's pointless to do so:
$ git grep -hn -C4 remote_ref_for_branch origin:ref-filter.c
1461- } else if (atom->u.remote_ref.option == RR_REMOTE_REF) {
1462- int explicit;
1463- const char *merge;
1464-
1465: merge = remote_ref_for_branch(branch, atom->u.remote_ref.push,
1466- &explicit);
1467- *s = xstrdup(explicit ? merge : "");
1468- } else
1469- BUG("unhandled RR_* enum");
I think we probably ought to do this as a preparatory patch in your
series.
-- >8 --
Subject: remote: drop "explicit" parameter from remote_ref_for_branch()
Commit 9700fae5ee (for-each-ref: let upstream/push report the remote ref
name, 2017-11-07) added a remote_ref_for_branch() helper, which is
modeled after remote_for_branch(). This includes providing an "explicit"
out-parameter that tells the caller whether the remote was configured by
the user, or whether we picked a default name like "origin".
But unlike remote names, there's no default case for the remote branch
name. In any case where we don't set "explicit", we'd just an empty
string anyway. Let's instead return NULL in this case, letting us
simplify the function interface.
Signed-off-by: Jeff King <peff@peff.net>
---
ref-filter.c | 6 ++----
remote.c | 11 ++---------
remote.h | 3 +--
3 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/ref-filter.c b/ref-filter.c
index 6867e33648..9837700732 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1459,12 +1459,10 @@ static void fill_remote_ref_details(struct used_atom *atom, const char *refname,
remote_for_branch(branch, &explicit);
*s = xstrdup(explicit ? remote : "");
} else if (atom->u.remote_ref.option == RR_REMOTE_REF) {
- int explicit;
const char *merge;
- merge = remote_ref_for_branch(branch, atom->u.remote_ref.push,
- &explicit);
- *s = xstrdup(explicit ? merge : "");
+ merge = remote_ref_for_branch(branch, atom->u.remote_ref.push);
+ *s = xstrdup(merge ? merge : "");
} else
BUG("unhandled RR_* enum");
}
diff --git a/remote.c b/remote.c
index 593ce297ed..c43196ec06 100644
--- a/remote.c
+++ b/remote.c
@@ -516,14 +516,11 @@ const char *pushremote_for_branch(struct branch *branch, int *explicit)
return remote_for_branch(branch, explicit);
}
-const char *remote_ref_for_branch(struct branch *branch, int for_push,
- int *explicit)
+const char *remote_ref_for_branch(struct branch *branch, int for_push)
{
if (branch) {
if (!for_push) {
if (branch->merge_nr) {
- if (explicit)
- *explicit = 1;
return branch->merge_name[0];
}
} else {
@@ -534,15 +531,11 @@ const char *remote_ref_for_branch(struct branch *branch, int for_push,
if (remote && remote->push.nr &&
(dst = apply_refspecs(&remote->push,
branch->refname))) {
- if (explicit)
- *explicit = 1;
return dst;
}
}
}
- if (explicit)
- *explicit = 0;
- return "";
+ return NULL;
}
static struct remote *remote_get_1(const char *name,
diff --git a/remote.h b/remote.h
index b134cc21be..11d8719b58 100644
--- a/remote.h
+++ b/remote.h
@@ -261,8 +261,7 @@ struct branch {
struct branch *branch_get(const char *name);
const char *remote_for_branch(struct branch *branch, int *explicit);
const char *pushremote_for_branch(struct branch *branch, int *explicit);
-const char *remote_ref_for_branch(struct branch *branch, int for_push,
- int *explicit);
+const char *remote_ref_for_branch(struct branch *branch, int for_push);
/* returns true if the given branch has merge configuration given. */
int branch_has_merge_config(struct branch *branch);
--
2.25.1.947.ga5bc3d07fe
^ permalink raw reply related [flat|nested] 48+ messages in thread* [PATCH v2 0/2]
2020-03-02 13:32 [PATCH 1/1] remote.c: fix handling of push:remote_ref Jeff King
@ 2020-03-03 16:12 ` Damien Robert
0 siblings, 0 replies; 48+ messages in thread
From: Damien Robert @ 2020-03-03 16:12 UTC (permalink / raw)
To: git, Jeff King; +Cc: Damien Robert
Here is the version 2. I incorporated Jeff's preliminary patch, and handled
all push.default cases and added tests for them.
Damien Robert (1):
remote.c: fix handling of %(push:remoteref)
Jeff King (1):
remote: drop "explicit" parameter from remote_ref_for_branch()
ref-filter.c | 6 +--
remote.c | 113 +++++++++++++++++++++++++++++-----------
remote.h | 3 +-
t/t6300-for-each-ref.sh | 29 ++++++++++-
4 files changed, 115 insertions(+), 36 deletions(-)
--
Patched on top of v2.25.1-377-g2d2118b814 (git version 2.25.1)
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH v2 0/2]
@ 2018-04-26 18:24 Jacopo Mondi
0 siblings, 0 replies; 48+ messages in thread
From: Jacopo Mondi @ 2018-04-26 18:24 UTC (permalink / raw)
To: geert, horms, robh+dt, mark.rutland
Cc: Jacopo Mondi, linux-renesas-soc, linux-media, devicetree,
linux-kernel
Hello,
this small series add R-Mobile A1 R8A7740 to the list of CEU supported
SoCs, and adds the CEU node to r8a7740.dtsi.
All the information on CEU clocks, power domains and memory regions have been
deducted from the now-deleted board file:
arch/arm/mach-shmobile/board-armadillo800eva.c
Thanks
j
v1 -> v2:
- Enlarge the memory range as suggested by Simon
- Fix power domain, as reported by Simon
- s/Enable/[Describe|Add] in commit message
Jacopo Mondi (2):
dt-bindings: media: renesas-ceu: Add R-Mobile R8A7740
ARM: dts: r8a7740: Add CEU0
Documentation/devicetree/bindings/media/renesas,ceu.txt | 7 ++++---
arch/arm/boot/dts/r8a7740.dtsi | 10 ++++++++++
drivers/media/platform/renesas-ceu.c | 1 +
3 files changed, 15 insertions(+), 3 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH V2 0/2]
@ 2018-01-18 23:18 Amanda Brindle
0 siblings, 0 replies; 48+ messages in thread
From: Amanda Brindle @ 2018-01-18 23:18 UTC (permalink / raw)
To: openembedded-core; +Cc: paul.eggleton, Amanda Brindle
In V2, fixed an error that did not list all packages if multiple packages were specified
on the command line.
The following changes since commit cf75fd5ae07355951b1f90d13842552a99e61063:
contrib/yocto-bsp-kernel-update.sh: remove this script (2018-01-18 13:05:56 +0000)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib abrindle/rprovides
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=abrindle/rprovides
Amanda Brindle (2):
oe-pkgdata-util: Refactor functions for consistency
oe-pkgdata-util: Add support for RPROVIDES
scripts/oe-pkgdata-util | 173 +++++++++++++++++++++++++++---------------------
1 file changed, 97 insertions(+), 76 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH v2 0/2]
@ 2017-08-19 18:03 ` sean.wang at mediatek.com
0 siblings, 0 replies; 48+ messages in thread
From: sean.wang @ 2017-08-19 18:03 UTC (permalink / raw)
To: robh+dt, gregkh, jslaby, andriy.shevchenko, robert.jarzmik, arnd,
p.zabel, joel, david, jan.kiszka, heikki.krogerus, hpeter,
vigneshr, matthias.bgg, tthayer
Cc: devicetree, linux-mediatek, linux-serial, linux-arm-kernel,
linux-kernel, Sean Wang
From: Sean Wang <sean.wang@mediatek.com>
Since v2:
- reusing 8250_of since the original driver has almost the same logic
This patchset introduces the support for MediaTek BTIF controller.
MediaTek BTIF controller is the serial interface similar to UART but it
works only as the digital device which is mainly used to communicate with
the connectivity module also called CONNSYS inside the SoC which could be
mostly found on those MediaTek SoCs with Bluetooth feature.
And the controller is made as being compatible with the 8250 register
layout so it tends to be integrated with existing 8250 core driver and
have no requirement for the modem configuration additionally such as the
baud rate calculation and assignment.
Sean Wang (2):
dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
serial: 8250: of: Add new port type for MediaTek BTIF controller on
MT7622/23 SoC
Documentation/devicetree/bindings/serial/8250.txt | 3 +++
drivers/tty/serial/8250/8250_of.c | 2 ++
drivers/tty/serial/8250/8250_port.c | 8 ++++++++
include/uapi/linux/serial_core.h | 3 +++
4 files changed, 16 insertions(+)
--
2.7.4
^ permalink raw reply [flat|nested] 48+ messages in thread* [PATCH v2 0/2]
@ 2017-08-19 18:03 ` sean.wang at mediatek.com
0 siblings, 0 replies; 48+ messages in thread
From: sean.wang @ 2017-08-19 18:03 UTC (permalink / raw)
To: robh+dt, gregkh, jslaby, andriy.shevchenko, robert.jarzmik, arnd,
p.zabel, joel, david, jan.kiszka, heikki.krogerus, hpeter,
vigneshr, matthias.bgg, tthayer
Cc: devicetree, linux-mediatek, linux-serial, linux-arm-kernel,
linux-kernel, Sean Wang
From: Sean Wang <sean.wang@mediatek.com>
Since v2:
- reusing 8250_of since the original driver has almost the same logic
This patchset introduces the support for MediaTek BTIF controller.
MediaTek BTIF controller is the serial interface similar to UART but it
works only as the digital device which is mainly used to communicate with
the connectivity module also called CONNSYS inside the SoC which could be
mostly found on those MediaTek SoCs with Bluetooth feature.
And the controller is made as being compatible with the 8250 register
layout so it tends to be integrated with existing 8250 core driver and
have no requirement for the modem configuration additionally such as the
baud rate calculation and assignment.
Sean Wang (2):
dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
serial: 8250: of: Add new port type for MediaTek BTIF controller on
MT7622/23 SoC
Documentation/devicetree/bindings/serial/8250.txt | 3 +++
drivers/tty/serial/8250/8250_of.c | 2 ++
drivers/tty/serial/8250/8250_port.c | 8 ++++++++
include/uapi/linux/serial_core.h | 3 +++
4 files changed, 16 insertions(+)
--
2.7.4
^ permalink raw reply [flat|nested] 48+ messages in thread* [PATCH v2 0/2]
@ 2017-08-19 18:03 ` sean.wang at mediatek.com
0 siblings, 0 replies; 48+ messages in thread
From: sean.wang at mediatek.com @ 2017-08-19 18:03 UTC (permalink / raw)
To: linux-arm-kernel
From: Sean Wang <sean.wang@mediatek.com>
Since v2:
- reusing 8250_of since the original driver has almost the same logic
This patchset introduces the support for MediaTek BTIF controller.
MediaTek BTIF controller is the serial interface similar to UART but it
works only as the digital device which is mainly used to communicate with
the connectivity module also called CONNSYS inside the SoC which could be
mostly found on those MediaTek SoCs with Bluetooth feature.
And the controller is made as being compatible with the 8250 register
layout so it tends to be integrated with existing 8250 core driver and
have no requirement for the modem configuration additionally such as the
baud rate calculation and assignment.
Sean Wang (2):
dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
serial: 8250: of: Add new port type for MediaTek BTIF controller on
MT7622/23 SoC
Documentation/devicetree/bindings/serial/8250.txt | 3 +++
drivers/tty/serial/8250/8250_of.c | 2 ++
drivers/tty/serial/8250/8250_port.c | 8 ++++++++
include/uapi/linux/serial_core.h | 3 +++
4 files changed, 16 insertions(+)
--
2.7.4
^ permalink raw reply [flat|nested] 48+ messages in thread
* [patch v2 0/2]
@ 2017-08-07 14:17 ` Oleksandr Shamray
0 siblings, 0 replies; 48+ messages in thread
From: Oleksandr Shamray @ 2017-08-07 14:17 UTC (permalink / raw)
To: gregkh, arnd
Cc: linux-kernel, linux-arm-kernel, devicetree, openbmc, joel, jiri,
tklauser, linux-serial, mec, vadimp, system-sw-low-level, robh+dt,
openocd-devel-owner, Oleksandr Shamray
When a need raise up to use JTAG interface for system's devices
programming or CPU debugging, it could be done from the external
JTAG master controller.
For such purpose, usually the user layer
application implements jtag protocol or using a proprietary
connection to vendor hardware.
This method is slow and not generic.
We propose to implement general JTAG interface and infrastructure
to communicate with user layer application. In such way, we can
have the standard JTAG interface core part and separation from
specific HW implementation.
This allow new capability to debug the CPU or program system's
device via BMC without additional devices nor cost.
This patch purpose is to add JTAG master core infrastructure by
defining new JTAG class and provide generic JTAG interface
to allow hardware specific drivers to connect this interface.
This will enable all JTAG drivers to use the common interface
part and will have separate for hardware implementation.
The JTAG (Joint Test Action Group) core driver provides minimal generic
JTAG interface, which can be used by hardware specific JTAG master
controllers. By providing common interface for the JTAG controllers,
user space device programing is hardware independent.
Modern SoC which in use for embedded system' equipped with
internal JTAG master interface.
This interface is used for programming and debugging system's
hardware components, like CPLD, FPGA, CPU, voltage and
industrial controllers.
Firmware for such devices can be upgraded through JTAG interface during
Runtime. The JTAG standard support for multiple devices programming,
is in case their lines are daisy-chained together.
For example, systems which equipped with host CPU, BMC SoC or/and
number of programmable devices are capable to connect a pin and
select system components dynamically for programming and debugging,
This is using by the BMC which is equipped with internal SoC master
controller.
For example:
BMC JTAG master --> pin selected to CPLDs chain for programming (filed
upgrade, production)
BMC JTAG master --> pin selected to voltage monitors for programming
(field upgrade, production)
BMC JTAG master --> pin selected to host CPU (on-site debugging
and developers debugging)
For example, we can have application in user space which using calls
to JTAG driver executes CPLD programming directly from SVF file
The JTAG standard (IEEE 1149.1) defines the next connector pins:
- TDI (Test Data In);
- TDO (Test Data Out);
- TCK (Test Clock);
- TMS (Test Mode Select);
- TRST (Test Reset) (Optional);
The SoC equipped with JTAG master controller, performs
device programming on command or vector level. For example
a file in a standard SVF (Serial Vector Format) that contains
boundary scan vectors, can be used by sending each vector
to the JTAG interface and the JTAG controller will execute
the programming.
Initial version provides the system calls set for:
- SIR (Scan Instruction Register, IEEE 1149.1 Data Register scan);
- SDR (Scan Data Register, IEEE 1149.1 Instruction Register scan);
- RUNTEST (Forces the IEEE 1149.1 bus to a run state for a specified
number of clocks.
SoC which are not equipped with JTAG master interface, can be built
on top of JTAG core driver infrastructure, by applying bit-banging of
TDI, TDO, TCK and TMS pins within the hardware specific driver.
Oleksandr Shamray (2):
drivers: jtag: Add JTAG core driver
drivers: jtag: Add Aspeed SoC 24xx and 25xx families JTAG master
driver
.../devicetree/bindings/jtag/aspeed-jtag.txt | 27 +
Documentation/ioctl/ioctl-number.txt | 2 +
MAINTAINERS | 8 +
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/jtag/Kconfig | 29 +
drivers/jtag/Makefile | 2 +
drivers/jtag/jtag-aspeed.c | 774 ++++++++++++++++++++
drivers/jtag/jtag.c | 313 ++++++++
include/linux/jtag.h | 42 ++
include/uapi/linux/jtag.h | 113 +++
11 files changed, 1313 insertions(+), 0 deletions(-)
create mode 100644 Documentation/devicetree/bindings/jtag/aspeed-jtag.txt
create mode 100644 drivers/jtag/Kconfig
create mode 100644 drivers/jtag/Makefile
create mode 100644 drivers/jtag/jtag-aspeed.c
create mode 100644 drivers/jtag/jtag.c
create mode 100644 include/linux/jtag.h
create mode 100644 include/uapi/linux/jtag.h
^ permalink raw reply [flat|nested] 48+ messages in thread* [patch v2 0/2]
@ 2017-08-07 14:17 ` Oleksandr Shamray
0 siblings, 0 replies; 48+ messages in thread
From: Oleksandr Shamray @ 2017-08-07 14:17 UTC (permalink / raw)
To: linux-arm-kernel
When a need raise up to use JTAG interface for system's devices
programming or CPU debugging, it could be done from the external
JTAG master controller.
For such purpose, usually the user layer
application implements jtag protocol or using a proprietary
connection to vendor hardware.
This method is slow and not generic.
We propose to implement general JTAG interface and infrastructure
to communicate with user layer application. In such way, we can
have the standard JTAG interface core part and separation from
specific HW implementation.
This allow new capability to debug the CPU or program system's
device via BMC without additional devices nor cost.
This patch purpose is to add JTAG master core infrastructure by
defining new JTAG class and provide generic JTAG interface
to allow hardware specific drivers to connect this interface.
This will enable all JTAG drivers to use the common interface
part and will have separate for hardware implementation.
The JTAG (Joint Test Action Group) core driver provides minimal generic
JTAG interface, which can be used by hardware specific JTAG master
controllers. By providing common interface for the JTAG controllers,
user space device programing is hardware independent.
Modern SoC which in use for embedded system' equipped with
internal JTAG master interface.
This interface is used for programming and debugging system's
hardware components, like CPLD, FPGA, CPU, voltage and
industrial controllers.
Firmware for such devices can be upgraded through JTAG interface during
Runtime. The JTAG standard support for multiple devices programming,
is in case their lines are daisy-chained together.
For example, systems which equipped with host CPU, BMC SoC or/and
number of programmable devices are capable to connect a pin and
select system components dynamically for programming and debugging,
This is using by the BMC which is equipped with internal SoC master
controller.
For example:
BMC JTAG master --> pin selected to CPLDs chain for programming (filed
upgrade, production)
BMC JTAG master --> pin selected to voltage monitors for programming
(field upgrade, production)
BMC JTAG master --> pin selected to host CPU (on-site debugging
and developers debugging)
For example, we can have application in user space which using calls
to JTAG driver executes CPLD programming directly from SVF file
The JTAG standard (IEEE 1149.1) defines the next connector pins:
- TDI (Test Data In);
- TDO (Test Data Out);
- TCK (Test Clock);
- TMS (Test Mode Select);
- TRST (Test Reset) (Optional);
The SoC equipped with JTAG master controller, performs
device programming on command or vector level. For example
a file in a standard SVF (Serial Vector Format) that contains
boundary scan vectors, can be used by sending each vector
to the JTAG interface and the JTAG controller will execute
the programming.
Initial version provides the system calls set for:
- SIR (Scan Instruction Register, IEEE 1149.1 Data Register scan);
- SDR (Scan Data Register, IEEE 1149.1 Instruction Register scan);
- RUNTEST (Forces the IEEE 1149.1 bus to a run state for a specified
number of clocks.
SoC which are not equipped with JTAG master interface, can be built
on top of JTAG core driver infrastructure, by applying bit-banging of
TDI, TDO, TCK and TMS pins within the hardware specific driver.
Oleksandr Shamray (2):
drivers: jtag: Add JTAG core driver
drivers: jtag: Add Aspeed SoC 24xx and 25xx families JTAG master
driver
.../devicetree/bindings/jtag/aspeed-jtag.txt | 27 +
Documentation/ioctl/ioctl-number.txt | 2 +
MAINTAINERS | 8 +
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/jtag/Kconfig | 29 +
drivers/jtag/Makefile | 2 +
drivers/jtag/jtag-aspeed.c | 774 ++++++++++++++++++++
drivers/jtag/jtag.c | 313 ++++++++
include/linux/jtag.h | 42 ++
include/uapi/linux/jtag.h | 113 +++
11 files changed, 1313 insertions(+), 0 deletions(-)
create mode 100644 Documentation/devicetree/bindings/jtag/aspeed-jtag.txt
create mode 100644 drivers/jtag/Kconfig
create mode 100644 drivers/jtag/Makefile
create mode 100644 drivers/jtag/jtag-aspeed.c
create mode 100644 drivers/jtag/jtag.c
create mode 100644 include/linux/jtag.h
create mode 100644 include/uapi/linux/jtag.h
^ permalink raw reply [flat|nested] 48+ messages in thread[parent not found: <1502115467-1735-1-git-send-email-oleksandrs-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>]
* Re: [patch v2 0/2]
2017-08-07 14:17 ` Oleksandr Shamray
(?)
@ 2017-08-09 14:31 ` Andrew Lunn
-1 siblings, 0 replies; 48+ messages in thread
From: Andrew Lunn @ 2017-08-09 14:31 UTC (permalink / raw)
To: Oleksandr Shamray
Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, arnd-r2nGTMty4D4,
devicetree-u79uwXL29TY76Z2rM5mHXA, jiri-rHqAuBHg3fBzbRFIqnYvSA,
system-sw-low-level-VPRAkNaXOzVWk0Htik3J/w,
openbmc-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
openocd-devel-owner-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
mec-WqBc5aa1uDFeoWH0uzbU5w, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
joel-U3u1mxZcP9KHXe+LvDLADg, linux-serial-u79uwXL29TY76Z2rM5mHXA,
vadimp-45czdsxZ+A5DPfheJLI6IQ, tklauser-93Khv+1bN0NyDzI6CaY1VQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
On Mon, Aug 07, 2017 at 05:17:45PM +0300, Oleksandr Shamray wrote:
> When a need raise up to use JTAG interface for system's devices
> programming or CPU debugging, it could be done from the external
> JTAG master controller.
>
> For such purpose, usually the user layer
> application implements jtag protocol or using a proprietary
> connection to vendor hardware.
> This method is slow and not generic.
>
> We propose to implement general JTAG interface and infrastructure
> to communicate with user layer application.
Hi Oleksandr
You might find this discussion interesting:
https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2017-August/004721.html
You are defining a new ABI here, so linux-abi should be involved in
the discussion of these patches.
Andrew
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 48+ messages in thread* [patch v2 0/2]
@ 2017-08-09 14:31 ` Andrew Lunn
0 siblings, 0 replies; 48+ messages in thread
From: Andrew Lunn @ 2017-08-09 14:31 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Aug 07, 2017 at 05:17:45PM +0300, Oleksandr Shamray wrote:
> When a need raise up to use JTAG interface for system's devices
> programming or CPU debugging, it could be done from the external
> JTAG master controller.
>
> For such purpose, usually the user layer
> application implements jtag protocol or using a proprietary
> connection to vendor hardware.
> This method is slow and not generic.
>
> We propose to implement general JTAG interface and infrastructure
> to communicate with user layer application.
Hi Oleksandr
You might find this discussion interesting:
https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2017-August/004721.html
You are defining a new ABI here, so linux-abi should be involved in
the discussion of these patches.
Andrew
^ permalink raw reply [flat|nested] 48+ messages in thread* Re: [patch v2 0/2]
@ 2017-08-09 14:31 ` Andrew Lunn
0 siblings, 0 replies; 48+ messages in thread
From: Andrew Lunn @ 2017-08-09 14:31 UTC (permalink / raw)
To: Oleksandr Shamray
Cc: gregkh, arnd, devicetree, jiri, system-sw-low-level, openbmc,
linux-kernel, openocd-devel-owner, mec, robh+dt, joel,
linux-serial, vadimp, tklauser, linux-arm-kernel
On Mon, Aug 07, 2017 at 05:17:45PM +0300, Oleksandr Shamray wrote:
> When a need raise up to use JTAG interface for system's devices
> programming or CPU debugging, it could be done from the external
> JTAG master controller.
>
> For such purpose, usually the user layer
> application implements jtag protocol or using a proprietary
> connection to vendor hardware.
> This method is slow and not generic.
>
> We propose to implement general JTAG interface and infrastructure
> to communicate with user layer application.
Hi Oleksandr
You might find this discussion interesting:
https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2017-August/004721.html
You are defining a new ABI here, so linux-abi should be involved in
the discussion of these patches.
Andrew
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [patch v2 0/2]
2017-08-07 14:17 ` Oleksandr Shamray
@ 2017-08-10 15:18 ` Greg KH
-1 siblings, 0 replies; 48+ messages in thread
From: Greg KH @ 2017-08-10 15:18 UTC (permalink / raw)
To: Oleksandr Shamray
Cc: arnd, linux-kernel, linux-arm-kernel, devicetree, openbmc, joel,
jiri, tklauser, linux-serial, mec, vadimp, system-sw-low-level,
robh+dt, openocd-devel-owner
On Mon, Aug 07, 2017 at 05:17:45PM +0300, Oleksandr Shamray wrote:
> When a need raise up to use JTAG interface for system's devices
> programming or CPU debugging, it could be done from the external
> JTAG master controller.
Your subject line is a bit "odd" :(
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH v2 0/2]
@ 2017-03-06 18:20 Tamara Diaconita
2017-03-06 20:51 ` Greg KH
0 siblings, 1 reply; 48+ messages in thread
From: Tamara Diaconita @ 2017-03-06 18:20 UTC (permalink / raw)
To: w.d.hubbs, chris, kirk, samuel.thibault, gregkh, outreachy-kernel
Cc: Tamara Diaconita
Tamara Diaconita (2):
staging: speakup: keyhelp: Add spaces to align
staging: speakup: keyhelp: Fix 'if' continuation
Changes since v1:
*Deleted the patch: 'staging:speakup:keyhelp.c: Remove unnecessary else' from the set and remake the original file.
*Deleted the '.c' in the subject of the patches.
*Added a space after ':' in the subject of the patches.
drivers/staging/speakup/keyhelp.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH v2 0/2]
2017-03-06 18:20 [PATCH " Tamara Diaconita
@ 2017-03-06 20:51 ` Greg KH
0 siblings, 0 replies; 48+ messages in thread
From: Greg KH @ 2017-03-06 20:51 UTC (permalink / raw)
To: Tamara Diaconita
Cc: w.d.hubbs, chris, kirk, samuel.thibault, outreachy-kernel,
Tamara Diaconita
On Mon, Mar 06, 2017 at 08:20:52PM +0200, Tamara Diaconita wrote:
> Tamara Diaconita (2):
> staging: speakup: keyhelp: Add spaces to align
> staging: speakup: keyhelp: Fix 'if' continuation
>
> Changes since v1:
> *Deleted the patch: 'staging:speakup:keyhelp.c: Remove unnecessary else' from the set and remake the original file.
> *Deleted the '.c' in the subject of the patches.
> *Added a space after ':' in the subject of the patches.
>
> drivers/staging/speakup/keyhelp.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
Why is there no real subject here saying what these patches are for?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH] testpmd: HW vlan command
@ 2015-02-13 12:03 Ouyang Changchun
[not found] ` <1423829023-32707-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 48+ messages in thread
From: Ouyang Changchun @ 2015-02-13 12:03 UTC (permalink / raw)
To: dev-VfR2kkLFssw
This patch enables testpmd user can config port hw_vlan with more fine granularity:
hw vlan filter, hw vlan strip, and hw vlan extend.
Don't remove the original command(hw-vlan) considering that some user still want to use
only one command to switch on/off all 3 options.
Signed-off-by: Changchun Ouyang <changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
app/test-pmd/cmdline.c | 36 +++++++++++++++++++++++++++++++++---
app/test-pmd/parameters.c | 18 ++++++++++++++++++
2 files changed, 51 insertions(+), 3 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 590e427..99cc307 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -584,7 +584,8 @@ static void cmd_help_long_parsed(void *parsed_result,
"port config all max-pkt-len (value)\n"
" Set the max packet length.\n\n"
- "port config all (crc-strip|rx-cksum|hw-vlan|drop-en)"
+ "port config all (crc-strip|rx-cksum|hw-vlan|hw-vlan-filter|"
+ "hw-vlan-strip|hw-vlan-extend|drop-en)"
" (on|off)\n"
" Set crc-strip/rx-checksum/hardware-vlan/drop_en"
" for ports.\n\n"
@@ -1327,6 +1328,33 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result,
printf("Unknown parameter\n");
return;
}
+ } else if (!strcmp(res->name, "hw-vlan-filter")) {
+ if (!strcmp(res->value, "on"))
+ rx_mode.hw_vlan_filter = 1;
+ else if (!strcmp(res->value, "off"))
+ rx_mode.hw_vlan_filter = 0;
+ else {
+ printf("Unknown parameter\n");
+ return;
+ }
+ } else if (!strcmp(res->name, "hw-vlan-strip")) {
+ if (!strcmp(res->value, "on"))
+ rx_mode.hw_vlan_strip = 1;
+ else if (!strcmp(res->value, "off"))
+ rx_mode.hw_vlan_strip = 0;
+ else {
+ printf("Unknown parameter\n");
+ return;
+ }
+ } else if (!strcmp(res->name, "hw-vlan-extend")) {
+ if (!strcmp(res->value, "on"))
+ rx_mode.hw_vlan_extend = 1;
+ else if (!strcmp(res->value, "off"))
+ rx_mode.hw_vlan_extend = 0;
+ else {
+ printf("Unknown parameter\n");
+ return;
+ }
} else if (!strcmp(res->name, "drop-en")) {
if (!strcmp(res->value, "on"))
rx_drop_en = 1;
@@ -1355,7 +1383,8 @@ cmdline_parse_token_string_t cmd_config_rx_mode_flag_all =
TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, all, "all");
cmdline_parse_token_string_t cmd_config_rx_mode_flag_name =
TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, name,
- "crc-strip#rx-cksum#hw-vlan");
+ "crc-strip#rx-cksum#hw-vlan#"
+ "hw-vlan-filter#hw-vlan-strip#hw-vlan-extend");
cmdline_parse_token_string_t cmd_config_rx_mode_flag_value =
TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, value,
"on#off");
@@ -1363,7 +1392,8 @@ cmdline_parse_token_string_t cmd_config_rx_mode_flag_value =
cmdline_parse_inst_t cmd_config_rx_mode_flag = {
.f = cmd_config_rx_mode_flag_parsed,
.data = NULL,
- .help_str = "port config all crc-strip|rx-cksum|hw-vlan on|off",
+ .help_str = "port config all crc-strip|rx-cksum|hw-vlan|"
+ "hw-vlan-filter|hw-vlan-strip|hw-vlan-extend on|off",
.tokens = {
(void *)&cmd_config_rx_mode_flag_port,
(void *)&cmd_config_rx_mode_flag_keyword,
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index adf3203..04dc129 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -157,6 +157,9 @@ usage(char* progname)
printf(" --crc-strip: enable CRC stripping by hardware.\n");
printf(" --enable-rx-cksum: enable rx hardware checksum offload.\n");
printf(" --disable-hw-vlan: disable hardware vlan.\n");
+ printf(" --disable-hw-vlan-filter: disable hardware vlan filter.\n");
+ printf(" --disable-hw-vlan-strip: disable hardware vlan strip.\n");
+ printf(" --disable-hw-vlan-extend: disable hardware vlan extend.\n");
printf(" --enable-drop-en: enable per queue packet drop.\n");
printf(" --disable-rss: disable rss.\n");
printf(" --port-topology=N: set port topology (N: paired (default) or "
@@ -528,6 +531,9 @@ launch_args_parse(int argc, char** argv)
{ "crc-strip", 0, 0, 0 },
{ "enable-rx-cksum", 0, 0, 0 },
{ "disable-hw-vlan", 0, 0, 0 },
+ { "disable-hw-vlan-filter", 0, 0, 0 },
+ { "disable-hw-vlan-strip", 0, 0, 0 },
+ { "disable-hw-vlan-extend", 0, 0, 0 },
{ "enable-drop-en", 0, 0, 0 },
{ "disable-rss", 0, 0, 0 },
{ "port-topology", 1, 0, 0 },
@@ -778,6 +784,18 @@ launch_args_parse(int argc, char** argv)
rx_mode.hw_vlan_extend = 0;
}
+ if (!strcmp(lgopts[opt_idx].name,
+ "disable-hw-vlan-filter"))
+ rx_mode.hw_vlan_filter = 0;
+
+ if (!strcmp(lgopts[opt_idx].name,
+ "disable-hw-vlan-strip"))
+ rx_mode.hw_vlan_strip = 0;
+
+ if (!strcmp(lgopts[opt_idx].name,
+ "disable-hw-vlan-extend"))
+ rx_mode.hw_vlan_extend = 0;
+
if (!strcmp(lgopts[opt_idx].name, "enable-drop-en"))
rx_drop_en = 1;
--
1.8.4.2
^ permalink raw reply related [flat|nested] 48+ messages in thread* [PATCH 0/2] Fix a division by zero
@ 2014-09-23 19:54 Frans Klaver
2014-09-23 21:58 ` Greg Kroah-Hartman
0 siblings, 1 reply; 48+ messages in thread
From: Frans Klaver @ 2014-09-23 19:54 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Frans Klaver, Jiri Slaby, linux-serial, linux-kernel, linux-omap
Hi Greg,
Here's a couple of patches that fix a divison by zero in omap-serial.c. One's a
cleanup, the other the actual fix.
Thanks,
Frans
Frans Klaver (2):
tty: omap-serial: pull out calculation from baud_is_mode16
tty: omap-serial: fix a division by zero
drivers/tty/serial/omap-serial.c | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
--
2.1.0
^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 0/2] Fix a division by zero
2014-09-23 19:54 [PATCH 0/2] Fix a division by zero Frans Klaver
@ 2014-09-23 21:58 ` Greg Kroah-Hartman
2014-09-24 7:55 ` Frans Klaver
0 siblings, 1 reply; 48+ messages in thread
From: Greg Kroah-Hartman @ 2014-09-23 21:58 UTC (permalink / raw)
To: Frans Klaver; +Cc: Jiri Slaby, linux-serial, linux-kernel, linux-omap
On Tue, Sep 23, 2014 at 09:54:38PM +0200, Frans Klaver wrote:
> Hi Greg,
>
> Here's a couple of patches that fix a divison by zero in omap-serial.c. One's a
> cleanup, the other the actual fix.
So both would be needed to be backported to stable kernels? Why not
just do the fix first, then the cleanup afterward, to make backporting
easier?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH v2 0/2]
2014-09-23 21:58 ` Greg Kroah-Hartman
@ 2014-09-24 7:55 ` Frans Klaver
0 siblings, 0 replies; 48+ messages in thread
From: Frans Klaver @ 2014-09-24 7:55 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Frans Klaver, Jiri Slaby, linux-serial, linux-kernel, linux-omap
On Tue, Sep 23, 2014 at 11:58 PM, Greg Kroah-Hartman wrote:
> So both would be needed to be backported to stable kernels? Why not
> just do the fix first, then the cleanup afterward, to make backporting
> easier?
Sure thing. I read something about cleaning up first, then actually changing
stuff, but it doesn't really make sense to move bugs around before fixing them,
unless fixing them requires moving them around.
Anyway, here's the respin.
v1..v2:
- swapped fix and cleanup to ease backporting
Frans Klaver (2):
tty: omap-serial: fix division by zero
tty: omap-serial: pull out calculation from baud_is_mode16
drivers/tty/serial/omap-serial.c | 34 ++++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
--
2.1.0
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH v2 0/2]
@ 2014-09-24 7:55 ` Frans Klaver
0 siblings, 0 replies; 48+ messages in thread
From: Frans Klaver @ 2014-09-24 7:55 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Frans Klaver, Jiri Slaby, linux-serial, linux-kernel, linux-omap
On Tue, Sep 23, 2014 at 11:58 PM, Greg Kroah-Hartman wrote:
> So both would be needed to be backported to stable kernels? Why not
> just do the fix first, then the cleanup afterward, to make backporting
> easier?
Sure thing. I read something about cleaning up first, then actually changing
stuff, but it doesn't really make sense to move bugs around before fixing them,
unless fixing them requires moving them around.
Anyway, here's the respin.
v1..v2:
- swapped fix and cleanup to ease backporting
Frans Klaver (2):
tty: omap-serial: fix division by zero
tty: omap-serial: pull out calculation from baud_is_mode16
drivers/tty/serial/omap-serial.c | 34 ++++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
--
2.1.0
^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH v2 0/2]
@ 2013-12-04 7:54 Liu, Jinsong
0 siblings, 0 replies; 48+ messages in thread
From: Liu, Jinsong @ 2013-12-04 7:54 UTC (permalink / raw)
To: Paolo Bonzini, Gleb Natapov, qemu-devel@nongnu.org, kvm
Intel has released Memory Protection Extensions (MPX) recently.
Please refer to http://download-software.intel.com/sites/default/files/319433-015.pdf
These 2 patches are version2 to support Intel MPX at qemu side.
Version 1:
* Fix cpuid leaf 0x0d bug which incorrectly parsed eax and ebx;
* Expose cpuid leaf (0xd, 3) and (0xd, 4) to guest;
Version 2:
* Add comments to explain cpuid error parse (of current qemu) didn't generate wrong result;
* Add some MPX related definiation, and hardcode sizes and offsets of xsave features 3 and 4. It also add corresponding part to kvm_get/put_xsave.
Thanks,
Jinsong
^ permalink raw reply [flat|nested] 48+ messages in thread
end of thread, other threads:[~2025-07-04 9:12 UTC | newest]
Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-17 20:48 [PATCH 0/2] kernel: add error handling / logging to sel_write_load()/sel_make_bools() Gary Tierney
2016-12-17 20:48 ` [PATCH 1/2] selinux: log errors when loading new policy Gary Tierney
2016-12-19 14:43 ` Stephen Smalley
2016-12-19 14:43 ` Stephen Smalley
2016-12-19 15:08 ` Steve Grubb
2016-12-19 15:08 ` Steve Grubb
2016-12-19 15:19 ` Gary Tierney
2016-12-19 15:19 ` Gary Tierney
2016-12-19 15:32 ` Stephen Smalley
2016-12-19 15:32 ` Stephen Smalley
2016-12-19 16:00 ` Gary Tierney
2016-12-19 16:00 ` Gary Tierney
2016-12-20 1:28 ` [PATCH v2 0/2] Gary Tierney
2016-12-20 1:28 ` [PATCH v2 1/2] selinux: log errors when loading new policy Gary Tierney
2016-12-20 15:30 ` Stephen Smalley
2016-12-23 21:14 ` Paul Moore
2016-12-20 1:28 ` [PATCH v2 2/2] selinux: default to security isid in sel_make_bools() if no sid is found Gary Tierney
2016-12-20 15:31 ` Stephen Smalley
2016-12-23 21:20 ` Paul Moore
2016-12-20 3:15 ` [PATCH v2 0/2] Steve Grubb
2016-12-17 20:48 ` [PATCH 2/2] selinux: default to security isid in sel_make_bools() if no sid is found Gary Tierney
2016-12-19 14:46 ` Stephen Smalley
-- strict thread matches above, loose matches on Subject: below --
2025-07-04 9:03 [PATCH v2 0/2] Rex Chen
2024-03-14 11:04 bence.balogh
2024-03-18 18:25 ` Jon Mason
2021-05-05 13:49 Steven Rostedt
2021-05-05 13:51 ` Steven Rostedt
2020-09-25 16:50 Pavel Reichl
2020-03-02 13:32 [PATCH 1/1] remote.c: fix handling of push:remote_ref Jeff King
2020-03-03 16:12 ` [PATCH v2 0/2] Damien Robert
2018-04-26 18:24 Jacopo Mondi
2018-01-18 23:18 [PATCH V2 0/2] Amanda Brindle
2017-08-19 18:03 [PATCH v2 0/2] sean.wang
2017-08-19 18:03 ` sean.wang
2017-08-19 18:03 ` sean.wang at mediatek.com
2017-08-07 14:17 [patch " Oleksandr Shamray
2017-08-07 14:17 ` Oleksandr Shamray
[not found] ` <1502115467-1735-1-git-send-email-oleksandrs-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-08-09 14:31 ` Andrew Lunn
2017-08-09 14:31 ` Andrew Lunn
2017-08-09 14:31 ` Andrew Lunn
2017-08-10 15:18 ` Greg KH
2017-08-10 15:18 ` Greg KH
2017-03-06 18:20 [PATCH " Tamara Diaconita
2017-03-06 20:51 ` Greg KH
2015-02-13 12:03 [PATCH] testpmd: HW vlan command Ouyang Changchun
[not found] ` <1423829023-32707-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-06 8:00 ` [PATCH v2 0/2] Ouyang Changchun
[not found] ` <1425628813-1546-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-06 8:09 ` Ouyang, Changchun
2014-09-23 19:54 [PATCH 0/2] Fix a division by zero Frans Klaver
2014-09-23 21:58 ` Greg Kroah-Hartman
2014-09-24 7:55 ` [PATCH v2 0/2] Frans Klaver
2014-09-24 7:55 ` Frans Klaver
2013-12-04 7:54 Liu, Jinsong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.