No description
Find a file
Jann Horn 5d60a06610 linux/kernel.h: Use parentheses around argument in u64_to_user_ptr()
[ Upstream commit a0fe2c6479 ]

Use parentheses around uses of the argument in u64_to_user_ptr() to
ensure that the cast doesn't apply to part of the argument.

There are existing uses of the macro of the form

  u64_to_user_ptr(A + B)

which expands to

  (void __user *)(uintptr_t)A + B

(the cast applies to the first operand of the addition, the addition
is a pointer addition). This happens to still work as intended, the
semantic difference doesn't cause a difference in behavior.

But I want to use u64_to_user_ptr() with a ternary operator in the
argument, like so:

  u64_to_user_ptr(A ? B : C)

This currently doesn't work as intended.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Cc: Andrei Vagin <avagin@openvz.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: NeilBrown <neilb@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Qiaowei Ren <qiaowei.ren@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20190329214652.258477-1-jannh@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-05-10 17:53:10 +02:00
arch perf/x86/intel: Initialize TFA MSR 2019-05-10 17:53:10 +02:00
block block: do not leak memory in bio_copy_user_iov() 2019-04-17 08:37:53 +02:00
certs Replace magic for trusting the secondary keyring with #define 2018-09-09 19:55:54 +02:00
crypto crypto: x86/poly1305 - fix overflow during partial reduction 2019-04-27 09:35:37 +02:00
Documentation USB: core: Fix bug caused by duplicate interface PM usage counter 2019-05-08 07:20:46 +02:00
drivers drm/mediatek: Fix an error code in mtk_hdmi_dt_parse_pdata() 2019-05-10 17:53:09 +02:00
firmware License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fs hugetlbfs: fix memory leak for resv_map 2019-05-08 07:20:50 +02:00
include linux/kernel.h: Use parentheses around argument in u64_to_user_ptr() 2019-05-10 17:53:10 +02:00
init Revert "mm: use early_pfn_to_nid in page_ext_init" 2019-03-23 14:35:13 +01:00
ipc ipc/sem.c: prevent queue.status tearing in semop 2018-09-05 09:26:30 +02:00
kernel ptrace: take into account saved_sigmask in PTRACE{GET,SET}SIGMASK 2019-05-04 09:15:22 +02:00
lib ubsan: Fix nasty -Wbuiltin-declaration-mismatch GCC-9 warnings 2019-05-10 17:53:08 +02:00
mm mm/kmemleak.c: fix unused-function warning 2019-05-08 07:20:53 +02:00
net batman-adv: Reduce tt_global hash refcnt only for removed entry 2019-05-08 07:20:47 +02:00
samples samples: mei: use /dev/mei0 instead of /dev/mei 2019-02-15 08:09:12 +01:00
scripts kconfig/[mn]conf: handle backspace (^H) key 2019-05-04 09:15:22 +02:00
security selinux: never allow relabeling on context mounts 2019-05-08 07:20:53 +02:00
sound ASoC: tlv320aic32x4: Fix Common Pins 2019-05-10 17:53:09 +02:00
tools tools include: Adopt linux/bits.h 2019-04-27 09:35:41 +02:00
usr initramfs: fix initramfs rebuilds w/ compression after disabling 2017-11-03 07:39:19 -07:00
virt KVM: arm/arm64: vgic-its: Take the srcu lock when parsing the memslots 2019-05-04 09:15:19 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files 2016-10-07 18:46:30 -07:00
.gitignore kbuild: rpm-pkg: keep spec file until make mrproper 2018-02-13 10:19:46 +01:00
.mailmap .mailmap: Add Maciej W. Rozycki's Imagination e-mail address 2017-11-10 12:16:15 -08:00
COPYING
CREDITS MAINTAINERS: update TPM driver infrastructure changes 2017-11-09 17:58:40 -08:00
Kbuild License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
MAINTAINERS MAINTAINERS: Add Sasha as a stable branch maintainer 2018-12-01 09:42:50 +01:00
Makefile Linux 4.14.117 2019-05-08 07:20:54 +02:00
README README: add a new README file, pointing to the Documentation/ 2016-10-24 08:12:35 -02:00

Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

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.