Re: [PATCH net-next] bpf: avoid copying junk bytes in bpf_get_current_comm()

From: Alexei Starovoitov
Date: Fri Mar 11 2016 - 13:35:35 EST


On 3/11/16 10:02 AM, Daniel Borkmann wrote:
Would strscpy() help in this case (see 30035e45753b ("string: provide
strscpy()"))?

I've looked at it too, but 990486c8af04 scared me a little,
it's not easily backport-able and mainly I don't think
it's faster than strlcpy for small strings like comm.
memcpy going to be faster for sure.