Re: [PATCH bpf-next 2/2 v2] selftests/bpf: Test bpf_skc_to_unix_sock() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 7, 2021 at 7:14 AM Hengqi Chen <hengqi.chen@xxxxxxxxx> wrote:
> +
> +       sockaddr.sun_family = AF_UNIX;
> +       strcpy(sockaddr.sun_path, sock_path);

please use strncpy.

> +       len = sizeof(sockaddr);
> +       unlink(sock_path);

please use abstract socket to avoid unlink and potential race.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux