Guest User

Untitled

a guest
Jun 15th, 2026
94
0
320 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | Software | 0 0
  1. #include <seccomp.h>
  2. #include <linux/net.h>
  3. #include <linux/in.h>
  4. #include <linux/in6.h>
  5. #include <linux/udp.h>
  6. #include <errno.h>
  7.  
  8. int main() {
  9.     scmp_filter_ctx ctx;
  10.  
  11.     ctx = seccomp_init(SCMP_ACT_ALLOW);
  12.  
  13.     // Block UDP-Lite socket creation
  14.     seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM),
  15.         SCMP_SYS(socket), 1,
  16.         SCMP_A2(SCMP_CMP_EQ, IPPROTO_UDPLITE));
  17.  
  18.     seccomp_load(ctx);
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment