Commit 2d151d39073a ("xfrm: Add possibility to set the default to block
if we have no policy") broke ABI by changing the value of the XFRM_MSG_MAPPING
enum item, thus also evading the build-time check
in security/selinux/nlmsgtab.c:selinux_nlmsg_lookup for presence of proper
security permission checks in nlmsg_xfrm_perms. Fix it by placing
XFRM_MSG_SETDEFAULT/XFRM_MSG_GETDEFAULT to the end of the enum, right before
__XFRM_MSG_MAX, and updating the nlmsg_xfrm_perms accordingly.
Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy")
References: https://lore.kernel.org/netdev/20210901151402.GA2557@altlinux.org/
Signed-off-by: Eugene Syromiatnikov <redacted>
---
v2:
- Updated SELinux nlmsg_xfrm_perms permissions table and selinux_nlmsg_lookup
build-time check accordingly.
v1: https://lore.kernel.org/lkml/20210901153407.GA20446@asgard.redhat.com/
---
include/uapi/linux/xfrm.h | 6 +++---
security/selinux/nlmsgtab.c | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)
Thanks!
Acked-by: Antony Antony <redacted>
-antony
On Sun, Sep 12, 2021 at 14:22:34 +0200, Eugene Syromiatnikov wrote:
quoted hunk
Commit 2d151d39073a ("xfrm: Add possibility to set the default to block
if we have no policy") broke ABI by changing the value of the XFRM_MSG_MAPPING
enum item, thus also evading the build-time check
in security/selinux/nlmsgtab.c:selinux_nlmsg_lookup for presence of proper
security permission checks in nlmsg_xfrm_perms. Fix it by placing
XFRM_MSG_SETDEFAULT/XFRM_MSG_GETDEFAULT to the end of the enum, right before
__XFRM_MSG_MAX, and updating the nlmsg_xfrm_perms accordingly.
Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy")
References: https://lore.kernel.org/netdev/20210901151402.GA2557@altlinux.org/
Signed-off-by: Eugene Syromiatnikov <redacted>
---
v2:
- Updated SELinux nlmsg_xfrm_perms permissions table and selinux_nlmsg_lookup
build-time check accordingly.
v1: https://lore.kernel.org/lkml/20210901153407.GA20446@asgard.redhat.com/
---
include/uapi/linux/xfrm.h | 6 +++---
security/selinux/nlmsgtab.c | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)
From: Ondrej Mosnacek <omosnace@redhat.com> Date: 2021-09-13 07:16:59
Hi,
On Sun, Sep 12, 2021 at 2:23 PM Eugene Syromiatnikov [off-list ref] wrote:
quoted hunk
Commit 2d151d39073a ("xfrm: Add possibility to set the default to block
if we have no policy") broke ABI by changing the value of the XFRM_MSG_MAPPING
enum item, thus also evading the build-time check
in security/selinux/nlmsgtab.c:selinux_nlmsg_lookup for presence of proper
security permission checks in nlmsg_xfrm_perms. Fix it by placing
XFRM_MSG_SETDEFAULT/XFRM_MSG_GETDEFAULT to the end of the enum, right before
__XFRM_MSG_MAX, and updating the nlmsg_xfrm_perms accordingly.
Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy")
References: https://lore.kernel.org/netdev/20210901151402.GA2557@altlinux.org/
Signed-off-by: Eugene Syromiatnikov <redacted>
---
v2:
- Updated SELinux nlmsg_xfrm_perms permissions table and selinux_nlmsg_lookup
build-time check accordingly.
v1: https://lore.kernel.org/lkml/20210901153407.GA20446@asgard.redhat.com/
---
include/uapi/linux/xfrm.h | 6 +++---
security/selinux/nlmsgtab.c | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)
Perhaps it would be a good idea to put a comment here to make it less
likely that this repeats in the future. Something like:
/* IMPORTANT: Only insert new entries right above this line, otherwise
you break ABI! */
On Mon, Sep 13, 2021 at 09:16:39AM +0200, Ondrej Mosnacek wrote:
Perhaps it would be a good idea to put a comment here to make it less
likely that this repeats in the future. Something like:
/* IMPORTANT: Only insert new entries right above this line, otherwise
you break ABI! */
Well, this statement is true for (almost) every UAPI-exposed enum, and
netlink is vast and relies on enums heavily. I think it is already
mentioned somewhere in the documentation, and in the end it falls on the
shoulders of the maintainers—to pay additional attention to UAPI changes.
From: Ondrej Mosnacek <omosnace@redhat.com> Date: 2021-09-13 13:54:15
On Mon, Sep 13, 2021 at 12:23 PM Eugene Syromiatnikov [off-list ref] wrote:
On Mon, Sep 13, 2021 at 09:16:39AM +0200, Ondrej Mosnacek wrote:
quoted
Perhaps it would be a good idea to put a comment here to make it less
likely that this repeats in the future. Something like:
/* IMPORTANT: Only insert new entries right above this line, otherwise
you break ABI! */
Well, this statement is true for (almost) every UAPI-exposed enum, and
netlink is vast and relies on enums heavily. I think it is already
mentioned somewhere in the documentation, and in the end it falls on the
shoulders of the maintainers—to pay additional attention to UAPI changes.
Ok, fair enough.
--
Ondrej Mosnacek
Software Engineer, Linux Security - SELinux kernel
Red Hat, Inc.
From: Nicolas Dichtel <hidden> Date: 2021-09-14 07:51:10
Le 12/09/2021 à 14:22, Eugene Syromiatnikov a écrit :
Commit 2d151d39073a ("xfrm: Add possibility to set the default to block
if we have no policy") broke ABI by changing the value of the XFRM_MSG_MAPPING
enum item, thus also evading the build-time check
in security/selinux/nlmsgtab.c:selinux_nlmsg_lookup for presence of proper
security permission checks in nlmsg_xfrm_perms. Fix it by placing
XFRM_MSG_SETDEFAULT/XFRM_MSG_GETDEFAULT to the end of the enum, right before
__XFRM_MSG_MAX, and updating the nlmsg_xfrm_perms accordingly.
Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy")
References: https://lore.kernel.org/netdev/20210901151402.GA2557@altlinux.org/
Signed-off-by: Eugene Syromiatnikov <redacted>
On Sun, Sep 12, 2021 at 02:22:34PM +0200, Eugene Syromiatnikov wrote:
Commit 2d151d39073a ("xfrm: Add possibility to set the default to block
if we have no policy") broke ABI by changing the value of the XFRM_MSG_MAPPING
enum item, thus also evading the build-time check
in security/selinux/nlmsgtab.c:selinux_nlmsg_lookup for presence of proper
security permission checks in nlmsg_xfrm_perms. Fix it by placing
XFRM_MSG_SETDEFAULT/XFRM_MSG_GETDEFAULT to the end of the enum, right before
__XFRM_MSG_MAX, and updating the nlmsg_xfrm_perms accordingly.
Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy")
References: https://lore.kernel.org/netdev/20210901151402.GA2557@altlinux.org/
Signed-off-by: Eugene Syromiatnikov <redacted>