1 // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) 2 3 /* 4 * common eBPF ELF operations. 5 * 6 * Copyright (C) 2013-2015 Alexei Starovoitov <ast@kernel.org> 7 * Copyright (C) 2015 Wang Nan <wangnan0@huawei.com> 8 * Copyright (C) 2015 Huawei Inc. 9 * 10 * This program is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License as published by the Free Software Foundation; 13 * version 2.1 of the License (not later!) 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License for more details. 19 * 20 * You should have received a copy of the GNU Lesser General Public 21 * License along with this program; if not, see <http://www.gnu.org/licenses> 22 */ 23 24 #include <stdlib.h> 25 #include <string.h> 26 #include <memory.h> 27 #include <unistd.h> 28 #include <asm/unistd.h> 29 #include <linux/bpf.h> 30 #include "bpf.h" 31 #include "libbpf.h" 32 #include <errno.h> 33 34 /* 35 * When building perf, unistd.h is overridden. __NR_bpf is 36 * required to be defined explicitly. 37 */ 38 #ifndef __NR_bpf 39 # if defined(__i386__) 40 # define __NR_bpf 357 41 # elif defined(__x86_64__) 42 # define __NR_bpf 321 43 # elif defined(__aarch64__) 44 # define __NR_bpf 280 45 # elif defined(__sparc__) 46 # define __NR_bpf 349 47 # elif defined(__s390__) 48 # define __NR_bpf 351 49 # else 50 # error __NR_bpf not defined. libbpf does not support your arch. 51 # endif 52 #endif 53 54 #ifndef min 55 #define min(x, y) ((x) < (y) ? (x) : (y)) 56 #endif 57 58 static inline __u64 ptr_to_u64(const void *ptr) 59 { 60 return (__u64) (unsigned long) ptr; 61 } 62 63 static inline int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr, 64 unsigned int size) 65 { 66 return syscall(__NR_bpf, cmd, attr, size); 67 } 68 69 static inline int sys_bpf_prog_load(union bpf_attr *attr, unsigned int size) 70 { 71 int fd; 72 73 do { 74 fd = sys_bpf(BPF_PROG_LOAD, attr, size); 75 } while (fd < 0 && errno == EAGAIN); 76 77 return fd; 78 } 79 80 int bpf_create_map_xattr(const struct bpf_create_map_attr *create_attr) 81 { 82 __u32 name_len = create_attr->name ? strlen(create_attr->name) : 0; 83 union bpf_attr attr; 84 85 memset(&attr, '\0', sizeof(attr)); 86 87 attr.map_type = create_attr->map_type; 88 attr.key_size = create_attr->key_size; 89 attr.value_size = create_attr->value_size; 90 attr.max_entries = create_attr->max_entries; 91 attr.map_flags = create_attr->map_flags; 92 memcpy(attr.map_name, create_attr->name, 93 min(name_len, BPF_OBJ_NAME_LEN - 1)); 94 attr.numa_node = create_attr->numa_node; 95 attr.btf_fd = create_attr->btf_fd; 96 attr.btf_key_type_id = create_attr->btf_key_type_id; 97 attr.btf_value_type_id = create_attr->btf_value_type_id; 98 attr.map_ifindex = create_attr->map_ifindex; 99 attr.inner_map_fd = create_attr->inner_map_fd; 100 101 return sys_bpf(BPF_MAP_CREATE, &attr, sizeof(attr)); 102 } 103 104 int bpf_create_map_node(enum bpf_map_type map_type, const char *name, 105 int key_size, int value_size, int max_entries, 106 __u32 map_flags, int node) 107 { 108 struct bpf_create_map_attr map_attr = {}; 109 110 map_attr.name = name; 111 map_attr.map_type = map_type; 112 map_attr.map_flags = map_flags; 113 map_attr.key_size = key_size; 114 map_attr.value_size = value_size; 115 map_attr.max_entries = max_entries; 116 if (node >= 0) { 117 map_attr.numa_node = node; 118 map_attr.map_flags |= BPF_F_NUMA_NODE; 119 } 120 121 return bpf_create_map_xattr(&map_attr); 122 } 123 124 int bpf_create_map(enum bpf_map_type map_type, int key_size, 125 int value_size, int max_entries, __u32 map_flags) 126 { 127 struct bpf_create_map_attr map_attr = {}; 128 129 map_attr.map_type = map_type; 130 map_attr.map_flags = map_flags; 131 map_attr.key_size = key_size; 132 map_attr.value_size = value_size; 133 map_attr.max_entries = max_entries; 134 135 return bpf_create_map_xattr(&map_attr); 136 } 137 138 int bpf_create_map_name(enum bpf_map_type map_type, const char *name, 139 int key_size, int value_size, int max_entries, 140 __u32 map_flags) 141 { 142 struct bpf_create_map_attr map_attr = {}; 143 144 map_attr.name = name; 145 map_attr.map_type = map_type; 146 map_attr.map_flags = map_flags; 147 map_attr.key_size = key_size; 148 map_attr.value_size = value_size; 149 map_attr.max_entries = max_entries; 150 151 return bpf_create_map_xattr(&map_attr); 152 } 153 154 int bpf_create_map_in_map_node(enum bpf_map_type map_type, const char *name, 155 int key_size, int inner_map_fd, int max_entries, 156 __u32 map_flags, int node) 157 { 158 __u32 name_len = name ? strlen(name) : 0; 159 union bpf_attr attr; 160 161 memset(&attr, '\0', sizeof(attr)); 162 163 attr.map_type = map_type; 164 attr.key_size = key_size; 165 attr.value_size = 4; 166 attr.inner_map_fd = inner_map_fd; 167 attr.max_entries = max_entries; 168 attr.map_flags = map_flags; 169 memcpy(attr.map_name, name, min(name_len, BPF_OBJ_NAME_LEN - 1)); 170 171 if (node >= 0) { 172 attr.map_flags |= BPF_F_NUMA_NODE; 173 attr.numa_node = node; 174 } 175 176 return sys_bpf(BPF_MAP_CREATE, &attr, sizeof(attr)); 177 } 178 179 int bpf_create_map_in_map(enum bpf_map_type map_type, const char *name, 180 int key_size, int inner_map_fd, int max_entries, 181 __u32 map_flags) 182 { 183 return bpf_create_map_in_map_node(map_type, name, key_size, 184 inner_map_fd, max_entries, map_flags, 185 -1); 186 } 187 188 static void * 189 alloc_zero_tailing_info(const void *orecord, __u32 cnt, 190 __u32 actual_rec_size, __u32 expected_rec_size) 191 { 192 __u64 info_len = actual_rec_size * cnt; 193 void *info, *nrecord; 194 int i; 195 196 info = malloc(info_len); 197 if (!info) 198 return NULL; 199 200 /* zero out bytes kernel does not understand */ 201 nrecord = info; 202 for (i = 0; i < cnt; i++) { 203 memcpy(nrecord, orecord, expected_rec_size); 204 memset(nrecord + expected_rec_size, 0, 205 actual_rec_size - expected_rec_size); 206 orecord += actual_rec_size; 207 nrecord += actual_rec_size; 208 } 209 210 return info; 211 } 212 213 int bpf_load_program_xattr(const struct bpf_load_program_attr *load_attr, 214 char *log_buf, size_t log_buf_sz) 215 { 216 void *finfo = NULL, *linfo = NULL; 217 union bpf_attr attr; 218 __u32 log_level; 219 __u32 name_len; 220 int fd; 221 222 if (!load_attr || !log_buf != !log_buf_sz) 223 return -EINVAL; 224 225 log_level = load_attr->log_level; 226 if (log_level > 2 || (log_level && !log_buf)) 227 return -EINVAL; 228 229 name_len = load_attr->name ? strlen(load_attr->name) : 0; 230 231 memset(&attr, 0, sizeof(attr)); 232 attr.prog_type = load_attr->prog_type; 233 attr.expected_attach_type = load_attr->expected_attach_type; 234 attr.insn_cnt = (__u32)load_attr->insns_cnt; 235 attr.insns = ptr_to_u64(load_attr->insns); 236 attr.license = ptr_to_u64(load_attr->license); 237 238 attr.log_level = log_level; 239 if (log_level) { 240 attr.log_buf = ptr_to_u64(log_buf); 241 attr.log_size = log_buf_sz; 242 } else { 243 attr.log_buf = ptr_to_u64(NULL); 244 attr.log_size = 0; 245 } 246 247 attr.kern_version = load_attr->kern_version; 248 attr.prog_ifindex = load_attr->prog_ifindex; 249 attr.prog_btf_fd = load_attr->prog_btf_fd; 250 attr.func_info_rec_size = load_attr->func_info_rec_size; 251 attr.func_info_cnt = load_attr->func_info_cnt; 252 attr.func_info = ptr_to_u64(load_attr->func_info); 253 attr.line_info_rec_size = load_attr->line_info_rec_size; 254 attr.line_info_cnt = load_attr->line_info_cnt; 255 attr.line_info = ptr_to_u64(load_attr->line_info); 256 memcpy(attr.prog_name, load_attr->name, 257 min(name_len, BPF_OBJ_NAME_LEN - 1)); 258 259 fd = sys_bpf_prog_load(&attr, sizeof(attr)); 260 if (fd >= 0) 261 return fd; 262 263 /* After bpf_prog_load, the kernel may modify certain attributes 264 * to give user space a hint how to deal with loading failure. 265 * Check to see whether we can make some changes and load again. 266 */ 267 while (errno == E2BIG && (!finfo || !linfo)) { 268 if (!finfo && attr.func_info_cnt && 269 attr.func_info_rec_size < load_attr->func_info_rec_size) { 270 /* try with corrected func info records */ 271 finfo = alloc_zero_tailing_info(load_attr->func_info, 272 load_attr->func_info_cnt, 273 load_attr->func_info_rec_size, 274 attr.func_info_rec_size); 275 if (!finfo) 276 goto done; 277 278 attr.func_info = ptr_to_u64(finfo); 279 attr.func_info_rec_size = load_attr->func_info_rec_size; 280 } else if (!linfo && attr.line_info_cnt && 281 attr.line_info_rec_size < 282 load_attr->line_info_rec_size) { 283 linfo = alloc_zero_tailing_info(load_attr->line_info, 284 load_attr->line_info_cnt, 285 load_attr->line_info_rec_size, 286 attr.line_info_rec_size); 287 if (!linfo) 288 goto done; 289 290 attr.line_info = ptr_to_u64(linfo); 291 attr.line_info_rec_size = load_attr->line_info_rec_size; 292 } else { 293 break; 294 } 295 296 fd = sys_bpf_prog_load(&attr, sizeof(attr)); 297 298 if (fd >= 0) 299 goto done; 300 } 301 302 if (log_level || !log_buf) 303 goto done; 304 305 /* Try again with log */ 306 attr.log_buf = ptr_to_u64(log_buf); 307 attr.log_size = log_buf_sz; 308 attr.log_level = 1; 309 log_buf[0] = 0; 310 fd = sys_bpf_prog_load(&attr, sizeof(attr)); 311 done: 312 free(finfo); 313 free(linfo); 314 return fd; 315 } 316 317 int bpf_load_program(enum bpf_prog_type type, const struct bpf_insn *insns, 318 size_t insns_cnt, const char *license, 319 __u32 kern_version, char *log_buf, 320 size_t log_buf_sz) 321 { 322 struct bpf_load_program_attr load_attr; 323 324 memset(&load_attr, 0, sizeof(struct bpf_load_program_attr)); 325 load_attr.prog_type = type; 326 load_attr.expected_attach_type = 0; 327 load_attr.name = NULL; 328 load_attr.insns = insns; 329 load_attr.insns_cnt = insns_cnt; 330 load_attr.license = license; 331 load_attr.kern_version = kern_version; 332 333 return bpf_load_program_xattr(&load_attr, log_buf, log_buf_sz); 334 } 335 336 int bpf_verify_program(enum bpf_prog_type type, const struct bpf_insn *insns, 337 size_t insns_cnt, __u32 prog_flags, const char *license, 338 __u32 kern_version, char *log_buf, size_t log_buf_sz, 339 int log_level) 340 { 341 union bpf_attr attr; 342 343 memset(&attr, 0, sizeof(attr)); 344 attr.prog_type = type; 345 attr.insn_cnt = (__u32)insns_cnt; 346 attr.insns = ptr_to_u64(insns); 347 attr.license = ptr_to_u64(license); 348 attr.log_buf = ptr_to_u64(log_buf); 349 attr.log_size = log_buf_sz; 350 attr.log_level = log_level; 351 log_buf[0] = 0; 352 attr.kern_version = kern_version; 353 attr.prog_flags = prog_flags; 354 355 return sys_bpf_prog_load(&attr, sizeof(attr)); 356 } 357 358 int bpf_map_update_elem(int fd, const void *key, const void *value, 359 __u64 flags) 360 { 361 union bpf_attr attr; 362 363 memset(&attr, 0, sizeof(attr)); 364 attr.map_fd = fd; 365 attr.key = ptr_to_u64(key); 366 attr.value = ptr_to_u64(value); 367 attr.flags = flags; 368 369 return sys_bpf(BPF_MAP_UPDATE_ELEM, &attr, sizeof(attr)); 370 } 371 372 int bpf_map_lookup_elem(int fd, const void *key, void *value) 373 { 374 union bpf_attr attr; 375 376 memset(&attr, 0, sizeof(attr)); 377 attr.map_fd = fd; 378 attr.key = ptr_to_u64(key); 379 attr.value = ptr_to_u64(value); 380 381 return sys_bpf(BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr)); 382 } 383 384 int bpf_map_lookup_elem_flags(int fd, const void *key, void *value, __u64 flags) 385 { 386 union bpf_attr attr; 387 388 memset(&attr, 0, sizeof(attr)); 389 attr.map_fd = fd; 390 attr.key = ptr_to_u64(key); 391 attr.value = ptr_to_u64(value); 392 attr.flags = flags; 393 394 return sys_bpf(BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr)); 395 } 396 397 int bpf_map_lookup_and_delete_elem(int fd, const void *key, void *value) 398 { 399 union bpf_attr attr; 400 401 memset(&attr, 0, sizeof(attr)); 402 attr.map_fd = fd; 403 attr.key = ptr_to_u64(key); 404 attr.value = ptr_to_u64(value); 405 406 return sys_bpf(BPF_MAP_LOOKUP_AND_DELETE_ELEM, &attr, sizeof(attr)); 407 } 408 409 int bpf_map_delete_elem(int fd, const void *key) 410 { 411 union bpf_attr attr; 412 413 memset(&attr, 0, sizeof(attr)); 414 attr.map_fd = fd; 415 attr.key = ptr_to_u64(key); 416 417 return sys_bpf(BPF_MAP_DELETE_ELEM, &attr, sizeof(attr)); 418 } 419 420 int bpf_map_get_next_key(int fd, const void *key, void *next_key) 421 { 422 union bpf_attr attr; 423 424 memset(&attr, 0, sizeof(attr)); 425 attr.map_fd = fd; 426 attr.key = ptr_to_u64(key); 427 attr.next_key = ptr_to_u64(next_key); 428 429 return sys_bpf(BPF_MAP_GET_NEXT_KEY, &attr, sizeof(attr)); 430 } 431 432 int bpf_obj_pin(int fd, const char *pathname) 433 { 434 union bpf_attr attr; 435 436 memset(&attr, 0, sizeof(attr)); 437 attr.pathname = ptr_to_u64((void *)pathname); 438 attr.bpf_fd = fd; 439 440 return sys_bpf(BPF_OBJ_PIN, &attr, sizeof(attr)); 441 } 442 443 int bpf_obj_get(const char *pathname) 444 { 445 union bpf_attr attr; 446 447 memset(&attr, 0, sizeof(attr)); 448 attr.pathname = ptr_to_u64((void *)pathname); 449 450 return sys_bpf(BPF_OBJ_GET, &attr, sizeof(attr)); 451 } 452 453 int bpf_prog_attach(int prog_fd, int target_fd, enum bpf_attach_type type, 454 unsigned int flags) 455 { 456 union bpf_attr attr; 457 458 memset(&attr, 0, sizeof(attr)); 459 attr.target_fd = target_fd; 460 attr.attach_bpf_fd = prog_fd; 461 attr.attach_type = type; 462 attr.attach_flags = flags; 463 464 return sys_bpf(BPF_PROG_ATTACH, &attr, sizeof(attr)); 465 } 466 467 int bpf_prog_detach(int target_fd, enum bpf_attach_type type) 468 { 469 union bpf_attr attr; 470 471 memset(&attr, 0, sizeof(attr)); 472 attr.target_fd = target_fd; 473 attr.attach_type = type; 474 475 return sys_bpf(BPF_PROG_DETACH, &attr, sizeof(attr)); 476 } 477 478 int bpf_prog_detach2(int prog_fd, int target_fd, enum bpf_attach_type type) 479 { 480 union bpf_attr attr; 481 482 memset(&attr, 0, sizeof(attr)); 483 attr.target_fd = target_fd; 484 attr.attach_bpf_fd = prog_fd; 485 attr.attach_type = type; 486 487 return sys_bpf(BPF_PROG_DETACH, &attr, sizeof(attr)); 488 } 489 490 int bpf_prog_query(int target_fd, enum bpf_attach_type type, __u32 query_flags, 491 __u32 *attach_flags, __u32 *prog_ids, __u32 *prog_cnt) 492 { 493 union bpf_attr attr; 494 int ret; 495 496 memset(&attr, 0, sizeof(attr)); 497 attr.query.target_fd = target_fd; 498 attr.query.attach_type = type; 499 attr.query.query_flags = query_flags; 500 attr.query.prog_cnt = *prog_cnt; 501 attr.query.prog_ids = ptr_to_u64(prog_ids); 502 503 ret = sys_bpf(BPF_PROG_QUERY, &attr, sizeof(attr)); 504 if (attach_flags) 505 *attach_flags = attr.query.attach_flags; 506 *prog_cnt = attr.query.prog_cnt; 507 return ret; 508 } 509 510 int bpf_prog_test_run(int prog_fd, int repeat, void *data, __u32 size, 511 void *data_out, __u32 *size_out, __u32 *retval, 512 __u32 *duration) 513 { 514 union bpf_attr attr; 515 int ret; 516 517 memset(&attr, 0, sizeof(attr)); 518 attr.test.prog_fd = prog_fd; 519 attr.test.data_in = ptr_to_u64(data); 520 attr.test.data_out = ptr_to_u64(data_out); 521 attr.test.data_size_in = size; 522 attr.test.repeat = repeat; 523 524 ret = sys_bpf(BPF_PROG_TEST_RUN, &attr, sizeof(attr)); 525 if (size_out) 526 *size_out = attr.test.data_size_out; 527 if (retval) 528 *retval = attr.test.retval; 529 if (duration) 530 *duration = attr.test.duration; 531 return ret; 532 } 533 534 int bpf_prog_test_run_xattr(struct bpf_prog_test_run_attr *test_attr) 535 { 536 union bpf_attr attr; 537 int ret; 538 539 if (!test_attr->data_out && test_attr->data_size_out > 0) 540 return -EINVAL; 541 542 memset(&attr, 0, sizeof(attr)); 543 attr.test.prog_fd = test_attr->prog_fd; 544 attr.test.data_in = ptr_to_u64(test_attr->data_in); 545 attr.test.data_out = ptr_to_u64(test_attr->data_out); 546 attr.test.data_size_in = test_attr->data_size_in; 547 attr.test.data_size_out = test_attr->data_size_out; 548 attr.test.repeat = test_attr->repeat; 549 550 ret = sys_bpf(BPF_PROG_TEST_RUN, &attr, sizeof(attr)); 551 test_attr->data_size_out = attr.test.data_size_out; 552 test_attr->retval = attr.test.retval; 553 test_attr->duration = attr.test.duration; 554 return ret; 555 } 556 557 int bpf_prog_get_next_id(__u32 start_id, __u32 *next_id) 558 { 559 union bpf_attr attr; 560 int err; 561 562 memset(&attr, 0, sizeof(attr)); 563 attr.start_id = start_id; 564 565 err = sys_bpf(BPF_PROG_GET_NEXT_ID, &attr, sizeof(attr)); 566 if (!err) 567 *next_id = attr.next_id; 568 569 return err; 570 } 571 572 int bpf_map_get_next_id(__u32 start_id, __u32 *next_id) 573 { 574 union bpf_attr attr; 575 int err; 576 577 memset(&attr, 0, sizeof(attr)); 578 attr.start_id = start_id; 579 580 err = sys_bpf(BPF_MAP_GET_NEXT_ID, &attr, sizeof(attr)); 581 if (!err) 582 *next_id = attr.next_id; 583 584 return err; 585 } 586 587 int bpf_prog_get_fd_by_id(__u32 id) 588 { 589 union bpf_attr attr; 590 591 memset(&attr, 0, sizeof(attr)); 592 attr.prog_id = id; 593 594 return sys_bpf(BPF_PROG_GET_FD_BY_ID, &attr, sizeof(attr)); 595 } 596 597 int bpf_map_get_fd_by_id(__u32 id) 598 { 599 union bpf_attr attr; 600 601 memset(&attr, 0, sizeof(attr)); 602 attr.map_id = id; 603 604 return sys_bpf(BPF_MAP_GET_FD_BY_ID, &attr, sizeof(attr)); 605 } 606 607 int bpf_btf_get_fd_by_id(__u32 id) 608 { 609 union bpf_attr attr; 610 611 memset(&attr, 0, sizeof(attr)); 612 attr.btf_id = id; 613 614 return sys_bpf(BPF_BTF_GET_FD_BY_ID, &attr, sizeof(attr)); 615 } 616 617 int bpf_obj_get_info_by_fd(int prog_fd, void *info, __u32 *info_len) 618 { 619 union bpf_attr attr; 620 int err; 621 622 memset(&attr, 0, sizeof(attr)); 623 attr.info.bpf_fd = prog_fd; 624 attr.info.info_len = *info_len; 625 attr.info.info = ptr_to_u64(info); 626 627 err = sys_bpf(BPF_OBJ_GET_INFO_BY_FD, &attr, sizeof(attr)); 628 if (!err) 629 *info_len = attr.info.info_len; 630 631 return err; 632 } 633 634 int bpf_raw_tracepoint_open(const char *name, int prog_fd) 635 { 636 union bpf_attr attr; 637 638 memset(&attr, 0, sizeof(attr)); 639 attr.raw_tracepoint.name = ptr_to_u64(name); 640 attr.raw_tracepoint.prog_fd = prog_fd; 641 642 return sys_bpf(BPF_RAW_TRACEPOINT_OPEN, &attr, sizeof(attr)); 643 } 644 645 int bpf_load_btf(void *btf, __u32 btf_size, char *log_buf, __u32 log_buf_size, 646 bool do_log) 647 { 648 union bpf_attr attr = {}; 649 int fd; 650 651 attr.btf = ptr_to_u64(btf); 652 attr.btf_size = btf_size; 653 654 retry: 655 if (do_log && log_buf && log_buf_size) { 656 attr.btf_log_level = 1; 657 attr.btf_log_size = log_buf_size; 658 attr.btf_log_buf = ptr_to_u64(log_buf); 659 } 660 661 fd = sys_bpf(BPF_BTF_LOAD, &attr, sizeof(attr)); 662 if (fd == -1 && !do_log && log_buf && log_buf_size) { 663 do_log = true; 664 goto retry; 665 } 666 667 return fd; 668 } 669 670 int bpf_task_fd_query(int pid, int fd, __u32 flags, char *buf, __u32 *buf_len, 671 __u32 *prog_id, __u32 *fd_type, __u64 *probe_offset, 672 __u64 *probe_addr) 673 { 674 union bpf_attr attr = {}; 675 int err; 676 677 attr.task_fd_query.pid = pid; 678 attr.task_fd_query.fd = fd; 679 attr.task_fd_query.flags = flags; 680 attr.task_fd_query.buf = ptr_to_u64(buf); 681 attr.task_fd_query.buf_len = *buf_len; 682 683 err = sys_bpf(BPF_TASK_FD_QUERY, &attr, sizeof(attr)); 684 *buf_len = attr.task_fd_query.buf_len; 685 *prog_id = attr.task_fd_query.prog_id; 686 *fd_type = attr.task_fd_query.fd_type; 687 *probe_offset = attr.task_fd_query.probe_offset; 688 *probe_addr = attr.task_fd_query.probe_addr; 689 690 return err; 691 } 692