Fix inefficiences and rename nla_strlcpy
Status from this message: Applied, thank you!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest posting 2/23 patches 2 repliesApplied
- v5 posting 1/23 patches 7 repliesSuperseded
- v43 patches 2 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 RFC | 3 patches | 13 replies | Superseded | |
| v2 RFC | 3 patches | 14 replies | Superseded | |
| v1 | 3 patches | 9 replies | Superseded |
Patches in v5 posting 2/2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | Fix unefficient call to memset before memcpu in nla_strlcpy.lib/ | +2 | 0 replies | |
| 2/3 | Modify return value of nla_strlcpy to match that of strscpy.include/ include/ lib/ +3 more | +30 | 0 replies | |
| 3/3 | treewide: rename nla_strlcpy to nla_strscpy.drivers/ drivers/ drivers/ +26 more | +49 | 0 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Kees Cook |
|---|---|
| 1/3 | R-b |
| 2/3 | R-b |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RESEND,net-next,PATCH v5 0/3] Fix inefficiences and rename nla_strlcpy
From: Francis Laniel <[email protected]>
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 dst were written twice, one with 0 the other with src content.
2. The second one modifies nla_strlcpy to return the same value as strscpy, i.e. number of bytes written or -E2BIG if src was truncated.
It also modifies code that calls nla_strlcpy and checks for its return value.
3. The third renames nla_strlcpy to nla_strscpy.
Unfortunately, I did not find how to create struct nlattr objects so I tested my modifications on simple char* and with GDB using tc to get to tcf_proto_check_kind.
If you see any way to improve the code or have any remark, feel free to comment.
Best regards and take care of yourselves.
Francis Laniel (3):
Fix unefficient call to memset before memcpu in nla_strlcpy. Modify return value of nla_strlcpy to match that of strscpy.
treewide: rename nla_strlcpy to nla_strscpy.
drivers/infiniband/core/nldev.c | 10 +++--- drivers/net/can/vxcan.c | 4 +-- drivers/net/veth.c | 4 +-- include/linux/genl_magic_struct.h | 2 +- include/net/netlink.h | 4 +-- include/net/pkt_cls.h | 2 +- kernel/taskstats.c | 2 +- lib/nlattr.c | 42 ++++++++++++++-------- net/core/fib_rules.c | 4 +-- net/core/rtnetlink.c | 12 +++---- net/decnet/dn_dev.c | 2 +- net/ieee802154/nl-mac.c | 2 +- net/ipv4/devinet.c | 2 +- net/ipv4/fib_semantics.c | 2 +- net/ipv4/metrics.c | 2 +- net/netfilter/ipset/ip_set_hash_netiface.c | 4 +-- net/netfilter/nf_tables_api.c | 6 ++-- net/netfilter/nfnetlink_acct.c | 2 +- net/netfilter/nfnetlink_cthelper.c | 4 +-- net/netfilter/nft_ct.c | 2 +- net/netfilter/nft_log.c | 2 +- net/netlabel/netlabel_mgmt.c | 2 +- net/nfc/netlink.c | 2 +- net/sched/act_api.c | 2 +- net/sched/act_ipt.c | 2 +- net/sched/act_simple.c | 4 +-- net/sched/cls_api.c | 2 +- net/sched/sch_api.c | 2 +- net/tipc/netlink_compat.c | 2 +- 29 files changed, 73 insertions(+), 61 deletions(-)
Signature · 1 line
2.20.1