~timg-tpi/ubuntu/+source/linux/+git/focal:focal-azure-opensnoop

Last commit made on 2022-09-16
Get this branch:
git clone -b focal-azure-opensnoop https://git.launchpad.net/~timg-tpi/ubuntu/+source/linux/+git/focal
Only Tim Gardner can upload to this branch. If you are Tim Gardner please log in for upload directions.

Branch merges

Branch information

Name:
focal-azure-opensnoop
Repository:
lp:~timg-tpi/ubuntu/+source/linux/+git/focal

Recent commits

a9d1911... by Tim Gardner

5.4.0-1092.97~lp1990009.1

Signed-off-by: Tim Gardner <email address hidden>

e62d42a... by Tim Gardner

UBUNTU: Ubuntu-azure-5.4.0-1092.97

Signed-off-by: Tim Gardner <email address hidden>

325cbb5... by Tim Gardner

UBUNTU: Start new release

Ignore: yes
Signed-off-by: Tim Gardner <email address hidden>

24e3586... by Daniel Borkmann

bpf, testing: Add selftest to read/write sockaddr from user space

BugLink: https://bugs.launchpad.net/bugs/1990009

Tested on x86-64 and Ilya was also kind enough to give it a spin on
s390x, both passing with probe_user:OK there. The test is using the
newly added bpf_probe_read_user() to dump sockaddr from connect call
into .bss BPF map and overrides the user buffer via bpf_probe_write_user():

  # ./test_progs
  [...]
  #17 pkt_md_access:OK
  #18 probe_user:OK
  #19 prog_run_xattr:OK
  [...]

Signed-off-by: Daniel Borkmann <email address hidden>
Signed-off-by: Alexei Starovoitov <email address hidden>
Tested-by: Ilya Leoshkevich <email address hidden>
Acked-by: Andrii Nakryiko <email address hidden>
Link: https://lore.kernel.org/bpf<email address hidden>
(cherry picked from commit fa553d9b57d4a98a160d1926b4e263e7a78c0cf3)
Signed-off-by: Tim Gardner <email address hidden>

0c14404... by Daniel Borkmann

bpf, testing: Convert prog tests to probe_read_{user, kernel}{, _str} helper

BugLink: https://bugs.launchpad.net/bugs/1990009

Use probe read *_{kernel,user}{,_str}() helpers instead of bpf_probe_read()
or bpf_probe_read_user_str() for program tests where appropriate.

Signed-off-by: Daniel Borkmann <email address hidden>
Signed-off-by: Alexei Starovoitov <email address hidden>
Acked-by: Andrii Nakryiko <email address hidden>
Link: https://lore.kernel.org/bpf<email address hidden>
(backported from commit 50f9aa44cac7256551b2e0901831e432a6c52b7f)
[rtg - dropped tools/testing/selftests/bpf/progs/kfree_skb.c]
Signed-off-by: Tim Gardner <email address hidden>

5802a54... by Daniel Borkmann

bpf, samples: Use bpf_probe_read_user where appropriate

BugLink: https://bugs.launchpad.net/bugs/1990009

Use bpf_probe_read_user() helper instead of bpf_probe_read() for samples that
attach to kprobes probing on user addresses.

Signed-off-by: Daniel Borkmann <email address hidden>
Signed-off-by: Alexei Starovoitov <email address hidden>
Acked-by: Andrii Nakryiko <email address hidden>
Link: https://lore.kernel.org/bpf<email address hidden>
(cherry picked from commit 251e2d337a1a4f2572439ea29fd27f8699c5c368)
Signed-off-by: Tim Gardner <email address hidden>

0c64ee2... by Daniel Borkmann

bpf: Add probe_read_{user, kernel} and probe_read_{user, kernel}_str helpers

BugLink: https://bugs.launchpad.net/bugs/1990009

The current bpf_probe_read() and bpf_probe_read_str() helpers are broken
in that they assume they can be used for probing memory access for kernel
space addresses /as well as/ user space addresses.

However, plain use of probe_kernel_read() for both cases will attempt to
always access kernel space address space given access is performed under
KERNEL_DS and some archs in-fact have overlapping address spaces where a
kernel pointer and user pointer would have the /same/ address value and
therefore accessing application memory via bpf_probe_read{,_str}() would
read garbage values.

Lets fix BPF side by making use of recently added 3d7081822f7f ("uaccess:
Add non-pagefault user-space read functions"). Unfortunately, the only way
to fix this status quo is to add dedicated bpf_probe_read_{user,kernel}()
and bpf_probe_read_{user,kernel}_str() helpers. The bpf_probe_read{,_str}()
helpers are kept as-is to retain their current behavior.

The two *_user() variants attempt the access always under USER_DS set, the
two *_kernel() variants will -EFAULT when accessing user memory if the
underlying architecture has non-overlapping address ranges, also avoiding
throwing the kernel warning via 00c42373d397 ("x86-64: add warning for
non-canonical user access address dereferences").

Fixes: a5e8c07059d0 ("bpf: add bpf_probe_read_str helper")
Fixes: 2541517c32be ("tracing, perf: Implement BPF programs attached to kprobes")
Signed-off-by: Daniel Borkmann <email address hidden>
Signed-off-by: Alexei Starovoitov <email address hidden>
Acked-by: Andrii Nakryiko <email address hidden>
Link: https://lore.kernel.org/bpf<email address hidden>
(backported from commit 6ae08ae3dea2cfa03dd3665a3c8475c2d429ef47)
[rtg - context adjustments]
Signed-off-by: Tim Gardner <email address hidden>

4df98c2... by Daniel Borkmann

uaccess: Add strict non-pagefault kernel-space read function

BugLink: https://bugs.launchpad.net/bugs/1990009

Add two new probe_kernel_read_strict() and strncpy_from_unsafe_strict()
helpers which by default alias to the __probe_kernel_read() and the
__strncpy_from_unsafe(), respectively, but can be overridden by archs
which have non-overlapping address ranges for kernel space and user
space in order to bail out with -EFAULT when attempting to probe user
memory including non-canonical user access addresses [0]:

  4-level page tables:
    user-space mem: 0x0000000000000000 - 0x00007fffffffffff
    non-canonical: 0x0000800000000000 - 0xffff7fffffffffff

  5-level page tables:
    user-space mem: 0x0000000000000000 - 0x00ffffffffffffff
    non-canonical: 0x0100000000000000 - 0xfeffffffffffffff

The idea is that these helpers are complementary to the probe_user_read()
and strncpy_from_unsafe_user() which probe user-only memory. Both added
helpers here do the same, but for kernel-only addresses.

Both set of helpers are going to be used for BPF tracing. They also
explicitly avoid throwing the splat for non-canonical user addresses from
00c42373d397 ("x86-64: add warning for non-canonical user access address
dereferences").

For compat, the current probe_kernel_read() and strncpy_from_unsafe() are
left as-is.

  [0] Documentation/x86/x86_64/mm.txt

Signed-off-by: Daniel Borkmann <email address hidden>
Signed-off-by: Alexei Starovoitov <email address hidden>
Cc: Linus Torvalds <email address hidden>
Cc: Masami Hiramatsu <email address hidden>
Cc: <email address hidden>
Link: https://lore.kernel.org/bpf<email address hidden>
(cherry picked from commit 75a1a607bb7e6d918be3aca11ec2214a275392f4)
Signed-off-by: Tim Gardner <email address hidden>

90012ed... by Tim Gardner

UBUNTU: [Config] azure: arm64: CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=n

BugLink: https://bugs.launchpad.net/bugs/1988434

Signed-off-by: Tim Gardner <email address hidden>
Acked-by: Philip Cox <email address hidden>
Acked-by: Marcelo Cerri <email address hidden>
Signed-off-by: Tim Gardner <email address hidden>

825bc14... by Tim Gardner

UBUNTU: Ubuntu-azure-5.4.0-1091.96

Signed-off-by: Tim Gardner <email address hidden>