public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* selinux: support IPPROTO_SMC in socket_type_to_security_class()
@ 2024-08-15  8:32 Jeongjun Park
  2024-08-15 16:28 ` Stephen Smalley
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Jeongjun Park @ 2024-08-15  8:32 UTC (permalink / raw)
  To: paul, stephen.smalley.work, omosnace; +Cc: selinux, linux-kernel, Jeongjun Park

IPPROTO_SMC feature has been added to net/smc. It is now possible to 
create smc sockets in the following way:

  /* create v4 smc sock */
  v4 = socket(AF_INET, SOCK_STREAM, IPPROTO_SMC);

  /* create v6 smc sock */
  v6 = socket(AF_INET6, SOCK_STREAM, IPPROTO_SMC);

Therefore, we need to add code to support IPPROTO_SMC in 
socket_type_to_security_class().

Signed-off-by: Jeongjun Park <aha310510@gmail.com>
---
 security/selinux/hooks.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index bfa61e005aac..36f951f0c574 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1176,6 +1176,8 @@ static inline u16 socket_type_to_security_class(int family, int type, int protoc
 				return SECCLASS_TCP_SOCKET;
 			else if (extsockclass && protocol == IPPROTO_SCTP)
 				return SECCLASS_SCTP_SOCKET;
+			else if (extsockclass && protocol == IPPROTO_SMC)
+				return SECCLASS_SMC_SOCKET;
 			else
 				return SECCLASS_RAWIP_SOCKET;
 		case SOCK_DGRAM:
--

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-08-30 20:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15  8:32 selinux: support IPPROTO_SMC in socket_type_to_security_class() Jeongjun Park
2024-08-15 16:28 ` Stephen Smalley
2024-08-16  1:46 ` Paul Moore
2024-08-16  3:57   ` Jeongjun Park
2024-08-16 11:21     ` Stephen Smalley
2024-08-16 11:42       ` Stephen Smalley
2024-08-16 12:53         ` Stephen Smalley
2024-08-19  9:46 ` Ondrej Mosnacek
2024-08-20 18:24   ` Stephen Smalley
2024-08-20 19:51     ` Paul Moore
2024-08-21 13:37       ` Stephen Smalley
2024-08-21 20:01         ` Paul Moore
2024-08-29 13:50           ` Stephen Smalley
2024-08-30 20:04             ` Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox