lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 6 Jan 2010 23:33:23 +0100 (CET)
From:	John Kacur <jkacur@...hat.com>
To:	Michal Marek <mmarek@...e.cz>
cc:	linux-kernel@...r.kernel.org, Sam Ravnborg <sam@...nborg.org>,
	linux-kbuild@...r.kernel.org
Subject: Re: [PATCH] Don't mkdir -p include/config in the sourcetree when 
 using O=outputdir option



On Wed, 6 Jan 2010, John Kacur wrote:

> On Wed, Jan 6, 2010 at 9:45 PM, Michal Marek <mmarek@...e.cz> wrote:
> > John Kacur napsal(a):
> >> Yes, I doubled checked that the problem exists, and it is quite easy for me to
> >> reproduce. However, my proposed solution is also broken, please don't
> >> apply, I'm still investigating.
> >>
> >> I am surprised that you are not able to reproduce the problem though.
> >> Did you follow the steps I that I outlined?
> >
> > I did
> >
> > $ git checkout v2.6.33-rc3
> > $ mkdir /bld/2.6.33-rc3
> > $ zcat /proc/config.gz >/bld/2.6.33-rc3/.config
> > $ make O=/bld/2.6.33-rc3/ oldconfig
> > ...
> > hit Enter several times
> > ...
> > $ ls -ld include/config /bld/2.6.33-rc3/include/config/
> > ls: cannot access include/config: No such file or directory
> > drwxr-xr-x 2 mmarek users 4096 2010-01-06 21:35
> > /bld/2.6.33-rc3/include/config//
> > $ make O=/bld/2.6.33-rc3/
> >  GEN     /bld/2.6.33-rc3/Makefile
> > scripts/kconfig/conf -s arch/x86/Kconfig
> >  Using /home/mmarek/linux-2.6 as source for kernel
> >  GEN     /bld/2.6.33-rc3/Makefile
> >  CHK     include/linux/version.h
> >  UPD     include/linux/version.h
> >  CHK     include/generated/utsrelease.h
> >  UPD     include/generated/utsrelease.h
> >  CC      kernel/bounds.s
> > ... continues building ...
> >
> >
> > The mkdir command has been in the Makefile since 2006 (c955cca), so I
> > think that your problem is caused by something else. Try a make V=1
> > build with a read-only source tree to see which mkdir command fails.
> >
> 
> Michal: The length of time that a bug exists in a piece of code is no
> argument for
> it's correctness!
> 
> I tried to debug this using
> make -d V=1 O=/bld/2.6.33-rc3
> and discovered that the bug did not always occur, but did sometimes.
> This leads me to think that it is timing sensitive, and indeed the
> problem shows up
> more easily on a machine with multiple processors.
> 
> Is it possible that the step with mkdir -p can sometimes occur in a
> Makefile parallel process
> before the cd KBUILD_OUTPUT occurs? That would explain why it doesn't
> reliably reproduce.
> 
> In any case, the idea behind my original patch is good, just specify
> the full path
> using the objtree variable and the problem goes away. The first round of my
> implementation was simply lacking.
> 
> Following up this note with a patch.
> 
> John
> 

>From b9db45e49b36e589de410f1c34fe77087fa36796 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@...hat.com>
Date: Wed, 6 Jan 2010 23:16:38 +0100
Subject: [PATCH] Kbuild: Use $(objtree) for mkdir -p include/linux include/config

This fixes a problem where make sometimes creates the directories
include/linux include/config
in the local source tree, even though O=/outputdir was specified.

The solution is to give an absolute path using $(objtree)

Signed-off-by: John Kacur <jkacur@...hat.com>
---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 1231094..2f3ba92 100644
--- a/Makefile
+++ b/Makefile
@@ -454,11 +454,11 @@ include $(srctree)/arch/$(SRCARCH)/Makefile
 export KBUILD_DEFCONFIG KBUILD_KCONFIG
 
 config: scripts_basic outputmakefile FORCE
-	$(Q)mkdir -p include/linux include/config
+	$(Q)mkdir -p $(objtree)/include/linux $(objtree)/include/config
 	$(Q)$(MAKE) $(build)=scripts/kconfig $@
 
 %config: scripts_basic outputmakefile FORCE
-	$(Q)mkdir -p include/linux include/config
+	$(Q)mkdir -p $(objtree)/include/linux $(objtree)/include/config
 	$(Q)$(MAKE) $(build)=scripts/kconfig $@
 
 else
-- 
1.6.0.6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ