Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'topic/kcmp-kconfig-2021-02-22' of git://anongit.freedesktop.org/drm/drm

Pull kcmp kconfig update from Daniel Vetter:
"Make the kcmp syscall available independently of checkpoint/restore.

drm userspaces uses this, systemd uses this, so makes sense to pull it
out from the checkpoint-restore bundle.

Kees reviewed this from security pov and is happy with the final
version"

Link: https://lwn.net/Articles/845448/

* tag 'topic/kcmp-kconfig-2021-02-22' of git://anongit.freedesktop.org/drm/drm:
kcmp: Support selection of SYS_kcmp without CHECKPOINT_RESTORE

+19 -5
+3
drivers/gpu/drm/Kconfig
··· 15 15 select I2C_ALGOBIT 16 16 select DMA_SHARED_BUFFER 17 17 select SYNC_FILE 18 + # gallium uses SYS_kcmp for os_same_file_description() to de-duplicate 19 + # device and dmabuf fd. Let's make sure that is available for our userspace. 20 + select KCMP 18 21 help 19 22 Kernel-level support for the Direct Rendering Infrastructure (DRI) 20 23 introduced in XFree86 4.0. If you say Y here, you need to select
+2 -2
fs/eventpoll.c
··· 979 979 return epir; 980 980 } 981 981 982 - #ifdef CONFIG_CHECKPOINT_RESTORE 982 + #ifdef CONFIG_KCMP 983 983 static struct epitem *ep_find_tfd(struct eventpoll *ep, int tfd, unsigned long toff) 984 984 { 985 985 struct rb_node *rbp; ··· 1021 1021 1022 1022 return file_raw; 1023 1023 } 1024 - #endif /* CONFIG_CHECKPOINT_RESTORE */ 1024 + #endif /* CONFIG_KCMP */ 1025 1025 1026 1026 /** 1027 1027 * Adds a new entry to the tail of the list in a lockless way, i.e.
+1 -1
include/linux/eventpoll.h
··· 18 18 19 19 #ifdef CONFIG_EPOLL 20 20 21 - #ifdef CONFIG_CHECKPOINT_RESTORE 21 + #ifdef CONFIG_KCMP 22 22 struct file *get_epoll_tfile_raw_ptr(struct file *file, int tfd, unsigned long toff); 23 23 #endif 24 24
+11
init/Kconfig
··· 1193 1193 config CHECKPOINT_RESTORE 1194 1194 bool "Checkpoint/restore support" 1195 1195 select PROC_CHILDREN 1196 + select KCMP 1196 1197 default n 1197 1198 help 1198 1199 Enables additional kernel features in a sake of checkpoint/restore. ··· 1736 1735 1737 1736 config ARCH_HAS_MEMBARRIER_SYNC_CORE 1738 1737 bool 1738 + 1739 + config KCMP 1740 + bool "Enable kcmp() system call" if EXPERT 1741 + help 1742 + Enable the kernel resource comparison system call. It provides 1743 + user-space with the ability to compare two processes to see if they 1744 + share a common resource, such as a file descriptor or even virtual 1745 + memory space. 1746 + 1747 + If unsure, say N. 1739 1748 1740 1749 config RSEQ 1741 1750 bool "Enable rseq() system call" if EXPERT
+1 -1
kernel/Makefile
··· 51 51 obj-y += dma/ 52 52 obj-y += entry/ 53 53 54 - obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o 54 + obj-$(CONFIG_KCMP) += kcmp.o 55 55 obj-$(CONFIG_FREEZER) += freezer.o 56 56 obj-$(CONFIG_PROFILING) += profile.o 57 57 obj-$(CONFIG_STACKTRACE) += stacktrace.o
+1 -1
tools/testing/selftests/seccomp/seccomp_bpf.c
··· 315 315 ret = __filecmp(getpid(), getpid(), 1, 1); 316 316 EXPECT_EQ(ret, 0); 317 317 if (ret != 0 && errno == ENOSYS) 318 - SKIP(return, "Kernel does not support kcmp() (missing CONFIG_CHECKPOINT_RESTORE?)"); 318 + SKIP(return, "Kernel does not support kcmp() (missing CONFIG_KCMP?)"); 319 319 } 320 320 321 321 TEST(mode_strict_support)