mbox series

[bpf-next,v3,0/5] bpf: Fix warnings in kvmalloc_node()

Message ID 20231215100708.2265609-1-houtao@huaweicloud.com (mailing list archive)
Headers show
Series bpf: Fix warnings in kvmalloc_node() | expand

Message

Hou Tao Dec. 15, 2023, 10:07 a.m. UTC
From: Hou Tao <houtao1@huawei.com>

Hi,

The patch set aims to fix the warnings in kvmalloc_node() when passing
an abnormally big cnt during multiple kprobes/uprobes attachment.

Patch #1 and #2 fix the warning by limiting the maximal number of
uprobes/kprobes. Patch #3, #4, and #5 add tests to ensure these
warnings are fixed.

Please see individual patches for more details. Comments are always
welcome.

Change Log:
v3:
  * add ack tags from Jiri
  * return -E2BIG instead of -EINVAL for too-big cnt (Andrii)
  * patch #3: rename the subtest from "failed_link_api" to
              "attach_api_fails", so it is consistent with the naming
	      convention in multi-kprobe test.
  * patch #4: newly-added patch to remove libbpf_get_error() in
              kprobe_multi_test (Andrii)

v2: https://lore.kernel.org/bpf/20231213112531.3775079-1-houtao@huaweicloud.com/
  * limit the number of uprobes/kprobes instead of suppressing the
    out-of-memory warning message (Alexei)
  * provide a faked non-zero offsets to simplify the multiple uprobe
    test (Jiri)

v1: https://lore.kernel.org/bpf/20231211112843.4147157-1-houtao@huaweicloud.com/

Hou Tao (5):
  bpf: Limit the number of uprobes when attaching program to multiple
    uprobes
  bpf: Limit the number of kprobes when attaching program to multiple
    kprobes
  selftests/bpf: Add test for abnormal cnt during multi-uprobe
    attachment
  selftests/bpf: Don't use libbpf_get_error() in kprobe_multi_test
  selftests/bpf: Add test for abnormal cnt during multi-kprobe
    attachment

 kernel/trace/bpf_trace.c                      |  7 ++++
 .../bpf/prog_tests/kprobe_multi_test.c        | 31 +++++++++++++++---
 .../bpf/prog_tests/uprobe_multi_test.c        | 32 ++++++++++++++++++-
 3 files changed, 64 insertions(+), 6 deletions(-)

Comments

Andrii Nakryiko Dec. 15, 2023, 9:15 p.m. UTC | #1
On Fri, Dec 15, 2023 at 2:06 AM Hou Tao <houtao@huaweicloud.com> wrote:
>
> From: Hou Tao <houtao1@huawei.com>
>
> Hi,
>
> The patch set aims to fix the warnings in kvmalloc_node() when passing
> an abnormally big cnt during multiple kprobes/uprobes attachment.
>
> Patch #1 and #2 fix the warning by limiting the maximal number of
> uprobes/kprobes. Patch #3, #4, and #5 add tests to ensure these
> warnings are fixed.
>
> Please see individual patches for more details. Comments are always
> welcome.
>
> Change Log:
> v3:
>   * add ack tags from Jiri
>   * return -E2BIG instead of -EINVAL for too-big cnt (Andrii)
>   * patch #3: rename the subtest from "failed_link_api" to
>               "attach_api_fails", so it is consistent with the naming
>               convention in multi-kprobe test.
>   * patch #4: newly-added patch to remove libbpf_get_error() in
>               kprobe_multi_test (Andrii)
>
> v2: https://lore.kernel.org/bpf/20231213112531.3775079-1-houtao@huaweicloud.com/
>   * limit the number of uprobes/kprobes instead of suppressing the
>     out-of-memory warning message (Alexei)
>   * provide a faked non-zero offsets to simplify the multiple uprobe
>     test (Jiri)
>
> v1: https://lore.kernel.org/bpf/20231211112843.4147157-1-houtao@huaweicloud.com/
>
> Hou Tao (5):
>   bpf: Limit the number of uprobes when attaching program to multiple
>     uprobes
>   bpf: Limit the number of kprobes when attaching program to multiple
>     kprobes
>   selftests/bpf: Add test for abnormal cnt during multi-uprobe
>     attachment
>   selftests/bpf: Don't use libbpf_get_error() in kprobe_multi_test
>   selftests/bpf: Add test for abnormal cnt during multi-kprobe
>     attachment
>
>  kernel/trace/bpf_trace.c                      |  7 ++++
>  .../bpf/prog_tests/kprobe_multi_test.c        | 31 +++++++++++++++---
>  .../bpf/prog_tests/uprobe_multi_test.c        | 32 ++++++++++++++++++-
>  3 files changed, 64 insertions(+), 6 deletions(-)
>
> --
> 2.29.2
>
>

LGTM, for the series:

Acked-by: Andrii Nakryiko <andrii@kernel.org>
patchwork-bot+netdevbpf@kernel.org Dec. 15, 2023, 10 p.m. UTC | #2
Hello:

This series was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Fri, 15 Dec 2023 18:07:03 +0800 you wrote:
> From: Hou Tao <houtao1@huawei.com>
> 
> Hi,
> 
> The patch set aims to fix the warnings in kvmalloc_node() when passing
> an abnormally big cnt during multiple kprobes/uprobes attachment.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v3,1/5] bpf: Limit the number of uprobes when attaching program to multiple uprobes
    https://git.kernel.org/bpf/bpf-next/c/8b2efe51ba85
  - [bpf-next,v3,2/5] bpf: Limit the number of kprobes when attaching program to multiple kprobes
    https://git.kernel.org/bpf/bpf-next/c/d6d1e6c17cab
  - [bpf-next,v3,3/5] selftests/bpf: Add test for abnormal cnt during multi-uprobe attachment
    https://git.kernel.org/bpf/bpf-next/c/0d83786f5661
  - [bpf-next,v3,4/5] selftests/bpf: Don't use libbpf_get_error() in kprobe_multi_test
    https://git.kernel.org/bpf/bpf-next/c/00cdcd2900bd
  - [bpf-next,v3,5/5] selftests/bpf: Add test for abnormal cnt during multi-kprobe attachment
    https://git.kernel.org/bpf/bpf-next/c/1467affd16b2

You are awesome, thank you!