Skip to content

exporting capability name/code pairs (final#2)

Kohei KaiGai lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3add a private data field within kobj_attribute structure (final#2)Documentation/kobject.txt include/linux/kobject.h include/linux/sysfs.h+14 -07 replies
1/3add a private data field within kobj_attribute structure.Documentation/kobject.txt include/linux/kobject.h include/linux/sysfs.h+14 -00 replies
2/3exporting capability name/code pairs (final#2)Documentation/ABI/testing/sysfs-kernel-capability scripts/mkcapnames.sh security/Makefile +1 more+175 -04 replies
2/3exporting capability name/code pairsscripts/mkcapnames.sh security/Makefile security/commoncap.c+152 -00 replies
3/3a new example to use kobject/kobj_attribute (final#2)samples/kobject/kobject-example.c+32 -00 replies
3/3a new example to use kobject/kobj_attributesamples/kobject/kobject-example.c+32 -00 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchAndrew G. MorganSerge Hallyn
1/3
1/3
2/3A-b T-b A-b T-b
2/3A-b T-b A-b T-b
3/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] exporting capability name/code pairs (final#2)

The following three patches enables to export code/name pairs of capabilities the running kernel supports, and add a documentation and samples to use this feature.

[PATCH 1/3] add a private data field within kobj_attribute structure.

This patch add a private data field, declared as void *, within kobj_attribute structure. The _show() and _store() method in the sysfs attribute entries can refer this information to identify what entry is accessed.
It makes easier to share a single method implementation with several similar entries, like ones to export the list of capabilities the running kernel supports.

[PATCH 2/3] exporting capability name/code pairs

This patch enables to export code/name pairs of capabilities the running kernel supported.

A newer kernel sometimes adds new capabilities, like CAP_MAC_ADMIN at 2.6.25. However, we have no interface to disclose what capabilities are supported on the running kernel. Thus, we have to maintain libcap version in appropriate one synchronously.

This patch enables libcap to collect the list of capabilities at run time, and provide them for users. It helps to improve portability of library.

It exports these information as regular files under /sys/kernel/capability. The numeric node exports its name, the symbolic node exports its code.

[PATCH 3/3] a new example to use kobject/kobj_attribute

This patch can provide a new exmple to use kobject and attribute. The _show() and _store() method can refer/store the private data field of kobj_attribute structure to know what entries are accessed by users. It will make easier to share a single _show()/_store() method with several entries.

o changes from the previous version
- add a short description at Documentation/kobject.txt, to use private member within kobj_attribute.
- "supported" is replaced with "supports" at sysfs-kernel-capability.
- "$(src)/../" is replaced with "$(srctree)/" at security/Makefile
- The private member is casted to long, when it stores integer value.

Thanks,

Signature · 2 lines
OSS Platform Development Division, NEC
KaiGai Kohei <[email protected]>