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>] [day] [month] [year] [list]
Date:	Sat, 17 Nov 2007 05:24:07 +0100
From:	Gabriel C <nix.or.die@...glemail.com>
To:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
CC:	"H. Peter Anvin" <hpa@...or.com>
Subject: bug in scripts/setlocalversion 

Hi,

I've build by 'accident' and stable kernel inside a git repo and noticed an strange bug.

setlocalversion will append a git revision to the kernel even is not an git one.

to reproduce create some dir and cd in there:

git init 
git config user.email "foo@...il.com"
git config user.name "blah"

touch a b c
git add *
git commit -a

git rev-parse --verify HEAD 2
7e671bce0cdc4ace727794dc79d5b426551ae5b8

now get any kernel tarball from kernel.org , unpack and build it with make V=1


--($:/work/crazy/bug/linux-2.6.24-rc2)-- LC_ALL=C; ls -d .git
/usr/bin/ls: cannot access .git: No such file or directory

( we are not git )
                                                                                                
...

--($:/work/crazy/bug/linux-2.6.24-rc2)-- make V=1
rm -f include/config/kernel.release
echo 2.6.24-rc2-g7e671bce > include/config/kernel.release <-- buggy

...

Possible fix is to add and check before :                                                                                           

# Check for git and a git repo.
if head=`git rev-parse --verify HEAD 2>/dev/null`; then

which actually is missing the 'git' check ;)

if [ -d ".git" ]; then 
	if head=`git rev-parse --verify HEAD 2>/dev/null`; then
	...
fi


or some git magic command I don't know yet =) 


Regards,

Gabriel 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists