commit | d35f9b00e50db3fa8125a53aaaab42c7fb7fbd94 | [log] [tgz] |
---|---|---|
author | Nick Kralevich <nnk@google.com> | Wed Feb 24 15:50:52 2016 -0800 |
committer | Nick Kralevich <nnk@google.com> | Wed Feb 24 15:50:52 2016 -0800 |
tree | b9a7cb3cb0f5f442a3e597459dcd069a472ea870 | |
parent | e8c9c746418fa1389b555168e4b7653f0b662508 [diff] |
init: harden socket creation against symlinks Instead of using chown, use the symlink safe lchown. Instead of using chmod, use the symlink safe fchmodat with AT_SYMLINK_NOFOLLOW. Fix a bug where the SELinux filesystem creation context may not be restored, and some memory not freed, if bind() fails. Check the return values from the chown/chmod calls and unlink the files if it ever fails. Bug: 27337831 Change-Id: I3343786f5a4eefda7bbb8317f2eca16bd21003c0