]> Git Repo - linux.git/commitdiff
Merge tag 'topic/kcmp-kconfig-2021-02-22' of git://anongit.freedesktop.org/drm/drm
authorLinus Torvalds <[email protected]>
Tue, 23 Feb 2021 01:15:30 +0000 (17:15 -0800)
committerLinus Torvalds <[email protected]>
Tue, 23 Feb 2021 01:15:30 +0000 (17:15 -0800)
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

1  2 
drivers/gpu/drm/Kconfig
init/Kconfig
tools/testing/selftests/seccomp/seccomp_bpf.c

diff --combined drivers/gpu/drm/Kconfig
index 8bf103de1594c813a10448bae994d314e0374050,af6c6d214d9161b98c7487dc0c8e0ab677a6a3e2..e392a90ca6876cc3dcec88baacb3bc4099bbac6c
@@@ -15,6 -15,9 +15,9 @@@ menuconfig DR
        select I2C_ALGOBIT
        select DMA_SHARED_BUFFER
        select SYNC_FILE
+ # gallium uses SYS_kcmp for os_same_file_description() to de-duplicate
+ # device and dmabuf fd. Let's make sure that is available for our userspace.
+       select KCMP
        help
          Kernel-level support for the Direct Rendering Infrastructure (DRI)
          introduced in XFree86 4.0. If you say Y here, you need to select
@@@ -214,6 -217,10 +217,6 @@@ config DRM_GEM_SHMEM_HELPE
        help
          Choose this if you need the GEM shmem helper functions
  
 -config DRM_VM
 -      bool
 -      depends on DRM && MMU
 -
  config DRM_SCHED
        tristate
        depends on DRM
@@@ -387,6 -394,7 +390,6 @@@ source "drivers/gpu/drm/xlnx/Kconfig
  menuconfig DRM_LEGACY
        bool "Enable legacy drivers (DANGEROUS)"
        depends on DRM && MMU
 -      select DRM_VM
        help
          Enable legacy DRI1 drivers. Those drivers expose unsafe and dangerous
          APIs to user-space, which can be used to circumvent access
diff --combined init/Kconfig
index 096e1af5c5865eafe438b1c0673f7f7ad46f1711,b7d3c6a12196f76ff268fff2c6cf74dfc5366186..47a3d6502fbd00f5fba632edebafa73259db0b21
@@@ -524,7 -524,7 +524,7 @@@ config SCHED_THERMAL_PRESSUR
          i.e. put less load on throttled CPUs than on non/less throttled ones.
  
          This requires the architecture to implement
 -        arch_set_thermal_pressure() and arch_get_thermal_pressure().
 +        arch_set_thermal_pressure() and arch_scale_thermal_pressure().
  
  config BSD_PROCESS_ACCT
        bool "BSD Process Accounting"
@@@ -1193,6 -1193,7 +1193,7 @@@ endif # NAMESPACE
  config CHECKPOINT_RESTORE
        bool "Checkpoint/restore support"
        select PROC_CHILDREN
+       select KCMP
        default n
        help
          Enables additional kernel features in a sake of checkpoint/restore.
@@@ -1736,6 -1737,16 +1737,16 @@@ config ARCH_HAS_MEMBARRIER_CALLBACK
  config ARCH_HAS_MEMBARRIER_SYNC_CORE
        bool
  
+ config KCMP
+       bool "Enable kcmp() system call" if EXPERT
+       help
+         Enable the kernel resource comparison system call. It provides
+         user-space with the ability to compare two processes to see if they
+         share a common resource, such as a file descriptor or even virtual
+         memory space.
+         If unsure, say N.
  config RSEQ
        bool "Enable rseq() system call" if EXPERT
        default y
@@@ -2023,7 -2034,7 +2034,7 @@@ config PROFILIN
        bool "Profiling support"
        help
          Say Y here to enable the extended profiling support mechanisms used
 -        by profilers such as OProfile.
 +        by profilers.
  
  #
  # Place an empty function call at each tracepoint site. Can be
index 9338df6f4ca8ecf1dc73eb007e3c1e0396cc352b,1b6c7d33c4ff28787a8a55d96772a93fa56477f8..98c3b647f54dcd982983de4d0ae8ac622d36e8fa
@@@ -315,7 -315,7 +315,7 @@@ TEST(kcmp
        ret = __filecmp(getpid(), getpid(), 1, 1);
        EXPECT_EQ(ret, 0);
        if (ret != 0 && errno == ENOSYS)
-               SKIP(return, "Kernel does not support kcmp() (missing CONFIG_CHECKPOINT_RESTORE?)");
+               SKIP(return, "Kernel does not support kcmp() (missing CONFIG_KCMP?)");
  }
  
  TEST(mode_strict_support)
@@@ -4019,14 -4019,18 +4019,14 @@@ TEST(user_notification_addfd
  
        /* Verify we can set an arbitrary remote fd */
        fd = ioctl(listener, SECCOMP_IOCTL_NOTIF_ADDFD, &addfd);
 -      /*
 -       * The child has fds 0(stdin), 1(stdout), 2(stderr), 3(memfd),
 -       * 4(listener), so the newly allocated fd should be 5.
 -       */
 -      EXPECT_EQ(fd, 5);
 +      EXPECT_GE(fd, 0);
        EXPECT_EQ(filecmp(getpid(), pid, memfd, fd), 0);
  
        /* Verify we can set an arbitrary remote fd with large size */
        memset(&big, 0x0, sizeof(big));
        big.addfd = addfd;
        fd = ioctl(listener, SECCOMP_IOCTL_NOTIF_ADDFD_BIG, &big);
 -      EXPECT_EQ(fd, 6);
 +      EXPECT_GE(fd, 0);
  
        /* Verify we can set a specific remote fd */
        addfd.newfd = 42;
This page took 0.121173 seconds and 4 git commands to generate.