From: kernel test robot <lkp@intel.com>
To: Daan De Meyer <daan.j.demeyer@gmail.com>, bpf@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev,
Daan De Meyer <daan.j.demeyer@gmail.com>,
martin.lau@linux.dev, kernel-team@meta.com,
netdev@vger.kernel.org
Subject: Re: [PATCH bpf-next v7 2/9] bpf: Propagate modified uaddrlen from cgroup sockaddr programs
Date: Mon, 2 Oct 2023 21:57:37 +0800 [thread overview]
Message-ID: <202310022113.1H3kTKXX-lkp@intel.com> (raw)
In-Reply-To: <20231002122756.323591-3-daan.j.demeyer@gmail.com>
Hi Daan,
kernel test robot noticed the following build warnings:
[auto build test WARNING on bpf-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Daan-De-Meyer/selftests-bpf-Add-missing-section-name-tests-for-getpeername-getsockname/20231002-203646
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20231002122756.323591-3-daan.j.demeyer%40gmail.com
patch subject: [PATCH bpf-next v7 2/9] bpf: Propagate modified uaddrlen from cgroup sockaddr programs
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20231002/202310022113.1H3kTKXX-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231002/202310022113.1H3kTKXX-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310022113.1H3kTKXX-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> kernel/bpf/cgroup.c:1454: warning: bad line: read-only for AF_INET[6] uaddr but can be modified for AF_UNIX
>> kernel/bpf/cgroup.c:1455: warning: bad line: uaddr.
vim +1454 kernel/bpf/cgroup.c
1447
1448 /**
1449 * __cgroup_bpf_run_filter_sock_addr() - Run a program on a sock and
1450 * provided by user sockaddr
1451 * @sk: sock struct that will use sockaddr
1452 * @uaddr: sockaddr struct provided by user
1453 * @uaddrlen: Pointer to the size of the sockaddr struct provided by user. It is
> 1454 read-only for AF_INET[6] uaddr but can be modified for AF_UNIX
> 1455 uaddr.
1456 * @atype: The type of program to be executed
1457 * @t_ctx: Pointer to attach type specific context
1458 * @flags: Pointer to u32 which contains higher bits of BPF program
1459 * return value (OR'ed together).
1460 *
1461 * socket is expected to be of type INET or INET6.
1462 *
1463 * This function will return %-EPERM if an attached program is found and
1464 * returned value != 1 during execution. In all other cases, 0 is returned.
1465 */
1466 int __cgroup_bpf_run_filter_sock_addr(struct sock *sk,
1467 struct sockaddr *uaddr,
1468 int *uaddrlen,
1469 enum cgroup_bpf_attach_type atype,
1470 void *t_ctx,
1471 u32 *flags)
1472 {
1473 struct bpf_sock_addr_kern ctx = {
1474 .sk = sk,
1475 .uaddr = uaddr,
1476 .t_ctx = t_ctx,
1477 };
1478 struct sockaddr_storage unspec;
1479 struct cgroup *cgrp;
1480 int ret;
1481
1482 /* Check socket family since not all sockets represent network
1483 * endpoint (e.g. AF_UNIX).
1484 */
1485 if (sk->sk_family != AF_INET && sk->sk_family != AF_INET6)
1486 return 0;
1487
1488 if (!ctx.uaddr) {
1489 memset(&unspec, 0, sizeof(unspec));
1490 ctx.uaddr = (struct sockaddr *)&unspec;
1491 ctx.uaddrlen = 0;
1492 } else if (uaddrlen)
1493 ctx.uaddrlen = *uaddrlen;
1494 else
1495 return -EINVAL;
1496
1497 cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
1498 ret = bpf_prog_run_array_cg(&cgrp->bpf, atype, &ctx, bpf_prog_run,
1499 0, flags);
1500
1501 if (!ret && uaddrlen)
1502 *uaddrlen = ctx.uaddrlen;
1503
1504 return ret;
1505 }
1506 EXPORT_SYMBOL(__cgroup_bpf_run_filter_sock_addr);
1507
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2023-10-02 13:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-02 12:27 [PATCH bpf-next v7 0/9] Add cgroup sockaddr hooks for unix sockets Daan De Meyer
2023-10-02 12:27 ` [PATCH bpf-next v7 1/9] selftests/bpf: Add missing section name tests for getpeername/getsockname Daan De Meyer
2023-10-02 12:27 ` [PATCH bpf-next v7 2/9] bpf: Propagate modified uaddrlen from cgroup sockaddr programs Daan De Meyer
2023-10-02 13:57 ` kernel test robot [this message]
2023-10-02 12:27 ` [PATCH bpf-next v7 3/9] bpf: Add bpf_sock_addr_set_unix_addr() to allow writing unix sockaddr from bpf Daan De Meyer
2023-10-02 12:27 ` [PATCH bpf-next v7 4/9] bpf: Implement cgroup sockaddr hooks for unix sockets Daan De Meyer
2023-10-02 12:27 ` [PATCH bpf-next v7 5/9] libbpf: Add support for cgroup unix socket address hooks Daan De Meyer
2023-10-02 20:57 ` Andrii Nakryiko
2023-10-02 12:27 ` [PATCH bpf-next v7 6/9] bpftool: " Daan De Meyer
2023-10-02 13:10 ` Quentin Monnet
2023-10-02 12:27 ` [PATCH bpf-next v7 7/9] documentation/bpf: Document " Daan De Meyer
2023-10-02 12:27 ` [PATCH bpf-next v7 8/9] selftests/bpf: Make sure mount directory exists Daan De Meyer
2023-10-02 12:27 ` [PATCH bpf-next v7 9/9] selftests/bpf: Add tests for cgroup unix socket address hooks Daan De Meyer
-- strict thread matches above, loose matches on Subject: below --
2023-10-03 9:30 [PATCH bpf-next v8 0/9] Add cgroup sockaddr hooks for unix sockets Daan De Meyer
2023-10-03 9:30 ` [PATCH bpf-next v7 2/9] bpf: Propagate modified uaddrlen from cgroup sockaddr programs Daan De Meyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202310022113.1H3kTKXX-lkp@intel.com \
--to=lkp@intel.com \
--cc=bpf@vger.kernel.org \
--cc=daan.j.demeyer@gmail.com \
--cc=kernel-team@meta.com \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox