[components][lwp]remove extra check in sys_bind

This commit is contained in:
zms123456 2024-09-12 06:04:05 +08:00 committed by GitHub
parent 08221b54d0
commit b423a6b1e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 11 deletions

View File

@ -2880,23 +2880,12 @@ sysret_t sys_bind(int socket, const struct musl_sockaddr *name, socklen_t namele
lwp_get_from_user(&family, (void *)name, 2); lwp_get_from_user(&family, (void *)name, 2);
if (family == AF_UNIX) if (family == AF_UNIX)
{ {
if (!lwp_user_accessable((void *)name, sizeof(struct sockaddr_un)))
{
return -EFAULT;
}
lwp_get_from_user(&un_addr, (void *)name, sizeof(struct sockaddr_un)); lwp_get_from_user(&un_addr, (void *)name, sizeof(struct sockaddr_un));
ret = bind(socket, (struct sockaddr *)&un_addr, namelen); ret = bind(socket, (struct sockaddr *)&un_addr, namelen);
} }
else if (family == AF_NETLINK) else if (family == AF_NETLINK)
{ {
if (!lwp_user_accessable((void *)name, namelen))
{
return -EFAULT;
}
lwp_get_from_user(&sa, (void *)name, namelen); lwp_get_from_user(&sa, (void *)name, namelen);
ret = bind(socket, &sa, namelen); ret = bind(socket, &sa, namelen);
} }
else else