[RESEND,net-next,PATCH v5 1/3] Fix unefficient call to memset before memcpu in nla_strlcpy.

2020-11-15 Thread laniel_francis
From: Francis Laniel Before this commit, nla_strlcpy first memseted dst to 0 then wrote src into it. This is inefficient because bytes whom number is less than src length are written twice. This patch solves this issue by first writing src into dst then fill dst with 0's. Note that, in the case

[RESEND,net-next,PATCH v5 2/3] Modify return value of nla_strlcpy to match that of strscpy.

2020-11-15 Thread laniel_francis
From: Francis Laniel nla_strlcpy now returns -E2BIG if src was truncated when written to dst. It also returns this error value if dstsize is 0 or higher than INT_MAX. For example, if src is "foo\0" and dst is 3 bytes long, the result will be: 1. "foG" after memcpy (G means garbage). 2. "fo\0" af

[RESEND,net-next,PATCH v5 3/3] treewide: rename nla_strlcpy to nla_strscpy.

2020-11-15 Thread laniel_francis
From: Francis Laniel Calls to nla_strlcpy are now replaced by calls to nla_strscpy which is the new name of this function. Signed-off-by: Francis Laniel Reviewed-by: Kees Cook --- drivers/infiniband/core/nldev.c| 10 +- drivers/net/can/vxcan.c| 4 ++--

[RESEND,net-next,PATCH v5 0/3] Fix inefficiences and rename nla_strlcpy

2020-11-15 Thread laniel_francis
From: Francis Laniel Hi. I hope you are all fine and the same for your relatives. This patch set answers to first three issues listed in: https://github.com/KSPP/linux/issues/110 To sum up, the patch contributions are the following: 1. the first patch fixes an inefficiency where some bytes in

[PATCH v5 0/3] Fix inefficiences and rename nla_strlcpy

2020-11-13 Thread laniel_francis
From: Francis Laniel Hi. I hope you are all fine and the same for your relatives. This patch set answers to first three issues listed in: https://github.com/KSPP/linux/issues/110 To sum up, the patch contributions are the following: 1. the first patch fixes an inefficiency where some bytes in

[PATCH v5 3/3] treewide: rename nla_strlcpy to nla_strscpy.

2020-11-13 Thread laniel_francis
From: Francis Laniel Calls to nla_strlcpy are now replaced by calls to nla_strscpy which is the new name of this function. Signed-off-by: Francis Laniel Reviewed-by: Kees Cook --- drivers/infiniband/core/nldev.c| 10 +- drivers/net/can/vxcan.c| 4 ++--

[PATCH v5 1/3] Fix unefficient call to memset before memcpu in nla_strlcpy.

2020-11-13 Thread laniel_francis
From: Francis Laniel Before this commit, nla_strlcpy first memseted dst to 0 then wrote src into it. This is inefficient because bytes whom number is less than src length are written twice. This patch solves this issue by first writing src into dst then fill dst with 0's. Note that, in the case

[PATCH v5 2/3] Modify return value of nla_strlcpy to match that of strscpy.

2020-11-13 Thread laniel_francis
From: Francis Laniel nla_strlcpy now returns -E2BIG if src was truncated when written to dst. It also returns this error value if dstsize is 0 or higher than INT_MAX. For example, if src is "foo\0" and dst is 3 bytes long, the result will be: 1. "foG" after memcpy (G means garbage). 2. "fo\0" af

[PATCH v4 3/3] treewide: rename nla_strlcpy to nla_strscpy.

2020-10-30 Thread laniel_francis
From: Francis Laniel Calls to nla_strlcpy are now replaced by calls to nla_strscpy which is the new name of this function. Signed-off-by: Francis Laniel Reviewed-by: Kees Cook --- drivers/infiniband/core/nldev.c| 10 +- drivers/net/can/vxcan.c| 4 ++--

[PATCH v4 2/3] Modify return value of nla_strlcpy to match that of strscpy.

2020-10-30 Thread laniel_francis
From: Francis Laniel nla_strlcpy now returns -E2BIG if src was truncated when written to dst. It also returns this error value if dstsize is 0 or higher than INT_MAX. For example, if src is "foo\0" and dst is 3 bytes long, the result will be: 1. "foG" after memcpy (G means garbage). 2. "fo\0" af

[PATCH v4 1/3] Fix unefficient call to memset before memcpu in nla_strlcpy.

2020-10-30 Thread laniel_francis
From: Francis Laniel Before this commit, nla_strlcpy first memseted dst to 0 then wrote src into it. This is inefficient because bytes whom number is less than src length are written twice. This patch solves this issue by first writing src into dst then fill dst with 0's. Note that, in the case

[PATCH v4 0/3] Fix inefficiences and rename nla_strlcpy

2020-10-30 Thread laniel_francis
From: Francis Laniel Hi. I hope your relatives and yourselves are fine. This patch set answers to first three issues listed in: https://github.com/KSPP/linux/issues/110 To sum up, the first patch fixes an inefficiency where some bytes in dst were written twice, one with 0 the other with src c

[RFC][PATCH v3 1/3] Fix unefficient call to memset before memcpu in nla_strlcpy.

2020-10-20 Thread laniel_francis
From: Francis Laniel Before this commit, nla_strlcpy first memseted dst to 0 then wrote src into it. This is inefficient because bytes whom number is less than src length are written twice. This patch solves this issue by first writing src into dst then fill dst with 0's. Note that, in the case

[RFC][PATCH v3 0/3] Fix inefficiences and rename nla_strlcpy

2020-10-20 Thread laniel_francis
From: Francis Laniel Hi. I hope your relatives and yourselves are fine. This patch set answers to first three issues listed in: https://github.com/KSPP/linux/issues/110 To sum up, the first patch fixes an inefficiency where some bytes in dst were written twice, one with 0 the other with src c

[RFC][PATCH v3 2/3] Modify return value of nla_strlcpy to match that of strscpy.

2020-10-20 Thread laniel_francis
From: Francis Laniel nla_strlcpy now returns -E2BIG if src was truncated when written to dst. It also returns this error value if dstsize is 0 or higher than INT_MAX. For example, if src is "foo\0" and dst is 3 bytes long, the result will be: 1. "foG" after memcpy (G means garbage). 2. "fo\0" af

[RFC][PATCH v3 3/3] Rename nla_strlcpy to nla_strscpy.

2020-10-20 Thread laniel_francis
From: Francis Laniel Calls to nla_strlcpy are now replaced by calls to nla_strscpy which is the new name of this function. Signed-off-by: Francis Laniel --- drivers/infiniband/core/nldev.c| 10 +- drivers/net/can/vxcan.c| 4 ++-- drivers/net/veth.c