From: kernel test robot <lkp@intel.com>
To: Mikhail Ivanov <ivanov.mikhail1@huawei-partners.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH v2 3/8] landlock: Fix inconsistency of errors for TCP actions
Date: Sun, 20 Oct 2024 23:45:02 +0800 [thread overview]
Message-ID: <202410202353.RF5ZJUXV-lkp@intel.com> (raw)
In-Reply-To: <20241017110454.265818-4-ivanov.mikhail1@huawei-partners.com>
Hi Mikhail,
[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:
[auto build test WARNING on fe76bd133024aaef12d12a7d58fa3e8d138d3bf3]
url: https://github.com/intel-lab-lkp/linux/commits/Mikhail-Ivanov/landlock-Fix-non-TCP-sockets-restriction/20241017-190842
base: fe76bd133024aaef12d12a7d58fa3e8d138d3bf3
patch link: https://lore.kernel.org/r/20241017110454.265818-4-ivanov.mikhail1%40huawei-partners.com
patch subject: [RFC PATCH v2 3/8] landlock: Fix inconsistency of errors for TCP actions
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20241020/202410202353.RF5ZJUXV-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241020/202410202353.RF5ZJUXV-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/202410202353.RF5ZJUXV-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> security/landlock/net.c:94:3: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
94 | const struct sockaddr_in *const addr =
| ^
1 warning generated.
vim +94 security/landlock/net.c
72
73 /*
74 * Checks that TCP @sock and @address attributes are correct for bind(2).
75 *
76 * On success, extracts port from @address in @port and returns 0.
77 *
78 * This validation is consistent with network stack and returns the error
79 * in the order corresponding to the order of errors from the network stack.
80 * It's required to not wrongfully return -EACCES instead of meaningful network
81 * stack level errors. Consistency is tested with kselftest.
82 *
83 * This helper does not provide consistency of error codes for BPF filter
84 * (if any).
85 */
86 static int
87 check_tcp_bind_consistency_and_get_port(struct socket *const sock,
88 struct sockaddr *const address,
89 const int addrlen, __be16 *port)
90 {
91 /* IPV6_ADDRFORM can change sk->sk_family under us. */
92 switch (READ_ONCE(sock->sk->sk_family)) {
93 case AF_INET:
> 94 const struct sockaddr_in *const addr =
95 (struct sockaddr_in *)address;
96
97 /* Cf. inet_bind_sk(). */
98 if (addrlen < sizeof(struct sockaddr_in))
99 return -EINVAL;
100 /*
101 * For compatibility reason, accept AF_UNSPEC for bind
102 * accesses (mapped to AF_INET) only if the address is
103 * INADDR_ANY (cf. __inet_bind).
104 */
105 if (addr->sin_family != AF_INET) {
106 if (addr->sin_family != AF_UNSPEC ||
107 addr->sin_addr.s_addr != htonl(INADDR_ANY))
108 return -EAFNOSUPPORT;
109 }
110 *port = ((struct sockaddr_in *)address)->sin_port;
111 break;
112 #if IS_ENABLED(CONFIG_IPV6)
113 case AF_INET6:
114 /* Cf. inet6_bind_sk(). */
115 if (addrlen < SIN6_LEN_RFC2133)
116 return -EINVAL;
117 /* Cf. __inet6_bind(). */
118 if (address->sa_family != AF_INET6)
119 return -EAFNOSUPPORT;
120 *port = ((struct sockaddr_in6 *)address)->sin6_port;
121 break;
122 #endif /* IS_ENABLED(CONFIG_IPV6) */
123 default:
124 WARN_ON_ONCE(0);
125 return -EACCES;
126 }
127 return 0;
128 }
129
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-10-20 15:45 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-17 11:04 [RFC PATCH v2 0/8] Fix non-TCP restriction and inconsistency of TCP errors Mikhail Ivanov
2024-10-17 11:04 ` [RFC PATCH v2 1/8] landlock: Fix non-TCP sockets restriction Mikhail Ivanov
2024-10-17 12:59 ` Matthieu Baerts
2024-10-18 18:08 ` Mickaël Salaün
2024-10-31 16:21 ` Mikhail Ivanov
2024-11-08 17:16 ` David Laight
2024-12-04 19:29 ` Mickaël Salaün
2024-12-12 18:43 ` Mickaël Salaün
2024-12-13 18:19 ` Mikhail Ivanov
2025-01-24 15:02 ` Mickaël Salaün
2025-01-27 12:40 ` Mikhail Ivanov
2025-01-27 19:48 ` Mickaël Salaün
2025-01-28 10:56 ` Mikhail Ivanov
2025-01-28 18:14 ` Matthieu Baerts
2025-01-29 9:52 ` Mikhail Ivanov
2025-01-29 10:25 ` Matthieu Baerts
2025-01-29 11:02 ` Mikhail Ivanov
2025-01-29 11:33 ` Matthieu Baerts
2025-01-29 11:47 ` Mikhail Ivanov
2025-01-29 11:57 ` Matthieu Baerts
2025-01-29 14:51 ` Mickaël Salaün
2025-01-29 15:44 ` Matthieu Baerts
2025-01-30 9:51 ` Mickaël Salaün
2025-01-30 10:18 ` Matthieu Baerts
2025-01-31 11:04 ` Mikhail Ivanov
2024-12-04 19:27 ` Mickaël Salaün
2024-12-04 19:35 ` Mickaël Salaün
2024-12-09 10:19 ` Mikhail Ivanov
2024-12-10 18:04 ` Mickaël Salaün
2024-12-10 18:05 ` Mickaël Salaün
2024-12-11 15:24 ` Mikhail Ivanov
2024-12-12 18:43 ` Mickaël Salaün
2024-12-13 11:42 ` Mikhail Ivanov
2024-12-04 19:30 ` Mickaël Salaün
2024-12-09 10:19 ` Mikhail Ivanov
2024-10-17 11:04 ` [RFC PATCH v2 2/8] landlock: Make network stack layer checks explicit for each TCP action Mikhail Ivanov
2024-10-17 11:04 ` [RFC PATCH v2 3/8] landlock: Fix inconsistency of errors for TCP actions Mikhail Ivanov
2024-10-17 11:34 ` Mikhail Ivanov
2024-10-17 12:48 ` Tetsuo Handa
2024-11-06 9:27 ` Mikhail Ivanov
2024-10-20 15:45 ` kernel test robot [this message]
2024-12-04 19:32 ` Mickaël Salaün
2024-10-17 11:04 ` [RFC PATCH v2 4/8] selftests/landlock: Test TCP accesses with protocol=IPPROTO_TCP Mikhail Ivanov
2024-10-17 11:04 ` [RFC PATCH v2 5/8] selftests/landlock: Test that MPTCP actions are not restricted Mikhail Ivanov
2024-10-17 11:04 ` [RFC PATCH v2 6/8] selftests/landlock: Test consistency of errors for TCP actions Mikhail Ivanov
2024-12-10 18:07 ` Mickaël Salaün
2024-12-11 15:29 ` Mikhail Ivanov
2024-10-17 11:04 ` [RFC PATCH v2 7/8] landlock: Add note about errors consistency in documentation Mikhail Ivanov
2024-12-10 18:08 ` Mickaël Salaün
2024-12-11 15:30 ` Mikhail Ivanov
2024-10-17 11:04 ` [RFC PATCH v2 8/8] selftests/landlock: Test that SCTP actions are not restricted Mikhail Ivanov
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=202410202353.RF5ZJUXV-lkp@intel.com \
--to=lkp@intel.com \
--cc=ivanov.mikhail1@huawei-partners.com \
--cc=llvm@lists.linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.