[PATCH v3 0/5] Decode family field of Netlink GENERIC protocol

Masatake YAMATO yamato at redhat.com
Tue Jun 13 08:26:40 UTC 2017

Netlink GENERIC protocol allows a process to talk with a subsystem of
Linux kernel specified by its name(family name); the process asks the
id(family id)for the name first, then talks to the subsystem with the
id. The id is defined at run-time, when the subsystem is
registered. Therefore strace cannot make a table mapping from a family
id to its family name in build-time.

These change sets are for decoding family ids.
strace gets the mapping and makes the table at run-time.

Following case is not considered yet.
The target process it self can ask registering a subsystem not
registered yet to Linux kernel. When strace detects such action of the
target process, strace should extend the table for decoding the family id
of the newly registered subsystem.

Highlight in v3:

	 * Introduce xstrndup and use it for extracting a family name
	   from a netlink packet.

	 * Reflect suggestions from ldv.

Changes in v2:

	* Fix the most of formatting issues reported by Linux kernel's
	  checkpatch.pl script.
	  Suggested by Dmitry V. Levin <ldv at altlinux.org>.

	* keep NETLINK_* entries in nlmsg_types sorted.
	  Suggested by JingPiao Chen <chenjingpiao at gmail.com>.

	* Add tests/.gitignore to 6/6 change log.
	  Suggested by JingPiao Chen <chenjingpiao at gmail.com>.

Masatake YAMATO (5):
  dyxlat: building xlat dynamically
  Introduce xstrndup function
  socketutils: build a xlat table dynamically for decoding "family"
    field of Netlink GENERIC protocol
  netlink: decode "family" field of Netlink GENERIC protocol
  tests: add check for decoding family field of netlink GENERIC protocol

 Makefile.am                 |   1 +
 configure.ac                |   1 +
 defs.h                      |   9 ++++
 dyxlat.c                    | 103 +++++++++++++++++++++++++++++++++++++++++
 netlink.c                   |   8 +++-
 socketutils.c               | 110 ++++++++++++++++++++++++++++++++++++++++++++
 tests/.gitignore            |   1 +
 tests/gen_tests.in          |   1 +
 tests/netlink_generic.c     |  80 ++++++++++++++++++++++++++++++++
 tests/pure_executables.list |   1 +
 xmalloc.c                   |  12 +++++
 11 files changed, 325 insertions(+), 2 deletions(-)
 create mode 100644 dyxlat.c
 create mode 100644 tests/netlink_generic.c


More information about the Strace-devel mailing list