First problem: I cannot compile the kernel with my version of compiler
~~~~
$ make defconfig
*** Default configuration is based on 'i386_defconfig'
\#
\# configuration written to .config
\#
$ grep CONFIG_RETPOLINE .config
CONFIG_RETPOLINE=y
$ make
arch/x86/Makefile:224: *** You are building kernel with non-retpoline
compiler, please update your compiler.. Stop.
~~~~
Second problem: when I disable the feature - it cannot take effect,
because the parse-time error happens before `syncconfig`
~~~~
$ scripts/config -d RETPOLINE
$ grep CONFIG_RETPOLINE .config
\# CONFIG_RETPOLINE is not set
$ make
arch/x86/Makefile:224: *** You are building kernel with non-retpoline
compiler, please update your compiler.. Stop.
~~~~
Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
Signed-off-by: Kirill Marinushkin <k.marinushkin(a)gmail.com>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Ingo Molnar <mingo(a)redhat.com>
Cc: Borislav Petkov <bp(a)alien8.de>
Cc: Zhenzhong Duan <zhenzhong.duan(a)oracle.com>
Cc: H. Peter Anvin <hpa(a)zytor.com>
Cc: x86(a)kernel.org
Cc: linux-kernel(a)vger.kernel.org
Cc: stable(a)vger.kernel.org
---
arch/x86/Makefile | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index f5d7f4134524..26a2198c59b3 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -220,9 +220,6 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
# Avoid indirect branches in kernel to deal with Spectre
ifdef CONFIG_RETPOLINE
-ifeq ($(RETPOLINE_CFLAGS),)
- $(error You are building kernel with non-retpoline compiler, please update your compiler.)
-endif
KBUILD_CFLAGS += $(RETPOLINE_CFLAGS)
endif
--
2.13.6
This is the start of the stable review cycle for the 4.19.8 release.
There are 41 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sat Dec 8 14:29:30 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.8-rc1…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.19.8-rc1
Guoqing Jiang <gqjiang(a)suse.com>
tipc: use destination length for copy string
Alexey Brodkin <abrodkin(a)synopsys.com>
arc: [devboards] Add support of NFSv3 ACL
Kevin Hilman <khilman(a)baylibre.com>
ARC: change defconfig defaults to ARCv2
Qu Wenruo <wqu(a)suse.com>
btrfs: tree-checker: Don't check max block group size as current max chunk size limit is unreliable
Adam Wong <adam(a)adamwong.me>
Input: elan_i2c - add support for ELAN0621 touchpad
Noah Westervelt <nwestervelt(a)outlook.com>
Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15ARR
Patrick Gaskin <patrick(a)pgaskin.net>
Input: elan_i2c - add ELAN0620 to the ACPI table
Brian Norris <briannorris(a)chromium.org>
Input: cros_ec_keyb - fix button/switch capability reports
Christian Hoff <christian_hoff(a)gmx.net>
Input: matrix_keypad - check for errors from of_get_named_gpio()
Lyude Paul <lyude(a)redhat.com>
Input: synaptics - add PNP ID for ThinkPad P50 to SMBus
Cameron Gutman <aicommander(a)gmail.com>
Input: xpad - quirk all PDP Xbox One gamepads
Martin Wilck <mwilck(a)suse.com>
scsi: lpfc: fix block guard enablement on SLI3 adapters
Lihong Yang <lihong.yang(a)intel.com>
i40e: Fix deletion of MAC filters
Paul Moore <paul(a)paul-moore.com>
selinux: add support for RTM_NEWCHAIN, RTM_DELCHAIN, and RTM_GETCHAIN
Wei Wang <wawei(a)amazon.de>
svm: Add mutex_lock to protect apic_access_page_done on AMD systems
Laura Abbott <labbott(a)redhat.com>
kgdboc: Fix warning with module build
Laura Abbott <labbott(a)redhat.com>
kgdboc: Fix restrict error
Andrea Arcangeli <aarcange(a)redhat.com>
userfaultfd: shmem: UFFDIO_COPY: set the page dirty if VM_WRITE is not set
Andrea Arcangeli <aarcange(a)redhat.com>
userfaultfd: shmem: add i_size checks
Andrea Arcangeli <aarcange(a)redhat.com>
userfaultfd: shmem: allocate anonymous memory for MAP_PRIVATE shmem
Andrea Arcangeli <aarcange(a)redhat.com>
userfaultfd: use ENOENT instead of EFAULT if the atomic copy user fails
Lyude Paul <lyude(a)redhat.com>
drm/meson: Fix OOB memory accesses in meson_viu_set_osd_lut()
Lyude Paul <lyude(a)redhat.com>
drm/meson: Enable fast_io in meson_dw_hdmi_regmap_config
Neil Armstrong <narmstrong(a)baylibre.com>
drm/meson: Fixes for drm_crtc_vblank_on/off support
Sergio Correia <sergio(a)correia.cc>
drm: set is_master to 0 upon drm_new_set_master() failure
Lyude Paul <lyude(a)redhat.com>
drm/amd/dm: Understand why attaching path/tile properties are needed
Lyude Paul <lyude(a)redhat.com>
drm/amd/dm: Don't forget to attach MST encoders
Sam Bobroff <sbobroff(a)linux.ibm.com>
drm/ast: Fix incorrect free on ioregs
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing/fgraph: Fix set_graph_function from showing interrupts
Michael Guralnik <michaelgur(a)mellanox.com>
IB/mlx5: Avoid load failure due to unknown link width
Dmitry V. Levin <ldv(a)altlinux.org>
mips: fix mips_get_syscall_arg o32 check
Mathias Kresin <dev(a)kresin.me>
MIPS: ralink: Fix mt7620 nd_sd pinmux
Zenghui Yu <yuzenghui(a)huawei.com>
tracepoint: Use __idx instead of idx in DO_TRACE macro to make it unique
Pavankumar Kondeti <pkondeti(a)codeaurora.org>
sched, trace: Fix prev_state output in sched_switch tracepoint
Masami Hiramatsu <mhiramat(a)kernel.org>
arm64: ftrace: Fix to enable syscall events on arm64
Frieder Schrempf <frieder.schrempf(a)kontron.de>
mtd: nand: Fix memory allocation in nanddev_bbt_init()
Andrea Parri <andrea.parri(a)amarulasolutions.com>
uprobes: Fix handle_swbp() vs. unregister() + register() race once more
Sagi Grimberg <sagi(a)grimberg.me>
iser: set sector for ambiguous mr status errors
Linus Torvalds <torvalds(a)linux-foundation.org>
unifdef: use memcpy instead of strncpy
Linus Torvalds <torvalds(a)linux-foundation.org>
test_hexdump: use memcpy instead of strncpy
Jens Axboe <axboe(a)kernel.dk>
blk-mq: fix corruption with direct issue
-------------
Diffstat:
Makefile | 4 +-
arch/arc/Kconfig | 2 +-
arch/arc/Makefile | 2 +-
arch/arc/configs/axs101_defconfig | 2 +
arch/arc/configs/axs103_defconfig | 1 +
arch/arc/configs/axs103_smp_defconfig | 1 +
arch/arc/configs/hsdk_defconfig | 1 +
arch/arc/configs/nps_defconfig | 2 +
arch/arc/configs/nsim_700_defconfig | 1 +
arch/arc/configs/nsimosci_defconfig | 2 +
arch/arc/configs/nsimosci_hs_defconfig | 1 +
arch/arc/configs/nsimosci_hs_smp_defconfig | 1 +
arch/arc/configs/tb10x_defconfig | 1 +
arch/arc/configs/vdk_hs38_defconfig | 1 +
arch/arc/configs/vdk_hs38_smp_defconfig | 1 +
arch/arm64/include/asm/ftrace.h | 13 +++++
arch/mips/include/asm/syscall.h | 2 +-
arch/mips/ralink/mt7620.c | 2 +-
arch/x86/kvm/svm.c | 19 +++++---
block/blk-mq.c | 26 +++++++++-
.../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 5 +-
drivers/gpu/drm/ast/ast_main.c | 3 +-
drivers/gpu/drm/drm_auth.c | 2 +
drivers/gpu/drm/meson/meson_crtc.c | 27 +++++++++-
drivers/gpu/drm/meson/meson_dw_hdmi.c | 1 +
drivers/gpu/drm/meson/meson_venc.c | 3 ++
drivers/gpu/drm/meson/meson_viu.c | 12 ++---
drivers/infiniband/hw/mlx5/main.c | 29 +++++------
drivers/infiniband/ulp/iser/iser_verbs.c | 7 ++-
drivers/input/joystick/xpad.c | 16 +++---
drivers/input/keyboard/cros_ec_keyb.c | 3 +-
drivers/input/keyboard/matrix_keypad.c | 23 +++++----
drivers/input/mouse/elan_i2c_core.c | 3 ++
drivers/input/mouse/synaptics.c | 1 +
drivers/mtd/nand/bbt.c | 3 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
drivers/scsi/lpfc/lpfc_init.c | 6 ++-
drivers/scsi/lpfc/lpfc_sli.c | 1 -
drivers/tty/serial/kgdboc.c | 43 ++++++++--------
fs/btrfs/tree-checker.c | 8 ++-
include/linux/tracepoint.h | 6 +--
include/trace/events/sched.h | 12 ++++-
kernel/events/uprobes.c | 12 ++++-
kernel/trace/trace.h | 57 ++++++++++++++++++++--
kernel/trace/trace_functions_graph.c | 4 ++
kernel/trace/trace_irqsoff.c | 2 +
kernel/trace/trace_sched_wakeup.c | 2 +
lib/test_hexdump.c | 2 +-
mm/hugetlb.c | 2 +-
mm/shmem.c | 31 ++++++++++--
mm/userfaultfd.c | 47 +++++++++++++++---
net/tipc/topsrv.c | 2 +-
scripts/unifdef.c | 4 +-
security/selinux/nlmsgtab.c | 13 ++++-
54 files changed, 354 insertions(+), 125 deletions(-)
Commit 07115449919383548d094ff83cc27bd08639a8a1 is on Linux-Next and
this fixes an issue on 4.19.y which fixes an issue where changing for
image size fails.
Can you please apply this patch to 4.19.y?
Thank you
adam
Currently, xattrs values must match the xmatch DFA to match a profile.
This lets users construct profiles to match a file with a specific key
and value with a basic regex.
profile test xattrs(security.apparmor=/usr/bin/*) {}
The xmatch DFA doesn't handle null characters in the xattrs value, since
this is the special character used to indicate that the DFA is transitioning
from matching the profile path to matching the xattr value.
However, both IMA and EVM xattr values hold signatures which potentially
have a null character. It's currently impossible to write a profile that
requires a the presence of an EVM signature without checking the value.
profile test xattrs(security.evm security.apparmor=/usr/bin/*) {}
Add an additional "xattr_keys" array to the profile that only checks the
presence of extended attributes, and not their values.
A modified apparmor_parser that was used to test these changes can be found at:
https://gitlab.com/ericchiang/apparmor/commits/parser-xattrs-keys
To test, build the parser and run the following command:
$ echo '/usr/bin/* xattrs=(user.foo user.bar=bar) {}' | \
./apparmor_parser -r
$ setfattr -n "user.foo" -v "foo" /usr/bin/whoami
$ setfattr -n "user.bar" -v "bar" /usr/bin/whoami
$ whoami # command fails
Signed-off-by: Eric Chiang <ericchiang(a)google.com>
CC: stable(a)vger.kernel.org
---
security/apparmor/domain.c | 22 +++++++++++++++++++---
security/apparmor/include/policy.h | 6 ++++++
security/apparmor/policy.c | 3 +++
security/apparmor/policy_unpack.c | 18 ++++++++++++++++++
4 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
index 08c88de0ffda..53c46e3e01f0 100644
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -319,14 +319,30 @@ static int aa_xattrs_match(const struct linux_binprm *bprm,
char *value = NULL;
int value_size = 0, ret = profile->xattr_count;
- if (!bprm || !profile->xattr_count)
+ if (!bprm)
return 0;
+ d = bprm->file->f_path.dentry;
+
+ if (profile->xattr_keys_count) {
+ /* validate that these attributes are present, ignore values */
+ for (i = 0; i < profile->xattr_keys_count; i++) {
+ size = vfs_getxattr_alloc(d, profile->xattr_keys[i],
+ &value, value_size,
+ GFP_KERNEL);
+ if (size < 0) {
+ ret = -EINVAL;
+ goto out;
+ }
+ }
+ }
+
+ if (!profile->xattr_count)
+ goto out;
+
/* transition from exec match to xattr set */
state = aa_dfa_null_transition(profile->xmatch, state);
- d = bprm->file->f_path.dentry;
-
for (i = 0; i < profile->xattr_count; i++) {
size = vfs_getxattr_alloc(d, profile->xattrs[i], &value,
value_size, GFP_KERNEL);
diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h
index 8e6707c837be..8ed1d30de7ce 100644
--- a/security/apparmor/include/policy.h
+++ b/security/apparmor/include/policy.h
@@ -112,6 +112,10 @@ struct aa_data {
* @policy: general match rules governing policy
* @file: The set of rules governing basic file access and domain transitions
* @caps: capabilities for the profile
+ * @xattr_count: number of xattrs values
+ * @xattrs: extended attributes whose values must match the xmatch
+ * @xattr_keys_count: number of xattr keys values
+ * @xattr_keys: extended attributes that must be present to match the profile
* @rlimits: rlimits for the profile
*
* @dents: dentries for the profiles file entries in apparmorfs
@@ -152,6 +156,8 @@ struct aa_profile {
int xattr_count;
char **xattrs;
+ int xattr_keys_count;
+ char **xattr_keys;
struct aa_rlimit rlimits;
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
index df9c5890a878..e0f9cf8b8318 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -231,6 +231,9 @@ void aa_free_profile(struct aa_profile *profile)
for (i = 0; i < profile->xattr_count; i++)
kzfree(profile->xattrs[i]);
kzfree(profile->xattrs);
+ for (i = 0; i < profile->xattr_keys_count; i++)
+ kzfree(profile->xattr_keys[i]);
+ kzfree(profile->xattr_keys);
for (i = 0; i < profile->secmark_count; i++)
kzfree(profile->secmark[i].label);
kzfree(profile->secmark);
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index 379682e2a8d5..d1fd75093260 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -535,6 +535,24 @@ static bool unpack_xattrs(struct aa_ext *e, struct aa_profile *profile)
goto fail;
}
+ if (unpack_nameX(e, AA_STRUCT, "xattr_keys")) {
+ int i, size;
+
+ size = unpack_array(e, NULL);
+ profile->xattr_keys_count = size;
+ profile->xattr_keys = kcalloc(size, sizeof(char *), GFP_KERNEL);
+ if (!profile->xattr_keys)
+ goto fail;
+ for (i = 0; i < size; i++) {
+ if (!unpack_strdup(e, &profile->xattr_keys[i], NULL))
+ goto fail;
+ }
+ if (!unpack_nameX(e, AA_ARRAYEND, NULL))
+ goto fail;
+ if (!unpack_nameX(e, AA_STRUCTEND, NULL))
+ goto fail;
+ }
+
return 1;
fail:
--
2.20.0.rc2.403.gdbc3b29805-goog