All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] fs/tar: only store numeric uid/gid
@ 2015-02-16 17:49 Yann E. MORIN
  2015-02-19 21:03 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Yann E. MORIN @ 2015-02-16 17:49 UTC (permalink / raw)
  To: buildroot

If a target user is asigned a UID (e.g. 1000) that happens to also exist
on the build machine, tar will happily store the username for that user.

This can be seen by some as potential information disclosure.

Instruct tar to just store the numeric uid/gid.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

---
Yes, there are so many other locations where we may have such
information disclosure. But this one is pretty easy to fix.
---
 fs/tar/tar.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/tar/tar.mk b/fs/tar/tar.mk
index 780827e..28219cf 100644
--- a/fs/tar/tar.mk
+++ b/fs/tar/tar.mk
@@ -7,7 +7,7 @@
 TAR_OPTS := $(call qstrip,$(BR2_TARGET_ROOTFS_TAR_OPTIONS))
 
 define ROOTFS_TAR_CMD
-	tar -c$(TAR_OPTS)f $@ -C $(TARGET_DIR) .
+	tar -c$(TAR_OPTS)f $@ --numeric-owner -C $(TARGET_DIR) .
 endef
 
 $(eval $(call ROOTFS_TARGET,tar))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH] fs/tar: only store numeric uid/gid
  2015-02-16 17:49 [Buildroot] [PATCH] fs/tar: only store numeric uid/gid Yann E. MORIN
@ 2015-02-19 21:03 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2015-02-19 21:03 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Mon, 16 Feb 2015 18:49:16 +0100, Yann E. MORIN wrote:
> If a target user is asigned a UID (e.g. 1000) that happens to also exist
> on the build machine, tar will happily store the username for that user.
> 
> This can be seen by some as potential information disclosure.
> 
> Instruct tar to just store the numeric uid/gid.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

I hesitated a bit on this one, but I preferred to err on the safe side,
and therefore applied this patch to the 'next' branch.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-19 21:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-16 17:49 [Buildroot] [PATCH] fs/tar: only store numeric uid/gid Yann E. MORIN
2015-02-19 21:03 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.