pseudo: handle fchmodat better, mask out unwanted write bits
authorPeter Seebach <peter.seebach@windriver.com>
Wed, 21 May 2014 23:12:33 +0000 (18:12 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 27 May 2014 15:11:53 +0000 (16:11 +0100)
commit4c137a2057b0a0000d6156263e44d1ae1a87568a
tree9dc1706438a9dbf7ae0881e28718a350648ba20b
parentb337b31b5baa557b9856dcc684c1f36cbb5b3784
pseudo: handle fchmodat better, mask out unwanted write bits

It turns out that pseudo's decision not to report errors from
the host system's fchmodat() can break GNU tar in a very strange
way, resulting in directories being mode 0700 instead of whatever
they should have been.

Additionally, it turns out that if you make directories in your
rootfs mode 777, that results in the local copies being mode 777,
which could allow a hypothetical attacker with access to the
machine to add files to your rootfs image. We should mask out
the 022 bits when making actual mode changes in the rootfs.

This patch represents a backport to the 1.5.1 branch of three
patches from the 1.6 branch, because it took a couple of tries
to get this quite right.

(From OE-Core rev: 45371858129bbad8f4cfb874e237374a5ba8db4c)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/pseudo/files/pseudo-fchmodat-permissions.patch [new file with mode: 0644]
meta/recipes-devtools/pseudo/pseudo_1.5.1.bb