lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 16 Oct 2020 14:52:13 +0200
From:   laniel_francis@...vacyrequired.com
To:     linux-hardening@...r.kernel.org
Subject: [RFC][PATCH v1] Fix and rename nla_strlcpy to nla_strcpy


First, I do hope you are all fine and the same for your relatives.

This 3 patches set answers to three first steps of this issue:
https://github.com/KSPP/linux/issues/110
Basically, I fix an inefficiency in nla_strlcpy where memset was called before
memcpy.
Then I modified the returned value to follow strscpy behavior and update where
this function is called and returned value is checked.
Finally, I rename nla_strlcpy to nla_strcpy and propagate the modifications in
all files where nla_strlcpy was called.

Unfortunately, I did not understand how to instanciate struct nlattr objects so
I tested the modified function by calling it directly on char *, this is why I
marked this patch as RFC.

If you have any remarks, feel free to share them so I can improve the code.

Here are the stats:
 drivers/infiniband/core/nldev.c            | 10 +++++-----
 drivers/misc/lkdtm/Makefile                |  1 +
 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                      |  3 ++-
 kernel/taskstats.c                         |  2 +-
 lib/nlattr.c                               | 35 ++++++++++++++++++++++-------------
 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 +-
 30 files changed, 70 insertions(+), 59 deletions(-)

Best regards.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ