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:	Mon, 17 May 2010 20:58:50 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc:	Rusty Russell <rusty@...tcorp.com.au>,
	Milton Miller <miltonm@....com>, Greg KH <greg@...ah.com>,
	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	anton@...ba.org
Subject: Re: cpumask: fix compat getaffinity

On Monday 17 May 2010, KOSAKI Motohiro wrote:
> From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
> Subject: [PATCH] cpumask: fix compat getaffinity
> 
> Commit a45185d2d "cpumask: convert kernel/compat.c" broke
> libnuma, which abuses sched_getaffinity to find out NR_CPUS
> in order to parse /sys/devices/system/node/node*/cpumap.
> 
> On NUMA systems with less than 32 possibly CPUs, the
> current compat_sys_sched_getaffinity now returns '4'
> instead of the actual NR_CPUS/8, which makes libnuma
> bail out when parsing the cpumap.
> 
> The libnuma call sched_getaffinity(0, bitmap, 4096)
> at first. It mean the libnuma expect the return value of
> sched_getaffinity() is either len argument or NR_CPUS.
> But it doesn't expect to return nr_cpu_ids.
> 
> Strictly speaking, userland requirement are
> 
> 1) Glibc assume the return value mean the lengh of initialized
>    of mask argument. E.g. if sched_getaffinity(1024) return 128,
>    glibc make zero fill rest 896 byte.
> 2) Libnuma assume the return value can be used to guess NR_CPUS
>    in kernel. It assume len-arg<NR_CPUS makes -EINVAL. But
>    it try len=4096 at first and 4096 is always bigger than
>    NR_CPUS. Then, if we remove strange min_length normalization,
>    we never hit -EINVAL case.
> 
> sched_getaffinity() already solved this issue. This patch
> adapt compat_sys_sched_getaffinity() as it.
> 
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>

Looks good to me,

Acked-by: Arnd Bergmann <arnd@...db.de>

You should also add a Cc:stable@...r.kernel.org line to the
description so Greg's scripts catch it when it gets merged
upstream.

	Arnd
--
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