On Mon, 2017-09-18 at 09:41 +0200, Richard Cochran wrote:

> +     case SO_TXTIME:
> +             if (!sock_flag(sk, SOCK_TXTIME))
> +                     return -EINVAL;
> +             sockc->transmit_time = *(u64 *)CMSG_DATA(cmsg);

1) No guarantee the CMSG is properly aligned on arches that might trap
on unaligned access.

2) No guarantee user provided 8 bytes here.

Also, what would be the time base here ?

> +             break;
>       /* SCM_RIGHTS and SCM_CREDENTIALS are semantically in SOL_UNIX. */
>       case SCM_RIGHTS:
>       case SCM_CREDENTIALS:


Reply via email to