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: <20220425125828.06cc0b51@kernel.org>
Date:   Mon, 25 Apr 2022 12:58:28 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     xiangxia.m.yue@...il.com
Cc:     netdev@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        Luis Chamberlain <mcgrof@...nel.org>,
        Kees Cook <keescook@...omium.org>,
        Iurii Zaikin <yzaikin@...gle.com>,
        "David S. Miller" <davem@...emloft.net>,
        Paolo Abeni <pabeni@...hat.com>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        David Ahern <dsahern@...nel.org>,
        Simon Horman <horms@...ge.net.au>,
        Julian Anastasov <ja@....bg>,
        Pablo Neira Ayuso <pablo@...filter.org>,
        Jozsef Kadlecsik <kadlec@...filter.org>,
        Florian Westphal <fw@...len.de>, Shuah Khan <shuah@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        Lorenz Bauer <lmb@...udflare.com>,
        Akhmat Karakotov <hmukos@...dex-team.ru>
Subject: Re: [net-next v4 3/3] selftests/sysctl: add sysctl macro test

On Fri, 22 Apr 2022 15:01:41 +0800 xiangxia.m.yue@...il.com wrote:
>  static int __init test_sysctl_init(void)
>  {
> +	test_data.match_int[0] = *(int *)SYSCTL_ZERO,
> +	test_data.match_int[1] = *(int *)SYSCTL_ONE,
> +	test_data.match_int[2] = *(int *)SYSCTL_TWO,
> +	test_data.match_int[3] = *(int *)SYSCTL_THREE,
> +	test_data.match_int[4] = *(int *)SYSCTL_FOUR,
> +	test_data.match_int[5] = *(int *)SYSCTL_ONE_HUNDRED,
> +	test_data.match_int[6] = *(int *)SYSCTL_TWO_HUNDRED,
> +	test_data.match_int[7] = *(int *)SYSCTL_ONE_THOUSAND,
> +	test_data.match_int[8] = *(int *)SYSCTL_THREE_THOUSAND,
> +	test_data.match_int[9] = *(int *)SYSCTL_INT_MAX,
> +	test_data.match_int[10] = *(int *)SYSCTL_MAXOLDUID,
> +	test_data.match_int[11] = *(int *)SYSCTL_NEG_ONE,

> +	local VALUES=(0 1 2 3 4 100 200 1000 3000 $INT_MAX 65535 -1)

How does this test work? Am I reading it right that it checks if this
bash array is in sync with the kernel code?

I'd be better if we were checking the values of the constants against
literals / defines.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ