From: Oleksandr Andrushchenko <andr2000@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Artem_Mygaiev@epam.com, sstabellini@kernel.org,
Andrii_Anisov@epam.com,
Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
andr2000@gmail.com, julien.grall@arm.com
Subject: [RFC PATCH 4/4] cert:xen/xsm/flask: Add missing default labels to switch statements
Date: Fri, 22 Feb 2019 11:57:21 +0200 [thread overview]
Message-ID: <20190222095721.24764-5-andr2000@gmail.com> (raw)
In-Reply-To: <20190222095721.24764-1-andr2000@gmail.com>
From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
It is required by MISRA [1] that every switch statement has a default
label as a measure of defensive programming technique.
The changes in this patch are to match MISRA C:2012: Rule 16.4
requirements.
[1] https://www.misra.org.uk/
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---
xen/xsm/flask/avc.c | 2 ++
xen/xsm/flask/hooks.c | 4 ++++
xen/xsm/flask/ss/services.c | 5 +++++
3 files changed, 11 insertions(+)
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 640c708659b0..06ac404b0ad6 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -590,6 +590,8 @@ void avc_audit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
case AVC_AUDIT_DATA_DTDEV:
avc_printk(&buf, "dtdevice=%s ", a->dtdev);
break;
+ default:
+ break;
}
avc_dump_query(&buf, ssid, tsid, tclass);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 3d00c747f6b7..f29c4a4ffd05 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -339,6 +339,8 @@ static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *c
if (irq && get_irq_sid(irq, &sid, NULL))
return NULL;
break;
+ default:
+ break;
}
if ( !sid )
return NULL;
@@ -1246,6 +1248,8 @@ static int flask_hvm_altp2mhvm_op(struct domain *d, uint64_t mode, uint32_t op)
if ( d == current->domain )
return -EPERM;
break;
+ default:
+ return -EPERM;
};
return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM_OP);
diff --git a/xen/xsm/flask/ss/services.c b/xen/xsm/flask/ss/services.c
index b59928ea8a98..30dab4c35308 100644
--- a/xen/xsm/flask/ss/services.c
+++ b/xen/xsm/flask/ss/services.c
@@ -1018,6 +1018,11 @@ static int security_compute_sid(u32 ssid,
/* Use the related object owner. */
newcontext.user = tcontext->user;
break;
+ default:
+ printk(KERN_ERR "security_compute_sid: unrecognized AVTAB %d\n",
+ specified);
+ rc = -EINVAL;
+ goto out_unlock;
}
/* Set the role and type to default values. */
--
2.20.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-02-22 9:57 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 9:57 [RFC PATCH 0/4] Add missing default labels to switch statements Oleksandr Andrushchenko
2019-02-22 9:57 ` [RFC PATCH 1/4] cert:arch/arm: " Oleksandr Andrushchenko
2019-02-22 18:24 ` Julien Grall
2019-02-22 9:57 ` [RFC PATCH 2/4] cert:xen/common: " Oleksandr Andrushchenko
2019-02-22 9:57 ` [RFC PATCH 3/4] cert:xen/drivers: " Oleksandr Andrushchenko
2019-02-22 9:57 ` Oleksandr Andrushchenko [this message]
2019-02-22 10:27 ` [RFC PATCH 0/4] " Andrew Cooper
2019-02-22 11:05 ` Julien Grall
2019-02-22 11:13 ` Oleksandr Andrushchenko
2019-02-22 11:27 ` Julien Grall
2019-02-22 12:01 ` Oleksandr Andrushchenko
2019-02-22 13:27 ` Julien Grall
2019-02-22 21:00 ` Stefano Stabellini
2019-02-22 21:33 ` Andrew Cooper
2019-02-22 21:58 ` Stefano Stabellini
2019-02-22 22:11 ` Julien Grall
2019-02-22 22:34 ` Stefano Stabellini
2019-02-22 23:11 ` Julien Grall
2019-02-25 17:38 ` Stefano Stabellini
2019-02-22 23:13 ` Julien Grall
2019-02-25 10:27 ` Oleksandr Andrushchenko
2019-02-25 10:57 ` Julien Grall
2019-02-22 22:34 ` Andrew Cooper
2019-02-22 22:38 ` Stefano Stabellini
2019-02-22 23:34 ` Julien Grall
2019-02-25 10:00 ` Oleksandr Andrushchenko
2019-02-25 11:08 ` Julien Grall
2019-02-25 11:37 ` Oleksandr Andrushchenko
2019-02-22 23:22 ` Julien Grall
2019-02-22 23:41 ` Andrew Cooper
2019-02-25 10:06 ` Oleksandr Andrushchenko
2019-02-25 11:10 ` Julien Grall
2019-02-25 11:43 ` Oleksandr Andrushchenko
2019-02-25 9:50 ` Oleksandr Andrushchenko
2019-02-25 11:23 ` Julien Grall
2019-02-25 11:49 ` Oleksandr Andrushchenko
2019-02-25 12:11 ` Jan Beulich
2019-02-25 12:32 ` Oleksandr Andrushchenko
2019-02-25 12:15 ` Julien Grall
2019-02-25 12:38 ` Oleksandr Andrushchenko
2019-02-25 12:50 ` Julien Grall
2019-02-25 13:06 ` Oleksandr Andrushchenko
2019-02-25 13:22 ` Julien Grall
2019-02-25 13:32 ` Oleksandr Andrushchenko
2019-02-25 13:40 ` Julien Grall
2019-02-25 13:47 ` Oleksandr Andrushchenko
2019-02-25 15:54 ` Lars Kurth
2019-02-25 17:42 ` Stefano Stabellini
2019-02-25 11:40 ` Jan Beulich
2019-02-25 16:58 ` George Dunlap
2019-02-25 17:47 ` Stefano Stabellini
2019-02-25 18:20 ` Julien Grall
2019-02-25 21:13 ` Stefano Stabellini
2019-02-25 21:34 ` Julien Grall
2019-02-26 7:43 ` Oleksandr Andrushchenko
2019-02-26 11:20 ` Jan Beulich
2019-02-26 11:33 ` Oleksandr Andrushchenko
2019-02-26 11:47 ` Jan Beulich
2019-02-26 12:20 ` Oleksandr Andrushchenko
2019-02-26 18:27 ` Stefano Stabellini
2019-02-27 9:23 ` Lars Kurth
2019-02-27 10:16 ` Jan Beulich
2019-02-27 17:34 ` Lars Kurth
2019-02-27 23:45 ` Stefano Stabellini
2019-02-28 10:30 ` Jan Beulich
2019-02-26 21:10 ` Stefano Stabellini
2019-02-26 21:31 ` Julien Grall
2019-02-26 11:14 ` Jan Beulich
2019-02-22 22:08 ` Julien Grall
2019-02-25 10:11 ` Oleksandr Andrushchenko
2019-02-25 11:47 ` Julien Grall
2019-02-25 11:59 ` Oleksandr Andrushchenko
2019-02-25 12:10 ` Jan Beulich
2019-02-22 11:20 ` Andrii Anisov
2019-02-22 11:21 ` Andrii Anisov
2019-02-22 11:30 ` Julien Grall
2019-02-22 11:32 ` Julien Grall
2019-02-22 11:53 ` Andrii Anisov
2019-02-22 13:30 ` Julien Grall
2019-02-25 11:43 ` Julien Grall
2019-02-25 12:00 ` Oleksandr Andrushchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190222095721.24764-5-andr2000@gmail.com \
--to=andr2000@gmail.com \
--cc=Andrii_Anisov@epam.com \
--cc=Artem_Mygaiev@epam.com \
--cc=julien.grall@arm.com \
--cc=oleksandr_andrushchenko@epam.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is 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.