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] [day] [month] [year] [list]
Date:	Sat, 23 Jun 2012 22:46:18 +0200
From:	Jesper Nilsson <jesper.nilsson@...s.com>
To:	Paul Bolle <pebolle@...cali.nl>
Cc:	Mikael Starvik <starvik@...s.com>,
	linux-cris-kernel <linux-cris-kernel@...s.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: cris: odd include in arch/cris/boot/compressed/misc.c

On Sat, Jun 23, 2012 at 03:00:23AM +0200, Paul Bolle wrote:
> Mikael, Jesper,

Hi!

> 0) Currently line 123 of arch/cris/boot/compressed/misc.c reads:
>     #include "../../../../../lib/inflate.c"
> 
> git blame tells me that line has read that way since commit
> 51533b615e605d86154ec1b4e585c8ca1b0b15b7 ("[...] CRIS update: new
> subarchitecture v32"), which predates release v2.6.13.
> 
> 1) When I try to jump to lib/inflate.c via that line in my $EDITOR, I
> see an error and nothing happens. When I check the depth, in
> directories, at which misc.c lives, I can't blame my $EDITOR.
>
> 2) And indeed, when I edit that line to read:
>     #include "../../../../lib/inflate.c"
> 
> my $EDITOR does correctly jump to lib/inflate.c. 
> 
> 3) This can be trivially fixed, and I'm happy to submit that trivial
> patch. But I do wonder what the compilers for cris know that my $EDITOR
> and x86 compiler doesn't. (I don't have a compiler for cris at hand.)
> Because, if I edit the comparable file for x86 to have a similar include
> look that way and try to build a kernel I get:
>
> [...]
>
>   CC      arch/x86/boot/compressed/misc.o
> arch/x86/boot/compressed/misc.c:131:51: fatal error: ../../../../../lib/decompress_inflate.c: No such file or directory
> compilation terminated.
> make[2]: *** [arch/x86/boot/compressed/misc.o] Error 1
> make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
> make: *** [bzImage] Error 2
> 
> 4) What's going on here?

Heh, you're quite right, the path has been the same for a long time,
and the file has moved into this directory from one directory deeper,
so logically, we should get a compile error here.

However, the CRIS-port has a bunch of include paths, at different depths,
and it seems that one of them is used to pick up the relative path to
"lib/inflate.c".

I'll add the following to the CRIS-tree:


Correct include path for "lib/inflate.c"

The include path was one too deep to pick up the file from ".",
but some other include path obviously matched so there was no
compile error.

Reported-by: Paul Bolle <pebolle@...cali.nl>
Signed-off-by: Jesper Nilsson <jesper.nilsson@...s.com>
---
 arch/cris/boot/compressed/misc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/cris/boot/compressed/misc.c b/arch/cris/boot/compressed/misc.c
index 548d886..5833d9f 100644
--- a/arch/cris/boot/compressed/misc.c
+++ b/arch/cris/boot/compressed/misc.c
@@ -120,7 +120,7 @@ extern int _end;
 static long free_mem_ptr = (long)&_end;
 static long free_mem_end_ptr;
 
-#include "../../../../../lib/inflate.c"
+#include "../../../../lib/inflate.c"
 
 /* decompressor info and error messages to serial console */
 
-- 
1.7.10


> Paul Bolle

/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@...s.com
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ