numa: change get_mempolicy() to use nr_node_ids instead of MAX_NUMNODES
Ralph Campbell authored
The system call, get_mempolicy() [1], passes an unsigned long *nodemask
pointer and an unsigned long maxnode argument which specifies the length
of the user's nodemask array in bits (which is rounded up).  The manual
page says that if the maxnode value is too small, get_mempolicy will
return EINVAL but there is no system call to return this minimum value.
To determine this value, some programs search /proc/<pid>/status for a
line starting with "Mems_allowed:" and use the number of digits in the
mask to determine the minimum value.  A recent change to the way this line
is formatted [2] causes these programs to compute a value less than
MAX_NUMNODES so get_mempolicy() returns EINVAL.

Change get_mempolicy(), the older compat version of get_mempolicy(), and
the copy_nodes_to_user() function to use nr_node_ids instead of
MAX_NUMNODES, thus preserving the defacto method of computing the minimum
size for the nodemask array and the maxnode a...
050c17f2
Name Last commit Last update
Documentation doc: Mention MSG_ZEROCOPY implementation for UDP
LICENSES Merge tag 'docs-4.20' of git://git.lwn.net/linux
arch Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
block Merge tag 'for-linus-20190215' of git://git.kernel.dk/linux-block
certs kbuild: remove redundant target cleaning on failure
crypto net: crypto set sk to NULL when af_alg_release.
drivers Merge tag 'pinctrl-v5.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
firmware kbuild: change filechk to surround the given command with { }
fs Merge branch 'fixes-v5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
include Merge branch 'fixes-v5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
init revert "initramfs: cleanup incomplete rootfs"
ipc ipc: IPCMNI limit check for semmni
kernel Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
lib Merge branch 'fixes-v5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
mm numa: change get_mempolicy() to use nr_node_ids instead of MAX_NUMNODES
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
samples samples: mei: use /dev/mei0 instead of /dev/mei
scripts Merge tag 'gcc-plugins-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
security keys: Timestamp new keys
sound Merge tag 'sound-5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
tools Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
usr user/Makefile: Fix typo and capitalization in comment section
virt Merge tag 'kvm-arm-fixes-for-5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master
.clang-format clang-format: Update .clang-format with the latest for_each macro list
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Add hch to .get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files
.gitignore kbuild: Add support for DT binding schema checks
.mailmap Merge tag 'mips_fixes_4.21_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
COPYING COPYING: use the new text with points to the license files
CREDITS Add CREDITS entry for Shaohua Li
Kbuild kbuild: use assignment instead of define ... endef for filechk_* rules
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt
MAINTAINERS Merge tag 'sound-5.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Makefile Linux 5.0-rc7
README Drop all 00-INDEX files from Documentation/
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.