1. 15 Jan, 2022 8 commits
  2. 09 Jan, 2022 6 commits
  3. 08 Jan, 2022 5 commits
  4. 07 Jan, 2022 11 commits
  5. 06 Jan, 2022 10 commits
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.16-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · b2b436ec
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "Three minor tracing fixes:
      
         - Fix missing prototypes in sample module for direct functions
      
         - Fix check of valid buffer in get_trace_buf()
      
         - Fix annotations of percpu pointers"
      
      * tag 'trace-v5.16-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Tag trace_percpu_buffer as a percpu pointer
        tracing: Fix check for trace_percpu_buffer validity in get_trace_buf()
        ftrace/samples: Add missing prototypes direct functions
      b2b436ec
    • Tejun Heo's avatar
      selftests: cgroup: Test open-time cgroup namespace usage for migration checks · bf35a787
      Tejun Heo authored
      When a task is writing to an fd opened by a different task, the perm check
      should use the cgroup namespace of the latter task. Add a test for it.
      Tested-by: default avatarMichal Koutný <mkoutny@suse.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      bf35a787
    • Tejun Heo's avatar
      selftests: cgroup: Test open-time credential usage for migration checks · 613e040e
      Tejun Heo authored
      When a task is writing to an fd opened by a different task, the perm check
      should use the credentials of the latter task. Add a test for it.
      Tested-by: default avatarMichal Koutný <mkoutny@suse.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      613e040e
    • Tejun Heo's avatar
      selftests: cgroup: Make cg_create() use 0755 for permission instead of 0644 · b09c2baa
      Tejun Heo authored
      0644 is an odd perm to create a cgroup which is a directory. Use the regular
      0755 instead. This is necessary for euid switching test case.
      Reviewed-by: default avatarMichal Koutný <mkoutny@suse.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      b09c2baa
    • Tejun Heo's avatar
      cgroup: Use open-time cgroup namespace for process migration perm checks · e5745764
      Tejun Heo authored
      cgroup process migration permission checks are performed at write time as
      whether a given operation is allowed or not is dependent on the content of
      the write - the PID. This currently uses current's cgroup namespace which is
      a potential security weakness as it may allow scenarios where a less
      privileged process tricks a more privileged one into writing into a fd that
      it created.
      
      This patch makes cgroup remember the cgroup namespace at the time of open
      and uses it for migration permission checks instad of current's. Note that
      this only applies to cgroup2 as cgroup1 doesn't have namespace support.
      
      This also fixes a use-after-free bug on cgroupns reported in
      
       https://lore.kernel.org/r/00000000000048c15c05d0083397@google.com
      
      Note that backporting this fix also requires the preceding patch.
      Reported-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Suggested-by: default avatarLinus Torvalds <torvalds@linuxfoundation.org>
      Cc: Michal Koutný <mkoutny@suse.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Reviewed-by: default avatarMichal Koutný <mkoutny@suse.com>
      Reported-by: syzbot+50f5cf33a284ce738b62@syzkaller.appspotmail.com
      Link: https://lore.kernel.org/r/00000000000048c15c05d0083397@google.com
      Fixes: 5136f636 ("cgroup: implement "nsdelegate" mount option")
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      e5745764
    • Tejun Heo's avatar
      cgroup: Allocate cgroup_file_ctx for kernfs_open_file->priv · 0d2b5955
      Tejun Heo authored
      of->priv is currently used by each interface file implementation to store
      private information. This patch collects the current two private data usages
      into struct cgroup_file_ctx which is allocated and freed by the common path.
      This allows generic private data which applies to multiple files, which will
      be used to in the following patch.
      
      Note that cgroup_procs iterator is now embedded as procs.iter in the new
      cgroup_file_ctx so that it doesn't need to be allocated and freed
      separately.
      
      v2: union dropped from cgroup_file_ctx and the procs iterator is embedded in
          cgroup_file_ctx as suggested by Linus.
      
      v3: Michal pointed out that cgroup1's procs pidlist uses of->priv too.
          Converted. Didn't change to embedded allocation as cgroup1 pidlists get
          stored for caching.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Reviewed-by: default avatarMichal Koutný <mkoutny@suse.com>
      0d2b5955
    • Tejun Heo's avatar
      cgroup: Use open-time credentials for process migraton perm checks · 1756d799
      Tejun Heo authored
      cgroup process migration permission checks are performed at write time as
      whether a given operation is allowed or not is dependent on the content of
      the write - the PID. This currently uses current's credentials which is a
      potential security weakness as it may allow scenarios where a less
      privileged process tricks a more privileged one into writing into a fd that
      it created.
      
      This patch makes both cgroup2 and cgroup1 process migration interfaces to
      use the credentials saved at the time of open (file->f_cred) instead of
      current's.
      Reported-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Suggested-by: default avatarLinus Torvalds <torvalds@linuxfoundation.org>
      Fixes: 187fe840 ("cgroup: require write perm on common ancestor when moving processes on the default hierarchy")
      Reviewed-by: default avatarMichal Koutný <mkoutny@suse.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      1756d799
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-5.16-2021-12-31' of... · 936a9377
      Dave Airlie authored
      Merge tag 'amd-drm-fixes-5.16-2021-12-31' of ssh://gitlab.freedesktop.org/agd5f/linux into drm-fixes
      
      amd-drm-fixes-5.16-2021-12-31:
      
      amdgpu:
      - Suspend/resume fix
      - Restore runtime pm behavior with efifb
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211231143825.11479-1-alexander.deucher@amd.com
      936a9377
    • Chris Packham's avatar
      i2c: mpc: Avoid out of bounds memory access · 72a4a87d
      Chris Packham authored
      When performing an I2C transfer where the last message was a write KASAN
      would complain:
      
        BUG: KASAN: slab-out-of-bounds in mpc_i2c_do_action+0x154/0x630
        Read of size 2 at addr c814e310 by task swapper/2/0
      
        CPU: 2 PID: 0 Comm: swapper/2 Tainted: G    B             5.16.0-rc8 #1
        Call Trace:
        [e5ee9d50] [c08418e8] dump_stack_lvl+0x4c/0x6c (unreliable)
        [e5ee9d70] [c02f8a14] print_address_description.constprop.13+0x64/0x3b0
        [e5ee9da0] [c02f9030] kasan_report+0x1f0/0x204
        [e5ee9de0] [c0c76ee4] mpc_i2c_do_action+0x154/0x630
        [e5ee9e30] [c0c782c4] mpc_i2c_isr+0x164/0x240
        [e5ee9e60] [c00f3a04] __handle_irq_event_percpu+0xf4/0x3b0
        [e5ee9ec0] [c00f3d40] handle_irq_event_percpu+0x80/0x110
        [e5ee9f40] [c00f3e48] handle_irq_event+0x78/0xd0
        [e5ee9f60] [c00fcfec] handle_fasteoi_irq+0x19c/0x370
        [e5ee9fa0] [c00f1d84] generic_handle_irq+0x54/0x80
        [e5ee9fc0] [c0006b54] __do_irq+0x64/0x200
        [e5ee9ff0] [c0007958] __do_IRQ+0xe8/0x1c0
        [c812dd50] [e3eaab20] 0xe3eaab20
        [c812dd90] [c0007a4c] do_IRQ+0x1c/0x30
        [c812dda0] [c0000c04] ExternalInput+0x144/0x160
        --- interrupt: 500 at arch_cpu_idle+0x34/0x60
        NIP:  c000b684 LR: c000b684 CTR: c0019688
        REGS: c812ddb0 TRAP: 0500   Tainted: G    B              (5.16.0-rc8)
        MSR:  00029002 <CE,EE,ME>  CR: 22000488  XER: 20000000
      
        GPR00: c10ef7fc c812de90 c80ff200 c2394718 00000001 00000001 c10e3f90 00000003
        GPR08: 00000000 c0019688 c2394718 fc7d625b 22000484 00000000 21e17000 c208228c
        GPR16: e3e99284 00000000 ffffffff c2390000 c001bac0 c2082288 c812df60 c001ba60
        GPR24: c23949c0 00000018 00080000 00000004 c80ff200 00000002 c2348ee4 c2394718
        NIP [c000b684] arch_cpu_idle+0x34/0x60
        LR [c000b684] arch_cpu_idle+0x34/0x60
        --- interrupt: 500
        [c812de90] [c10e3f90] rcu_eqs_enter.isra.60+0xc0/0x110 (unreliable)
        [c812deb0] [c10ef7fc] default_idle_call+0xbc/0x230
        [c812dee0] [c00af0e8] do_idle+0x1c8/0x200
        [c812df10] [c00af3c0] cpu_startup_entry+0x20/0x30
        [c812df20] [c001e010] start_secondary+0x5d0/0xba0
        [c812dff0] [c00028a0] __secondary_start+0x90/0xdc
      
      This happened because we would overrun the i2c->msgs array on the final
      interrupt for the I2C STOP. This didn't happen if the last message was a
      read because there is no interrupt in that case. Ensure that we only
      access the current message if we are not processing a I2C STOP
      condition.
      
      Fixes: 1538d82f ("i2c: mpc: Interrupt driven transfer")
      Reported-by: default avatarMaxime Bizon <mbizon@freebox.fr>
      Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      72a4a87d
    • Olof Johansson's avatar
      Merge tag 'socfpga_fix_for_v5.16_part_3' of... · 8922bb65
      Olof Johansson authored
      Merge tag 'socfpga_fix_for_v5.16_part_3' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/fixes
      
      SoCFPGA dts updates for v5.16, part 3
      - Change the SoCFPGA compatible to "intel,socfpga-qspi"
      - Update dt-bindings document to include "intel,socfpga-qspi"
      
      * tag 'socfpga_fix_for_v5.16_part_3' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: (361 commits)
        ARM: dts: socfpga: change qspi to "intel,socfpga-qspi"
        dt-bindings: spi: cadence-quadspi: document "intel,socfpga-qspi"
        Linux 5.16-rc7
        mm/hwpoison: clear MF_COUNT_INCREASED before retrying get_any_page()
        mm/damon/dbgfs: protect targets destructions with kdamond_lock
        mm/page_alloc: fix __alloc_size attribute for alloc_pages_exact_nid
        mm: delete unsafe BUG from page_cache_add_speculative()
        mm, hwpoison: fix condition in free hugetlb page path
        MAINTAINERS: mark more list instances as moderated
        kernel/crash_core: suppress unknown crashkernel parameter warning
        mm: mempolicy: fix THP allocations escaping mempolicy restrictions
        kfence: fix memory leak when cat kfence objects
        platform/x86: intel_pmc_core: fix memleak on registration failure
        net: stmmac: dwmac-visconti: Fix value of ETHER_CLK_SEL_FREQ_SEL_2P5M
        r8152: sync ocp base
        r8152: fix the force speed doesn't work for RTL8156
        net: bridge: fix ioctl old_deviceless bridge argument
        net: stmmac: ptp: fix potentially overflowing expression
        net: dsa: tag_ocelot: use traffic class to map priority on injected header
        veth: ensure skb entering GRO are not cloned.
        ...
      
      Link: https://lore.kernel.org/r/20211227103644.566694-1-dinguyen@kernel.orgSigned-off-by: default avatarOlof Johansson <olof@lixom.net>
      8922bb65