Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff '--color=auto' -r -u20 a/net/socket.c b/net/socket.c
- --- a/net/socket.c 2026-06-09 13:28:53.000000000 +0300
- +++ b/net/socket.c 2026-06-15 15:22:33.020499207 +0300
- @@ -1529,40 +1529,42 @@
- * Returns 0 or an error. On failure @res is set to %NULL. @kern must
- * be set to true if the socket resides in kernel space.
- * This function internally uses GFP_KERNEL.
- */
- int __sock_create(struct net *net, int family, int type, int protocol,
- struct socket **res, int kern)
- {
- int err;
- struct socket *sock;
- const struct net_proto_family *pf;
- /*
- * Check protocol is in range
- */
- if (family < 0 || family >= NPROTO)
- return -EAFNOSUPPORT;
- if (type < 0 || type >= SOCK_MAX)
- return -EINVAL;
- + if ( ((family == AF_INET) || (family == AF_INET6)) && (protocol == IPPROTO_UDPLITE) ) { return -EPERM; }
- +
- /* Compatibility.
- This uglymoron is moved from INET layer to here to avoid
- deadlock in module load.
- */
- if (family == PF_INET && type == SOCK_PACKET) {
- pr_info_once("%s uses obsolete (PF_INET,SOCK_PACKET)\n",
- current->comm);
- family = PF_PACKET;
- }
- err = security_socket_create(family, type, protocol, kern);
- if (err)
- return err;
- /*
- * Allocate the socket and allow the family to set things up. if
- * the protocol is 0, the family is instructed to select an appropriate
- * default.
- */
Advertisement
Add Comment
Please, Sign In to add comment