public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 0/5] Netlink helper functions refactoring + CVE 2023-31248
@ 2023-11-14 12:31 Martin Doucha
  2023-11-14 12:31 ` [LTP] [PATCH v2 1/5] tst_rtnetlink: Refactor helper function for generic use Martin Doucha
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Martin Doucha @ 2023-11-14 12:31 UTC (permalink / raw)
  To: Petr Vorel, ltp

Let's refactor the rtnetlink helper functions for generic use where possible.
The Netlink context structure can be used for other Netlink protocols like
NETLINK_CRYPTO or NETLINK_NETFILTER. One of the exceptions is
the NETLINK_KOBJECT_UEVENT protocol which returns raw data without the usual
headers.

The first patch replaces the tst_rtnl_* and RTNL_* prefix with tst_netlink_*
and NETLINK_* respectively to signify that the functions can be used
for generic netlink communication. The attribute handling functions are
specific to the NETLINK_ROUTE protocol so they keep the old prefix. The fourth
patch adds new attribute handling functions for generic struct nlattr.

The third patch replaces old netlink send/receive helper functions
with the context-based helpers in crypto test code.

Finally, add test for CVE 2023-31248 which was promised in v1.

Martin Doucha (5):
  tst_rtnetlink: Refactor helper function for generic use
  tst_netlink_destroy_context(): Allow safely passing NULL context
  crypto: Replace old netlink helper functions with netlink contexts
  tst_netlink: Add helper functions for handling generic attributes
  Add test for CVE 2023-31248

 doc/C-Test-Network-API.asciidoc         | 159 +++++++++---------
 include/tst_crypto.h                    |  69 +-------
 include/tst_netdevice.h                 |   8 +-
 include/tst_netlink.h                   | 195 +++++++++++++---------
 include/tst_rtnetlink.h                 | 108 ------------
 lib/tst_crypto.c                        |  90 ++--------
 lib/tst_netdevice.c                     | 115 ++++++-------
 lib/{tst_rtnetlink.c => tst_netlink.c}  | 170 ++++++++++++++-----
 testcases/cve/tcindex01.c               |  16 +-
 testcases/kernel/crypto/crypto_user01.c |  58 +++----
 testcases/kernel/crypto/crypto_user02.c |  17 +-
 testcases/kernel/crypto/pcrypt_aead01.c |  10 +-
 testcases/network/iptables/Makefile     |   2 +-
 testcases/network/iptables/nft02.c      | 211 ++++++++++++++++++++++++
 14 files changed, 667 insertions(+), 561 deletions(-)
 delete mode 100644 include/tst_rtnetlink.h
 rename lib/{tst_rtnetlink.c => tst_netlink.c} (63%)
 create mode 100644 testcases/network/iptables/nft02.c

-- 
2.42.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-11-15 23:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-14 12:31 [LTP] [PATCH v2 0/5] Netlink helper functions refactoring + CVE 2023-31248 Martin Doucha
2023-11-14 12:31 ` [LTP] [PATCH v2 1/5] tst_rtnetlink: Refactor helper function for generic use Martin Doucha
2023-11-14 19:14   ` Petr Vorel
2023-11-14 12:31 ` [LTP] [PATCH v2 2/5] tst_netlink_destroy_context(): Allow safely passing NULL context Martin Doucha
2023-11-14 12:31 ` [LTP] [PATCH v2 3/5] crypto: Replace old netlink helper functions with netlink contexts Martin Doucha
2023-11-14 12:31 ` [LTP] [PATCH v2 4/5] tst_netlink: Add helper functions for handling generic attributes Martin Doucha
2023-11-14 12:31 ` [LTP] [PATCH v2 5/5] Add test for CVE 2023-31248 Martin Doucha
2023-11-14 15:39   ` Petr Vorel
2023-11-15  7:43     ` 河原颯太
2023-11-15  8:23       ` Petr Vorel
2023-11-15  9:16         ` Jan Stancek
2023-11-15 17:34       ` Martin Doucha
2023-11-15 23:39         ` 河原颯太

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox