aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-07-15LSM: SafeSetID: add read handlerJann Horn2-4/+32
For debugging a running system, it is very helpful to be able to see what policy the system is using. Add a read handler that can dump out a copy of the loaded policy. Signed-off-by: Jann Horn <[email protected]> Signed-off-by: Micah Morton <[email protected]>
2019-07-15LSM: SafeSetID: rewrite userspace API to atomic updatesJann Horn4-169/+149
The current API of the SafeSetID LSM uses one write() per rule, and applies each written rule instantly. This has several downsides: - While a policy is being loaded, once a single parent-child pair has been loaded, the parent is restricted to that specific child, even if subsequent rules would allow transitions to other child UIDs. This means that during policy loading, set*uid() can randomly fail. - To replace the policy without rebooting, it is necessary to first flush all old rules. This creates a time window in which no constraints are placed on the use of CAP_SETUID. - If we want to perform sanity checks on the final policy, this requires that the policy isn't constructed in a piecemeal fashion without telling the kernel when it's done. Other kernel APIs - including things like the userns code and netfilter - avoid this problem by performing updates atomically. Luckily, SafeSetID hasn't landed in a stable (upstream) release yet, so maybe it's not too late to completely change the API. The new API for SafeSetID is: If you want to change the policy, open "safesetid/whitelist_policy" and write the entire policy, newline-delimited, in there. Signed-off-by: Jann Horn <[email protected]> Signed-off-by: Micah Morton <[email protected]>
2019-07-15LSM: SafeSetID: fix userns handling in securityfsJann Horn1-3/+3
Looking at current_cred() in write handlers is bad form, stop doing that. Also, let's just require that the write is coming from the initial user namespace. Especially SAFESETID_WHITELIST_FLUSH requires privilege over all namespaces, and SAFESETID_WHITELIST_ADD should probably require it as well. Signed-off-by: Jann Horn <[email protected]> Signed-off-by: Micah Morton <[email protected]>
2019-07-15LSM: SafeSetID: refactor policy parsingJann Horn1-51/+33
In preparation for changing the policy parsing logic, refactor the line parsing logic to be less verbose and move it into a separate function. Signed-off-by: Jann Horn <[email protected]> Signed-off-by: Micah Morton <[email protected]>
2019-07-15LSM: SafeSetID: refactor safesetid_security_capable()Jann Horn1-15/+26
At the moment, safesetid_security_capable() has two nested conditional blocks, and one big comment for all the logic. Chop it up and reduce the amount of indentation. Signed-off-by: Jann Horn <[email protected]> Signed-off-by: Micah Morton <[email protected]>
2019-07-15LSM: SafeSetID: refactor policy hash tableJann Horn2-44/+37
parent_kuid and child_kuid are kuids, there is no reason to make them uint64_t. (And anyway, in the kernel, the normal name for that would be u64, not uint64_t.) check_setuid_policy_hashtable_key() and check_setuid_policy_hashtable_key_value() are basically the same thing, merge them. Also fix the comment that claimed that (1<<8)==128. Signed-off-by: Jann Horn <[email protected]> Signed-off-by: Micah Morton <[email protected]>
2019-07-15LSM: SafeSetID: fix check for setresuid(new1, new2, new3)Jann Horn1-90/+35
With the old code, when a process with the (real,effective,saved) UID set (1,1,1) calls setresuid(2,3,4), safesetid_task_fix_setuid() only checks whether the transition 1->2 is permitted; the transitions 1->3 and 1->4 are not checked. Fix this. This is also a good opportunity to refactor safesetid_task_fix_setuid() to be less verbose - having one branch per set*uid() syscall is unnecessary. Note that this slightly changes semantics: The UID transition check for UIDs that were not in the old cred struct is now always performed against the policy of the RUID. I think that's more consistent anyway, since the RUID is also the one that decides whether any policy is enforced at all. Signed-off-by: Jann Horn <[email protected]> Signed-off-by: Micah Morton <[email protected]>
2019-07-15LSM: SafeSetID: fix pr_warn() to include newlineJann Horn1-2/+2
Fix the pr_warn() calls in the SafeSetID LSM to have newlines at the end. Without this, denial messages will be buffered as incomplete lines in log_output(), and will then only show up once something else prints into dmesg. Signed-off-by: Jann Horn <[email protected]> Signed-off-by: Micah Morton <[email protected]>
2019-07-15docs: kbuild: fix build with pdf and fix some minor issuesMauro Carvalho Chehab5-11/+33
The tag ".. include" should be replaced by ".. literalinclude" at issues.rst, otherwise it causes TeX to crash due to excessive usage of stack with Sphinx 2.0. While here, solve a few minor issues at the kbuild book output by adding extra blank lines. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: block: fix pdf outputMauro Carvalho Chehab1-4/+5
Add an extra blank line and use a markup for the enumberated list, in order to make it possible to build the block book on pdf format. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: arm: fix a breakage with pdf outputMauro Carvalho Chehab1-0/+1
Add an extra blank line, as otherwise XeLaTex will complain with: ! LaTeX Error: Too deeply nested. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: don't use nested tablesMauro Carvalho Chehab4-21/+19
Nested tables aren't supported for pdf output on Sphinx 1.7.9: admin-guide/laptops/sonypi:: nested tables are not yet implemented. admin-guide/laptops/toshiba_haps:: nested tables are not yet implemented. driver-api/nvdimm/btt:: nested tables are not yet implemented. s390/debugging390:: nested tables are not yet implemented. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Andy Shevchenko <[email protected]> # laptops
2019-07-15docs: gpio: add sysfs interface to the admin-guideMauro Carvalho Chehab7-6/+7
While this is stated as obsoleted, the sysfs interface described there is still valid, and belongs to the admin-guide. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Linus Walleij <[email protected]>
2019-07-15docs: locking: add it to the main indexMauro Carvalho Chehab2-1/+2
The locking directory is part of the Kernel API bookset. Add it to the index file. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: add some directories to the main documentation indexMauro Carvalho Chehab13-12/+25
The contents of those directories were orphaned at the documentation body. While those directories could likely be moved to be inside some guide, I'm opting to just adding their indexes to the main one, removing the :orphan: and adding the SPDX header. For the drivers, the rationale is that the documentation contains a mix of Kernelspace, uAPI and admin-guide. So, better to keep them on separate directories, as we've be doing with similar subsystem-specific docs that were not split yet. For the others, well... I'm too lazy to do the move. Also, it seems to make sense to keep at least some of those at the main dir (like kbuild, for example). In any case, a latter patch could do the move. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Bartlomiej Zolnierkiewicz <[email protected]>
2019-07-15docs: add SPDX tags to new index filesMauro Carvalho Chehab21-0/+41
All those new files I added are under GPL v2.0 license. Add the corresponding SPDX headers to them. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: add a memory-devices subdir to driver-apiMauro Carvalho Chehab4-2/+19
There are two docs describing memory device drivers. Add both to this new chapter of the driver-api. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: phy: place documentation under driver-apiMauro Carvalho Chehab8-4/+20
This subsystem-specific documentation belongs to the driver-api. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: serial: move it to the driver-apiMauro Carvalho Chehab14-9/+10
The contents of this directory is mostly driver-api stuff. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: driver-api: add remaining converted dirs to itMauro Carvalho Chehab7-8/+7
There are a number of driver-specific descriptions that contain a mix of userspace and kernelspace documentation. Just like we did with other similar subsystems, add them at the driver-api groupset, but don't move the directories. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: driver-api: add xilinx driver API documentationMauro Carvalho Chehab3-1/+1
The current file there (emmi) provides a description of the driver uAPI and kAPI. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: driver-api: add a series of orphaned documentsMauro Carvalho Chehab49-45/+71
There are lots of documents under Documentation/*.txt and a few other orphan documents elsehwere that belong to the driver-API book. Move them to their right place. Reviewed-by: Cornelia Huck <[email protected]> # vfio-related parts Acked-by: Logan Gunthorpe <[email protected]> # switchtec Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: admin-guide: add a series of orphaned documentsMauro Carvalho Chehab40-33/+47
There are lots of documents that belong to the admin-guide but are on random places (most under Documentation root dir). Move them to the admin guide. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Alexandre Belloni <[email protected]> Acked-by: Bartlomiej Zolnierkiewicz <[email protected]>
2019-07-15docs: cgroup-v1: add it to the admin-guide bookMauro Carvalho Chehab36-33/+32
Those files belong to the admin guide, so add them. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: aoe: add it to the driver-api bookMauro Carvalho Chehab10-6/+5
Those files belong to the admin guide, so add them. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Justin Sanders <[email protected]>
2019-07-15docs: add some documentation dirs to the driver-api bookMauro Carvalho Chehab5-4/+8
Those are subsystem docs, with a mix of kABI and user-faced docs. While they're not split, keep the dirs where they are, adding just a pointer to the main index. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: driver-model: move it to the driver-api bookMauro Carvalho Chehab24-17/+16
The audience for the Kernel driver-model is clearly Kernel hackers. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Jeff Kirsher <[email protected]> # ice driver changes
2019-07-15docs: lp855x-driver.rst: add it to the driver-api bookMauro Carvalho Chehab3-3/+2
The content of this file is intended for backlight Kernel developers. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: ocxl.rst: add it to the uAPI bookMauro Carvalho Chehab3-3/+2
The content of this file is user-faced. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Andrew Donnellan <[email protected]>
2019-07-15docs: x86: move two x86-specific files to x86 arch dirMauro Carvalho Chehab5-2/+4
Those two docs belong to the x86 architecture: Documentation/Intel-IOMMU.txt -> Documentation/x86/intel-iommu.rst Documentation/intel_txt.txt -> Documentation/x86/intel_txt.rst Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: security: move some books to it and updateMauro Carvalho Chehab7-3/+5
The following files belong to security: Documentation/security/LSM.rst -> Documentation/security/lsm-development.rst Documentation/lsm.txt -> Documentation/security/lsm.rst Documentation/SAK.txt -> Documentation/security/sak.rst Documentation/siphash.txt -> Documentation/security/siphash.rst Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: blockdev: add it to the admin-guideMauro Carvalho Chehab22-26/+24
The blockdev book basically contains user-faced documentation. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: admin-guide: add kdump documentation into itMauro Carvalho Chehab14-15/+15
The Kdump documentation describes procedures with admins use in order to solve issues on their systems. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: admin-guide: add laptops documentationMauro Carvalho Chehab17-12/+11
The docs under Documentation/laptops contain users specific information. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Andy Shevchenko <[email protected]>
2019-07-15docs: admin-guide: move sysctl directory to itMauro Carvalho Chehab20-13/+12
The stuff under sysctl describes /sys interface from userspace point of view. So, add it to the admin-guide and remove the :orphan: from its index file. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: early-userspace: move to driver-api guideMauro Carvalho Chehab7-6/+5
Those documents describe a kAPI. So, add to the driver-api book. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: device-mapper: move it to the admin-guideMauro Carvalho Chehab35-6/+5
The DM support describes lots of aspects related to mapped disk partitions from the userspace PoV. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: add arch doc directories to the indexMauro Carvalho Chehab9-14/+11
Now that several arch documents were converted to ReST, add their indexes to Documentation/index.rst and remove the :orphan: from them. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: interconnect.rst: add it to the driver-api guideMauro Carvalho Chehab3-3/+2
This is intended for Kernel hackers audience. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Reviewed-by: Georgi Djakov <[email protected]>
2019-07-15docs: ioctl: add it to the uAPI guideMauro Carvalho Chehab3-3/+2
While 100% of its contents is userspace, let's keep the dir at the same place, as this is a well-known location. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: leds: add it to the driver-api bookMauro Carvalho Chehab2-1/+2
The contents of leds driver docs is messy: it has lots of admin-guide stuff and kernel internal ones, just like other driver subsystems. I'm opting to keep the dir at the same place and just add a link to it. This makes clearer that this require changes. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: md: move it to the driver-api bookMauro Carvalho Chehab5-2/+1
The docs there were meant to be read by a Kernel developer. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: mmc: move it to the driver-apiMauro Carvalho Chehab6-2/+1
Most of the stuff here is related to the kAPI. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: nfc: add it to the driver-api bookMauro Carvalho Chehab4-2/+1
Most of the descriptions here are oriented to a Kernel developer. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: mtd: move it to the driver-api bookMauro Carvalho Chehab6-3/+2
While I was tempted to move it to admin-guide, as some docs there are more userspace-faced, there are some very technical discussions about memory error correction code from the Kernel implementer's PoV. So, let's place it inside the driver-api book. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: namespace: move it to the admin-guideMauro Carvalho Chehab4-2/+1
As stated at the documentation, this is meant to be for users to better understand namespaces. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: nvdimm: add it to the driver-api bookMauro Carvalho Chehab6-3/+2
The descriptions here are from Kernel driver's PoV. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Dan Williams <[email protected]>
2019-07-15docs: perf: move to the admin-guideMauro Carvalho Chehab11-5/+4
The perf infrastructure is used for userspace to track issues. At least a good part of what's described here is related to it. So, add it to the admin-guide. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: rapidio: add it to the driver APIMauro Carvalho Chehab10-4/+3
This is actually a subsystem description, with contains both kAPI and uAPI. While it should ideally be slplit, let's place it at driver-api, as most things are related to kAPI and driver-specific info. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-15docs: logo.txt: rename it to COPYING-logoMauro Carvalho Chehab1-0/+0
This file has nothing to do with the Kernel documentation. It contains the copyright permissions for Tux at Documentation/logo.gif. So, rename it accordingly. Signed-off-by: Mauro Carvalho Chehab <[email protected]>