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]
Message-ID: <55099415.5060400@osg.samsung.com>
Date:	Wed, 18 Mar 2015 09:04:53 -0600
From:	Shuah Khan <shuahkh@....samsung.com>
To:	Michael Ellerman <mpe@...erman.id.au>
CC:	gorcunov@...nvz.org, tranmanphong@...il.com,
	akpm@...ux-foundation.org, linux-api@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] selftests: Fix kcmp build to not require headers install

On 03/16/2015 05:00 AM, Michael Ellerman wrote:
> On Fri, 2015-03-13 at 19:45 -0600, Shuah Khan wrote:
>> Change CFLAGS to look in uapi to allow kcmp to be built without
>> requiring headers install. This will make it easier to run tests
>> without going through the headers install step.
>>
>> Signed-off-by: Shuah Khan <shuahkh@....samsung.com>
>> ---
>>  tools/testing/selftests/kcmp/Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
>> index ff0eefd..d405ad4 100644
>> --- a/tools/testing/selftests/kcmp/Makefile
>> +++ b/tools/testing/selftests/kcmp/Makefile
>> @@ -1,5 +1,5 @@
>>  CC := $(CROSS_COMPILE)$(CC)
>> -CFLAGS += -I../../../../usr/include/
>> +CFLAGS += -I../../../../include/uapi -I../../../../usr/include/
> 
> Hi Shuah,
> 
> Sorry but this is wrong. The contents of include/uapi are not the same as the
> exported kernel headers.
> 
> Mixing the unprocessed kernel headers with user headers leads to all sorts of
> mess, eg:
> 
> $ cc -I../../../../include/uapi -I../../../../usr/include/ kcmp_test.c   -o kcmp_test

Do you see this error when you run the compile using kcmp Makefile
or using make ksefltest target?

Do you consider running cc directly isn't a valid use-case for
this test?

I see your point that kernel headers shouldn't be included from user
space. But kcmp_test isn't really a regular use space app. It is
intended for testing kernel. There are other tests that do include
uapi headers.

> In file included from /usr/include/powerpc64le-linux-gnu/asm/ptrace.h:27:0,
>                  from /usr/include/powerpc64le-linux-gnu/asm/sigcontext.h:11,
>                  from /usr/include/powerpc64le-linux-gnu/bits/sigcontext.h:27,
>                  from /usr/include/signal.h:332,
>                  from kcmp_test.c:5:
> ../../../../include/uapi/linux/types.h:9:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders" [-Wcpp]
>  #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
>   ^
> In file included from ../../../../include/uapi/linux/posix_types.h:4:0,
>                  from ../../../../include/uapi/linux/types.h:13,
>                  from /usr/include/powerpc64le-linux-gnu/asm/ptrace.h:27,
>                  from /usr/include/powerpc64le-linux-gnu/asm/sigcontext.h:11,
>                  from /usr/include/powerpc64le-linux-gnu/bits/sigcontext.h:27,
>                  from /usr/include/signal.h:332,
>                  from kcmp_test.c:5:
> ../../../../include/uapi/linux/stddef.h:1:28: fatal error: linux/compiler.h: No such file or directory
>  #include <linux/compiler.h>
>                             ^
> compilation terminated.
> <builtin>: recipe for target 'kcmp_test' failed
> make: *** [kcmp_test] Error 1
> 
> 
> If you want to make it easier to build tests that need the kernel headers then
> maybe kselftest should depend on headers_install?
> 

Requiring header install is a big hammer. Thinking about a developer
use-case, if a developer is building and testing several kernels, it
is tedious install headers each time and remembering to cleanup headers.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@....samsung.com | (970) 217-8978
--
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