Message ID | 20201113111133.15011-1-laniel_francis@privacyrequired.com |
---|---|
Headers | show |
Series | Fix inefficiences and rename nla_strlcpy | expand |
On Fri, Nov 13, 2020 at 12:11:30PM +0100, laniel_francis@privacyrequired.com wrote: > From: Francis Laniel <laniel_francis@privacyrequired.com> > > 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. Thanks! This looks good to me. Jakub, does this look ready to you? > > 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(-) > > -- > 2.20.1 >
On Fri, 13 Nov 2020 10:56:26 -0800 Kees Cook wrote: > Thanks! This looks good to me. > > Jakub, does this look ready to you? Yup, looks good, sorry! But it didn't get into patchwork cleanly :/ One more resend please? (assuming we're expected to take this into net-next)
Le dimanche 15 novembre 2020, 01:18:37 CET Jakub Kicinski a écrit : > On Fri, 13 Nov 2020 10:56:26 -0800 Kees Cook wrote: > > Thanks! This looks good to me. > > > > Jakub, does this look ready to you? > > Yup, looks good, sorry! > > But it didn't get into patchwork cleanly :/ > > One more resend please? (assuming we're expected to take this > into net-next) I will send it again and tag it for net-next. Just to know, is patchwork this: https://patchwork.kernel.org/project/netdevbpf/list/ ?
On Sun, 15 Nov 2020 18:05:39 +0100 Francis Laniel wrote: > Le dimanche 15 novembre 2020, 01:18:37 CET Jakub Kicinski a écrit : > > On Fri, 13 Nov 2020 10:56:26 -0800 Kees Cook wrote: > > > Thanks! This looks good to me. > > > > > > Jakub, does this look ready to you? > > > > Yup, looks good, sorry! > > > > But it didn't get into patchwork cleanly :/ > > > > One more resend please? (assuming we're expected to take this > > into net-next) > > I will send it again and tag it for net-next. > > Just to know, is patchwork this: > https://patchwork.kernel.org/project/netdevbpf/list/ Yes, that's the one.
Le lundi 16 novembre 2020, 17:06:52 CET Jakub Kicinski a écrit : > On Sun, 15 Nov 2020 18:05:39 +0100 Francis Laniel wrote: > > Le dimanche 15 novembre 2020, 01:18:37 CET Jakub Kicinski a écrit : > > > On Fri, 13 Nov 2020 10:56:26 -0800 Kees Cook wrote: > > > > Thanks! This looks good to me. > > > > > > > > Jakub, does this look ready to you? > > > > > > Yup, looks good, sorry! > > > > > > But it didn't get into patchwork cleanly :/ > > > > > > One more resend please? (assuming we're expected to take this > > > into net-next) > > > > I will send it again and tag it for net-next. > > > > Just to know, is patchwork this: > > https://patchwork.kernel.org/project/netdevbpf/list/ > > Yes, that's the one. OK! The tool seems cool. So normally I resend the patches, but I do not see them in patchwork. Is there something am I supposed to do so they can be visible through patchwork?
On Mon, 16 Nov 2020 18:06:33 +0100 Francis Laniel wrote: > Le lundi 16 novembre 2020, 17:06:52 CET Jakub Kicinski a écrit : > > On Sun, 15 Nov 2020 18:05:39 +0100 Francis Laniel wrote: > > > Le dimanche 15 novembre 2020, 01:18:37 CET Jakub Kicinski a écrit : > > > > On Fri, 13 Nov 2020 10:56:26 -0800 Kees Cook wrote: > > > > > Thanks! This looks good to me. > > > > > > > > > > Jakub, does this look ready to you? > > > > > > > > Yup, looks good, sorry! > > > > > > > > But it didn't get into patchwork cleanly :/ > > > > > > > > One more resend please? (assuming we're expected to take this > > > > into net-next) > > > > > > I will send it again and tag it for net-next. > > > > > > Just to know, is patchwork this: > > > https://patchwork.kernel.org/project/netdevbpf/list/ > > > > Yes, that's the one. > > OK! The tool seems cool. > > So normally I resend the patches, but I do not see them in patchwork. > Is there something am I supposed to do so they can be visible through > patchwork? They were visible, this is your resend: https://patchwork.kernel.org/project/netdevbpf/list/?series=384457&state=* (note the * at the end, sometimes it gets stripped when clicking on a link) Maybe you checked after I already applied them, patches which had been "handled" (aka "Action required=no") are not displayed by default.
Le lundi 16 novembre 2020, 18:32:43 CET Jakub Kicinski a écrit : > On Mon, 16 Nov 2020 18:06:33 +0100 Francis Laniel wrote: > > Le lundi 16 novembre 2020, 17:06:52 CET Jakub Kicinski a écrit : > > > On Sun, 15 Nov 2020 18:05:39 +0100 Francis Laniel wrote: > > > > Le dimanche 15 novembre 2020, 01:18:37 CET Jakub Kicinski a écrit : > > > > > On Fri, 13 Nov 2020 10:56:26 -0800 Kees Cook wrote: > > > > > > Thanks! This looks good to me. > > > > > > > > > > > > Jakub, does this look ready to you? > > > > > > > > > > Yup, looks good, sorry! > > > > > > > > > > But it didn't get into patchwork cleanly :/ > > > > > > > > > > One more resend please? (assuming we're expected to take this > > > > > into net-next) > > > > > > > > I will send it again and tag it for net-next. > > > > > > > > Just to know, is patchwork this: > > > > https://patchwork.kernel.org/project/netdevbpf/list/ > > > > > > Yes, that's the one. > > > > OK! The tool seems cool. > > > > So normally I resend the patches, but I do not see them in patchwork. > > Is there something am I supposed to do so they can be visible through > > patchwork? > > They were visible, this is your resend: > > https://patchwork.kernel.org/project/netdevbpf/list/?series=384457&state=* > > (note the * at the end, sometimes it gets stripped when clicking on a > link) > > Maybe you checked after I already applied them, patches which had been > "handled" (aka "Action required=no") are not displayed by default. Working of patchwork is now clearer for me, thank you! But yes I think I checked after you applied them.
From: Francis Laniel <laniel_francis@privacyrequired.com> 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(-)