From patchwork Tue Aug 13 01:25:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Rome X-Patchwork-Id: 13761178 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA388B67E for ; Tue, 13 Aug 2024 01:26:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.208.4.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723512370; cv=none; b=dxEHIS9aeqQcTPeAI/FsXAyDhXcEPqNEcO9FqyHfsMEBVheitmlMjJdCnwBxcM7yI361kGQ9YTNlTx2TXfvzHlhUTyPcWswMgceu7UDqGjWyB+etDeZ/wNopl70RkXjypjWsfSJngfGVrE4gglYHWuhOWzyie4LvOl3+21gB3hw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723512370; c=relaxed/simple; bh=WTmgDLcDdYM7UKt0NQS2hIL8BXMCPkg7R7SsOKLRQH0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d6ebmUnJhhwkKL4yZ00SYxomGKIpvbvyZtcfVnoswvyeZYFuwIS+OM/0K+fSVZun9vXy+ko38BGqisrXWTdWoyqvYH8dJqA9GxAxzhfUluuHRKcuBdeRZdq40BicCZxfNkMy7nTyBCCZE0oDsmUzgw2H3SqaQCaPpKLDgPJN23s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jordanrome.com; spf=pass smtp.mailfrom=jordanrome.com; dkim=pass (2048-bit key) header.d=jordanrome.com header.i=linux@jordanrome.com header.b=fHaO4hk5; arc=none smtp.client-ip=74.208.4.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jordanrome.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jordanrome.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=jordanrome.com header.i=linux@jordanrome.com header.b="fHaO4hk5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jordanrome.com; s=s1-ionos; t=1723512338; x=1724117138; i=linux@jordanrome.com; bh=a/bDNfjyyKdZ6iujBVpENPk9ZxD562Q7a11IOMWgiik=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-ID: MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=fHaO4hk5/KyCd/9W824nfsFpOG40aEfC/yVMR/VgzXxFF5zNnhfgpH6d0wxzLE1R RWkducFPd5d05pJ7OrUPEIyhB2FThWtFO2QNpjlP5D4oc3EvRlXXyB+5+KkzMhfmT ynlXHzLOl1t9Im29zUQ2jBi/QXgNJsh5COzW/fBlIN8Sis1D4WUINoXW84PogiSJR TfNDsKYld+OgoW9VP5Msr0REFNs+5WyNXXuZLJ/5wj9pCQq2fjaO/WXdK880JL79B iys+MEydZeoqZrAY2G5iaWtRQsCOgXz4/HwvDqMrteV/XfhGFedmvhWsM882+vgFl vtD5ev3PU9aRQLEZ2w== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from localhost ([173.252.127.18]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPSA (Nemesis) id 0LxQMu-1s61Jw2KNe-0112eK; Tue, 13 Aug 2024 03:25:38 +0200 From: Jordan Rome To: bpf@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Kernel Team , sinquersw@gmail.com Subject: [bpf-next v3 1/2] bpf: Add bpf_copy_from_user_str kfunc Date: Mon, 12 Aug 2024 18:25:27 -0700 Message-ID: <20240813012528.3566133-1-linux@jordanrome.com> X-Mailer: git-send-email 2.43.5 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:Wn7MylDoWmk72piC95Y/jdAL/KaPD1Hb05wVYSx/2sukGkAVMD7 TypFA27uKxvJj8N5RaG2ZDYfS9O7063Fv0Xlrl5Ojg4jPWnK45HQS9C0gnQXFapI0DOkgr6 YVh6zDykGcOvjzCdDpOVRcUYx8mttw3xdey00o5enR8A10RBT2pSAPAAaDqKt1Kzq6S2pZw Pf7dn8u6XjGML7cvzw/0A== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:/2sf+E+eQEA=;abrsNR7LWaahTLDzWjhoBVBvmYP pyKxev7h5GKkkIYQLwXHxtTmqSHUqHb/zsIRdxYinkIO5k5qkfGVGv/Hz1dsDfhiGVRsaCnUS ObBI4YI17yZannb2/UjQ+Eccs7x5W6YX0NwK204sGUWhz4zHVC+3gaQGtYULG7OBe4q2/DahV ktmBNuEE35GgfD3OByedyuuUUjdQ1tiGeGc5maeAz92Ud2+SBeSNJo9pOM/1WrEejFuiMxCUb UchqvkrCaBB86EPCbB9+YFkJZAnjXRYkl4VXcDIXUaRqUyop64oi08Qcc+W9/qpZIzB3kyN6l CuhVuMw188BSu6QE06qL+KXh3tz/UMEmV0fSARVIDrVAiu9wfIwAE0STG31u9ewZkgdiOUV/b jdN6Y51qxZR949HLXIN3NsRGBRx0lqmvDVnbQugRu0FcxzLTF4myBLKt6G3/+6+AEpNXQrkA2 MuWPS5QWzLmwpdbZz/250YUjF/R3+aa7FfF/j/ML8xmOdBB5fZWbLBB2CjY/nTTFm4treK7nv poh+c67DB6h2wqvego9dunpIJT2U8qRlNRS/nD+rd5wS8oPDRkqgVqRI1614dvZuIZ8we6mDw 7qxQY3s33S6Rb3ufQwYYJpuZgzahWsBB0Kq/cK0NFjHnnbDzCukTqiZ7ixQ9+8pIWbDBWX0Xq Ht4kzpNna6kLS58vIe6MrzOix0ocJItKseMqfS/9C4bC1TiBsFSfKnLXY1a3m5v5AaOpASLaX 5YGgRBLp/rLEp3SATOypSOhAfGQFGip5A== X-Patchwork-Delegate: bpf@iogearbox.net This adds a kfunc wrapper around strncpy_from_user, which can be called from sleepable BPF programs. This matches the non-sleepable 'bpf_probe_read_user_str' helper. Signed-off-by: Jordan Rome --- kernel/bpf/helpers.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) -- 2.43.5 diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index d02ae323996b..e87d5df658cb 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -2939,6 +2939,41 @@ __bpf_kfunc void bpf_iter_bits_destroy(struct bpf_iter_bits *it) bpf_mem_free(&bpf_global_ma, kit->bits); } +/** + * bpf_copy_from_user_str() - Copy a string from an unsafe user address + * @dst: Destination address, in kernel space. This buffer must be at + * least @dst__szk bytes long. + * @dst__szk: Maximum number of bytes to copy, including the trailing NUL. + * @unsafe_ptr__ign: Source address, in user space. + * + * Copies a NUL-terminated string from userspace to BPF space. If user string is + * too long this will still ensure zero termination in the dst buffer unless + * buffer size is 0. + */ +__bpf_kfunc int bpf_copy_from_user_str(void *dst, u32 dst__szk, const void __user *unsafe_ptr__ign) +{ + int ret; + int count; + + if (unlikely(!dst__szk)) + return 0; + + count = dst__szk - 1; + if (unlikely(!count)) { + ((char *)dst)[0] = '\0'; + return 1; + } + + ret = strncpy_from_user(dst, unsafe_ptr__ign, count); + if (ret >= 0) { + if (ret == count) + ((char *)dst)[ret] = '\0'; + ret++; + } + + return ret; +} + __bpf_kfunc_end_defs(); BTF_KFUNCS_START(generic_btf_ids) @@ -3024,6 +3059,7 @@ BTF_ID_FLAGS(func, bpf_preempt_enable) BTF_ID_FLAGS(func, bpf_iter_bits_new, KF_ITER_NEW) BTF_ID_FLAGS(func, bpf_iter_bits_next, KF_ITER_NEXT | KF_RET_NULL) BTF_ID_FLAGS(func, bpf_iter_bits_destroy, KF_ITER_DESTROY) +BTF_ID_FLAGS(func, bpf_copy_from_user_str, KF_SLEEPABLE) BTF_KFUNCS_END(common_btf_ids) static const struct btf_kfunc_id_set common_kfunc_set = { From patchwork Tue Aug 13 01:25:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Rome X-Patchwork-Id: 13761179 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mout.perfora.net (mout.perfora.net [74.208.4.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07A4563A9 for ; Tue, 13 Aug 2024 01:26:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.208.4.196 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723512373; cv=none; b=GYrjlRcaLoElDxaWGiOZLhL6izrHDTtxW2t0ncuGDBAWemI7B4otI9/GRDUq0m+bcOd5O0mx9LI3kbTDnNxvcGFpAln73rb+jqUZl7mII6LnYqXBTNfEFo9q9DC5eBbp7mgMAUsTT+axR9Jn1ppWsBthbTi1zKi9cZB9kFqWSg4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723512373; c=relaxed/simple; bh=ezbQRe5cfmfxavSAMePVhwmifsUiq6beS3n+/DTKQM4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lwE3MaSBQtAMmt7KaOf6Owkl6aTDDpa95xK/Ax3b2YDNfdrJy7I2MIYyG1sTdKTfbToFwXJ7skpuZAefkP2ex+OvZkCbKa38BKMQbRW5XyHXIWoILXj5Pw7mQU4CyB+kdnkHGfgHZuIxPbT38Bo7BSz5ACK5/lYt7l+2NPgpMyw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jordanrome.com; spf=pass smtp.mailfrom=jordanrome.com; dkim=pass (2048-bit key) header.d=jordanrome.com header.i=linux@jordanrome.com header.b=x1n3NJ/o; arc=none smtp.client-ip=74.208.4.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jordanrome.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jordanrome.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=jordanrome.com header.i=linux@jordanrome.com header.b="x1n3NJ/o" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jordanrome.com; s=s1-ionos; t=1723512342; x=1724117142; i=linux@jordanrome.com; bh=Ah3mjWN97pJ1LmoXj2S1ZCHJcRDuEJWaStXHPyw/5s8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-ID:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=x1n3NJ/ohdRZDP756+m4RttOL8YecT6ZqOxxmj6PdxXAW0/d8YF/4VEOw0u0h/YL 1vDXfqKtNUxS3fGWDhLCuUCgZnBG5y6XDr9yASIuM+cMeQFwc4f13zd+hqog2Rwjj zdEMDbVBaCLe/oX7YJzzTV0tb9SFTsNu+bc0KUNsRyY+w9WzkKYjofsqEd1WEzX/z w8wr+udypP4/cqq4K77OxqoMK7EG7ibjpLNsnPJJZX1CYj6YENu5ODQdKI6u9AS1i H8ElFDZbNdXVmH3G902UzSNN83n7q8dgsxznaC6w+W/RZ0XGlWag1k12VmsoWroM+ 6KkYWKZPohNE3ibnhg== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from localhost ([173.252.127.13]) by mrelay.perfora.net (mreueus003 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MGTcU-1sQQkg339E-00CpVB; Tue, 13 Aug 2024 03:25:42 +0200 From: Jordan Rome To: bpf@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Kernel Team , sinquersw@gmail.com Subject: [bpf-next v3 2/2] bpf: Add tests for bpf_copy_from_user_str kfunc Date: Mon, 12 Aug 2024 18:25:28 -0700 Message-ID: <20240813012528.3566133-2-linux@jordanrome.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20240813012528.3566133-1-linux@jordanrome.com> References: <20240813012528.3566133-1-linux@jordanrome.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:zPEVd0N8toUjc3jtUQUAV3lVMlvZ1R/QUGmyuXJ2TZ8vuRPTE6F DzTYU6c5hCfOfJxGF4CIQ5/WJAQXu87ZIVhgDg23anSA3v/JUv/dC3HhUq/jM/tQuHjIi0O q3IBbzf/cpQTxfzVrLSQkfRiug5ylK9bCRAj0fyvvEEgDt/bRHaViF+N8vbN/O34AKoFmzn VkIMHX63ks069AetKkX2w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:ZNoHqiQkIxg=;l3oh9dauIvtmJ17VDph1G/LaRHL PvAUtog2ollrMoj5oyDStkUiyV1L0xXGBsENZcmBfG99Se9x4r9l9DoVW5sHLx96pMwC0PVU0 NUf/9OOHl+mdJHh5fe/D0CXYRagkmC20X0FTzV9he1kOgRUWdF2+NKAzm04Bfc0XovRICmrEk eMTYTzWT3vqE1N12qU9HOeXboUi6X5lvMvgzyThL6eKBx53keO5JbwihbLkMVrSrZLODMNfU1 QEal0C8y32gvIArDu+8yW11mFykMOHWUOn26a1dsevBmONuPC1zGGJgx2cWEL/c5ptWeF3GQB F1UyN6rzKrVjZciJ8Q/bw9EFTQetPqGZjmngyxBkmiz46jB9Egc8b4jD2QtzCBBbwN0WJ77FR kZmmCRL9FFsuwCWmtRsaLQzoPzo6xYdYeY2HFIYzhF9NV4J9fkRUM41gwHRXvqWME5YKdcfRU IeVjVZahozfJcVv8elrEAZTJNZ1xx9wsrF59bCl39dUmargqs6iEQzavL4hEP0IuhTaA2Z9w0 bOqbd6D9OhTa+R95zJ9B18wW656N35iQIZiGKnfGd/x1KoL2cbYAp1aQVo1LJtNsisli2ax1J 3YxC5jn5CTlsa0fGjSUPFdDPlCEdmbUZmxrEZ+avaWSMwSMgjCgsNBn7aZd8ArpHREPGyxEuT ONoJGe9YOfmbSoWeXEXs8VUx62NnPHOWOu4wwwtmSkQU+T6InzxQpqBmhOFdwTxvZJ/AHSbLP lWiYzj2QjE37FLCxuZ2+QGg9eABxD7ojA== X-Patchwork-Delegate: bpf@iogearbox.net This adds tests for both the happy path and the error path. Signed-off-by: Jordan Rome --- .../selftests/bpf/prog_tests/attach_probe.c | 8 +++-- .../selftests/bpf/prog_tests/read_vsyscall.c | 1 + .../selftests/bpf/progs/read_vsyscall.c | 9 ++++- .../selftests/bpf/progs/test_attach_probe.c | 33 +++++++++++++++++-- 4 files changed, 44 insertions(+), 7 deletions(-) -- 2.43.5 diff --git a/tools/testing/selftests/bpf/prog_tests/attach_probe.c b/tools/testing/selftests/bpf/prog_tests/attach_probe.c index 7175af39134f..329c7862b52d 100644 --- a/tools/testing/selftests/bpf/prog_tests/attach_probe.c +++ b/tools/testing/selftests/bpf/prog_tests/attach_probe.c @@ -283,9 +283,11 @@ static void test_uprobe_sleepable(struct test_attach_probe *skel) trigger_func3(); ASSERT_EQ(skel->bss->uprobe_byname3_sleepable_res, 9, "check_uprobe_byname3_sleepable_res"); - ASSERT_EQ(skel->bss->uprobe_byname3_res, 10, "check_uprobe_byname3_res"); - ASSERT_EQ(skel->bss->uretprobe_byname3_sleepable_res, 11, "check_uretprobe_byname3_sleepable_res"); - ASSERT_EQ(skel->bss->uretprobe_byname3_res, 12, "check_uretprobe_byname3_res"); + ASSERT_EQ(skel->bss->uprobe_byname3_str_sleepable_res, 10, "check_uprobe_byname3_str_sleepable_res"); + ASSERT_EQ(skel->bss->uprobe_byname3_res, 11, "check_uprobe_byname3_res"); + ASSERT_EQ(skel->bss->uretprobe_byname3_sleepable_res, 12, "check_uretprobe_byname3_sleepable_res"); + ASSERT_EQ(skel->bss->uretprobe_byname3_str_sleepable_res, 13, "check_uretprobe_byname3_str_sleepable_res"); + ASSERT_EQ(skel->bss->uretprobe_byname3_res, 14, "check_uretprobe_byname3_res"); } void test_attach_probe(void) diff --git a/tools/testing/selftests/bpf/prog_tests/read_vsyscall.c b/tools/testing/selftests/bpf/prog_tests/read_vsyscall.c index 3405923fe4e6..c7b9ba8b1d06 100644 --- a/tools/testing/selftests/bpf/prog_tests/read_vsyscall.c +++ b/tools/testing/selftests/bpf/prog_tests/read_vsyscall.c @@ -23,6 +23,7 @@ struct read_ret_desc { { .name = "probe_read_user_str", .ret = -EFAULT }, { .name = "copy_from_user", .ret = -EFAULT }, { .name = "copy_from_user_task", .ret = -EFAULT }, + { .name = "copy_from_user_str", .ret = -EFAULT }, }; void test_read_vsyscall(void) diff --git a/tools/testing/selftests/bpf/progs/read_vsyscall.c b/tools/testing/selftests/bpf/progs/read_vsyscall.c index 986f96687ae1..27de1e907754 100644 --- a/tools/testing/selftests/bpf/progs/read_vsyscall.c +++ b/tools/testing/selftests/bpf/progs/read_vsyscall.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2024. Huawei Technologies Co., Ltd */ +#include "vmlinux.h" #include #include @@ -7,10 +8,15 @@ int target_pid = 0; void *user_ptr = 0; -int read_ret[8]; +int read_ret[9]; char _license[] SEC("license") = "GPL"; +/* + * This is the only kfunc, the others are helpers + */ +int bpf_copy_from_user_str(void *dst, u32, const void *) __weak __ksym; + SEC("fentry/" SYS_PREFIX "sys_nanosleep") int do_probe_read(void *ctx) { @@ -40,6 +46,7 @@ int do_copy_from_user(void *ctx) read_ret[6] = bpf_copy_from_user(buf, sizeof(buf), user_ptr); read_ret[7] = bpf_copy_from_user_task(buf, sizeof(buf), user_ptr, bpf_get_current_task_btf(), 0); + read_ret[8] = bpf_copy_from_user_str((char *)buf, sizeof(buf), user_ptr); return 0; } diff --git a/tools/testing/selftests/bpf/progs/test_attach_probe.c b/tools/testing/selftests/bpf/progs/test_attach_probe.c index 68466a6ad18c..bf59a5280776 100644 --- a/tools/testing/selftests/bpf/progs/test_attach_probe.c +++ b/tools/testing/selftests/bpf/progs/test_attach_probe.c @@ -14,11 +14,15 @@ int uretprobe_byname_res = 0; int uprobe_byname2_res = 0; int uretprobe_byname2_res = 0; int uprobe_byname3_sleepable_res = 0; +int uprobe_byname3_str_sleepable_res = 0; int uprobe_byname3_res = 0; int uretprobe_byname3_sleepable_res = 0; +int uretprobe_byname3_str_sleepable_res = 0; int uretprobe_byname3_res = 0; void *user_ptr = 0; +int bpf_copy_from_user_str(void *dst, u32, const void *) __weak __ksym; + SEC("ksyscall/nanosleep") int BPF_KSYSCALL(handle_kprobe_auto, struct __kernel_timespec *req, struct __kernel_timespec *rem) { @@ -87,11 +91,32 @@ static __always_inline bool verify_sleepable_user_copy(void) return bpf_strncmp(data, sizeof(data), "test_data") == 0; } +static __always_inline bool verify_sleepable_user_copy_str(void) +{ + int ret; + char data_long[20]; + char data_short[4]; + + ret = bpf_copy_from_user_str(data_short, sizeof(data_short), user_ptr); + + if (bpf_strncmp(data_short, 4, "tes\0") != 0 || ret != 4) + return false; + + ret = bpf_copy_from_user_str(data_long, sizeof(data_long), user_ptr); + + if (bpf_strncmp(data_long, 10, "test_data\0") != 0 || ret != 10) + return false; + + return true; +} + SEC("uprobe.s//proc/self/exe:trigger_func3") int handle_uprobe_byname3_sleepable(struct pt_regs *ctx) { if (verify_sleepable_user_copy()) uprobe_byname3_sleepable_res = 9; + if (verify_sleepable_user_copy_str()) + uprobe_byname3_str_sleepable_res = 10; return 0; } @@ -102,7 +127,7 @@ int handle_uprobe_byname3_sleepable(struct pt_regs *ctx) SEC("uprobe//proc/self/exe:trigger_func3") int handle_uprobe_byname3(struct pt_regs *ctx) { - uprobe_byname3_res = 10; + uprobe_byname3_res = 11; return 0; } @@ -110,14 +135,16 @@ SEC("uretprobe.s//proc/self/exe:trigger_func3") int handle_uretprobe_byname3_sleepable(struct pt_regs *ctx) { if (verify_sleepable_user_copy()) - uretprobe_byname3_sleepable_res = 11; + uretprobe_byname3_sleepable_res = 12; + if (verify_sleepable_user_copy_str()) + uretprobe_byname3_str_sleepable_res = 13; return 0; } SEC("uretprobe//proc/self/exe:trigger_func3") int handle_uretprobe_byname3(struct pt_regs *ctx) { - uretprobe_byname3_res = 12; + uretprobe_byname3_res = 14; return 0; }