aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Upgrade libcap to libcap-2.39 am: d3106b3008 am: b8008e6571Haibo Huang2020-07-1496-453/+2240
|\ | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/external/libcap/+/1361151 Change-Id: Ib802163dd78dc2cb06eefb928110f19deea34122
| * Upgrade libcap to libcap-2.39 am: d3106b3008Haibo Huang2020-07-1496-453/+2240
| |\ | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/external/libcap/+/1361151 Change-Id: I940aff3f1c240e92e2c52b3bc215031c3c35f5a1
| | * Upgrade libcap to libcap-2.39android-r-beta-3android-r-beta-2Haibo Huang2020-07-1396-453/+2240
| | |\ | | | | | | | | | | | | Change-Id: I372a3e08bacb93acadb81ff5ca263eac882ef7a2
| | | * Up the release version to 2.39Andrew G. Morgan2020-07-112-2/+2
| | | | | | | | | | | | | | | | Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * More experiments with markdown as a representation for the man pages.Andrew G. Morgan2020-07-112-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm leaning towards pandoc instead of man-to-md. Mostly because it has greater coverage in terms of supported formats. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Some documentation for individual capability values.Andrew G. Morgan2020-07-1145-8/+536
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I want a place to capture nuances in these files through experience and bug reports/patches. Make use of these to document the Go cap package definitions of each Value so that the godoc automated documentation at places like go.dev become more useful for actually using the package. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * libcap/cap Go package documentation cleanup.Andrew G. Morgan2020-07-096-23/+45
| | | | | | | | | | | | | | | | Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Rewrite libpsx thread shutdown path to support musl.Andrew G. Morgan2020-07-098-85/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Addresses: https://bugzilla.kernel.org/show_bug.cgi?id=208477 Removed the non-wrapping libpsx macro hacks. The API surface as such becomes a little smaller and I now have confidence that wrapping pthread_create using the linker options works with Go, gcc and musl compilers. I feel it is stable enough to call good to delete the workarounds. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Remove incorrect and misleading comment.Andrew G. Morgan2020-07-091-1/+0
| | | | | | | | | | | | | | | | Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Add a Go example of changing UID/GID.Andrew G. Morgan2020-07-072-0/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is something pretty fundamental that a number of folk have asked about. It is essentially the motivating issue for: https://github.com/golang/go/issues/1435 Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * It looks as if the module files need a libcap directory tag.Andrew G. Morgan2020-07-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I initially made one, and now modules are building with that stale value v0.2.37. All despite the fact the Go modules are at v0.2.38. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Drop the go suffix from module name.Andrew G. Morgan2020-07-061-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Up the release version to 2.38Andrew G. Morgan2020-07-054-9/+15
| | | | | | | | | | | | | | | | Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Fix a rare deadlock in cap.Launch().Andrew G. Morgan2020-07-052-27/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main functional change with this commit is to fix this bug: https://bugzilla.kernel.org/show_bug.cgi?id=208445 Also, include better documentation for the "cap" module. Now that it is a proper Go module, it is starting to show up on the automated golang module sites (such as pkg.go.dev) and I thought it deserved more of an intro comment. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Fix capability list generation and legacy go package install.Andrew G. Morgan2020-07-052-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes Hussam Al-Tayeb bug report: https://bugzilla.kernel.org/show_bug.cgi?id=208439 The list generation has been intended to be fully self-defined since 2.23, but I didn't complete the job back then because of a lack of a way to runtime-determine the capabilities actually supported by the running kernel. This last bit was fixed with 2.30 and I should have caught the need for this final clean up then. The go install was broken in 2.37 as a oversight as I refactored to support go modules. I did a write up about how this Go support is expected to work here: https://sites.google.com/site/fullycapable/building-go-programs-that-manipulate-capabilities Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Documentation fixes for go packages.Andrew G. Morgan2020-07-053-34/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also converted an internal type from int to uint. This change should not affect any client code. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Restructure the tree a little to provide a module example.Andrew G. Morgan2020-07-046-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've written up how to build web.go here: https://sites.google.com/site/fullycapable/building-go-programs-that-manipulate-capabilities But it struc me that the code itself does not explain about the CGO_LDFLAGS_ALLOW workaround, so I've relocated the web.go code and included a README as well as a pointer to the above explanation. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * A final twist in the Go module support.Andrew G Morgan2020-07-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that the Go module abstraction needs a tag specific to each sub-package, and can't share a generic one for libcap as a whole for both Go modules. As such, replace the vX.Y.Z tag with two package/vX.Y.Z tags. Signed-off-by: Andrew G Morgan <morgan@kernel.org>
| | | * Up the release version to 2.37Andrew G. Morgan2020-07-032-1/+3
| | | | | | | | | | | | | | | | Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Create symlink for including psx_syscall.hAndrew G. Morgan2020-07-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary path for this header is now in the Go package psx, but we still need to link it via libcap/include. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Migrate header for psx_syscall.h to Go package tree.Andrew G. Morgan2020-07-032-1/+0
| | | | | | | | | | | | | | | | Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Refactored the psx package to build as a Go module.Andrew G. Morgan2020-07-038-53/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaned up the Go module redirection html file, now installed at: https://kernel.org/pub/linux/libs/security/libcap/ Note, I've moved the C source for libpsx.a into the psx/ directory, but the libpsx.a file is still built in the libcap subdirectory as before. I also symlinked the C include files from the psx/ directory. This made the source compile in conjuction with the "psx" Go package automatically. It also substantially simplified the go/Makefile. I feel pretty good about this next version from the perspective of a viable "psx" build. Caveat the need for CGO_LDFLAGS_ALLOW on the command line pre-go1.15. Hopefully, the psx package comment is enough for folk to figure that detail out. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * A step closer to modularizing the cap and psx packages.Andrew G. Morgan2020-07-0315-160/+480
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After reading more about Go modules, I now see how ownership of the stable URL path for the packages is required. As such, I'm changing the official package paths to these: "kernel.org/pub/linux/libs/security/libcap/cap" "kernel.org/pub/linux/libs/security/libcap/psx" I have the right permissions to maintain these directories. I will place the libcap/{cap,psx}/index.html files at those locations and then validate that the go getting magic does the right things. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Revamp the way we package cap and psx packages.Andrew G. Morgan2020-07-0213-47/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It has been requested that we make the "libcap/cap" package into a module that plays better with the golang ecosystem. I was holding off until there was a golang version that contained the runtime.AllThreadsSyscall() support, but that appears to not have made it to 1.15, so I'm using a development build tag dependency in otherwise static sources for the "libcap/cap" package. My intention is that the canonical import paths for these packages will be: "git.kernel.org/libs/libcap/cap" "git.kernel.org/libs/libcap/psx" That being said, I may have to move them if I can't get some proxy to resolve these paths to the right git repo of kernel.org. The is work in the direction of addressing: https://bugzilla.kernel.org/show_bug.cgi?id=207567 Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * First attempt at supporting the Go "psx" package as a module.Andrew G. Morgan2020-07-025-3/+437
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The intended import path for this module is: "git.kernel.org/libs/libcap/psx" This is my first attempt at such module support, so it will likely require some iteration. This is work in the direction of addressing: https://bugzilla.kernel.org/show_bug.cgi?id=207567 Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * CAP_BPF is the CAP_LAST_CAP now.Andrew G. Morgan2020-07-021-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | eBPF (extended Berkeley Packet Filters) now have their own capability. Earlier releases of the kernel used CAP_SYS_ADMIN for this feature. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Tidy up the comment related to the XATTR backup definitions.Andrew G. Morgan2020-06-291-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | We generally try not to use C++ style line comments. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * libcap: Fix for older kernelsPrasanth R2020-06-291-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cap_file.c:204:33: error: 'XATTR_NAME_CAPS' undeclared (first use in this function) sizeofcaps = fgetxattr(fildes, XATTR_NAME_CAPS, Kernels after 2.6.36 moved the declarations to userapi, Hope this can be defined manually Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Fix declaration of mostly never compiled code.Andrew G. Morgan2020-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cap_set_nsowner() function, on systems where VFS_CAP_U32 is not defined. Bug report from Prasanth R. https://bugzilla.kernel.org/show_bug.cgi?id=208365 Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * cap_get_proc.3: change "current process" to "calling process"Michael Kerrisk (man-pages)2020-06-111-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The term "current process" is kernel-developer speak that is often not understood by user-space programmers. Change to "calling process", which is clearer. Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Improve synopsis formatting of getpcaps.8 man page.Andrew G. Morgan2020-06-111-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * getpcaps.8: Note that pid==0 displays capabilities of getpcaps itselfMichael Kerrisk (man-pages)2020-06-111-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When experimenting with capabilities, it's useful to know that pid==0 causes getpcaps to display its own capabilities. Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * cap_get_proc.3: for cap_get_pid(), pid==0 means "the calling process"Michael Kerrisk (man-pages)2020-06-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's useful to know that when cap_get_pid() gets pid==0, it returns the caller's capabilities. Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * cap_get_proc.3: Typo fixesMichael Kerrisk (man-pages)2020-06-111-3/+3
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Better protect some header #define's.Andrew G. Morgan2020-06-049-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently some folk like to supply these defines on the compiler command line. Protect these defines with some more macrology. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | * Clean up an unused variable.Andrew G. Morgan2020-06-031-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
* | | | Fix Android.bp for libcap-2.36's new warnings. am: 5a87f0eda9 am: 941f3caa87Elliott Hughes2020-06-0536-238/+400
|\| | | | | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/external/libcap/+/1324260 Change-Id: I7bf190ce90e241b197844bedbc1d53fdd13d824b
| * | | Fix Android.bp for libcap-2.36's new warnings. am: 5a87f0eda9Elliott Hughes2020-06-0536-238/+400
| |\| | | | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/external/libcap/+/1324260 Change-Id: I91c3d0f83a391f7d1500390b04fcecfa0ec73bc3
| | * | Fix Android.bp for libcap-2.36's new warnings.aosp-emu-30-releaseElliott Hughes2020-06-0536-238/+400
| | |\ \ | | | | | | | | | | | | | | | | | | | | Test: treehugger Change-Id: I8fc07628ae4e9a34e05ae4cc32cfbfb33fe70f79
| | | * | Upgrade libcap to libcap-2.36Haibo Huang2020-06-0335-237/+397
| | | |\| | | | | | | | | | | | | | | | Change-Id: I3cfeaba12663071863b6ec508832f75cf4c449d3
| | | | * Up the release version to 2.36Andrew G. Morgan2020-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | | * Linux 5.7 supports CAP_PERFMONAndrew G. Morgan2020-06-023-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I should have checked before releasing 2.35. Sigh. Won't make that mistake again. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | | * Update the CHANGELOG file to point to current locations.Andrew G. Morgan2020-06-021-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Somehow I missed the old pointers here. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | | * Up the release version to 2.35Andrew G. Morgan2020-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | | * More linter findings.Andrew G. Morgan2020-06-023-27/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Should have likely included these in the earlier patch. Too much to clean up I guess. Signed-off-by: Andrew G. Morgan <agm@google.com> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | | * Lint style fixes for C and Go sources.Andrew G. Morgan2020-06-028-37/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a couple of places I've made some Go constants internal to the Go packages. They use underscores and weren't Go-style constants and weren't really appropriate for use outside the context of the Go packages. Signed-off-by: Andrew G. Morgan <agm@google.com> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | | * Work around a bug in glibc.Andrew G. Morgan2020-06-011-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiled statically getpwuid() can't handle an unsupported uid. So, pick the test uids we use to be likely to be defined. Filed a glibc bug with redhat since this was discovered on a fedora-32 system: https://bugzilla.redhat.com/show_bug.cgi?id=1842745 Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | | * Remove include dependency of libcap on libpsx.Andrew G. Morgan2020-06-011-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While there is no explicit runtime dependency of libcap on libpsx (only an optional one). There is some confusion about the need for linkage from header analysis. As such, inline the prototype for psx_load_syscalls() into libcap/cap_proc.go. This addresses: https://bugzilla.kernel.org/show_bug.cgi?id=208021 Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | | * Markdown related fixes.Andrew G. Morgan2020-05-163-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is still a work in progress, but see the doc/mkmd.sh file for how these could be made. The overall conversion is done via https://github.com/mle86/man-to-md with some minor tweaks with sed. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
| | | | * Slight refactoring of _makenames.c.Andrew G. Morgan2020-05-161-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm generally in favor of using zero'd memory. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>