[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202507041803.6bndMcXn-lkp@intel.com>
Date: Fri, 4 Jul 2025 19:01:46 +0800
From: kernel test robot <lkp@...el.com>
To: Matt Johnston <matt@...econstruct.com.au>,
Jeremy Kerr <jk@...econstruct.com.au>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>
Cc: oe-kbuild-all@...ts.linux.dev, netdev@...r.kernel.org,
Matt Johnston <matt@...econstruct.com.au>
Subject: Re: [PATCH net-next 6/7] net: mctp: Test conflicts of connect() with
bind()
Hi Matt,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 8b98f34ce1d8c520403362cb785231f9898eb3ff]
url: https://github.com/intel-lab-lkp/linux/commits/Matt-Johnston/net-mctp-Prevent-duplicate-binds/20250703-171427
base: 8b98f34ce1d8c520403362cb785231f9898eb3ff
patch link: https://lore.kernel.org/r/20250703-mctp-bind-v1-6-bb7e97c24613%40codeconstruct.com.au
patch subject: [PATCH net-next 6/7] net: mctp: Test conflicts of connect() with bind()
config: loongarch-randconfig-001-20250704 (https://download.01.org/0day-ci/archive/20250704/202507041803.6bndMcXn-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250704/202507041803.6bndMcXn-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507041803.6bndMcXn-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from net/mctp/route.c:1584:
net/mctp/test/route-test.c:1258:65: warning: 'type1' defined but not used [-Wunused-const-variable=]
1258 | static const struct mctp_test_bind_setup bind_addr8_netdefault, type1 = {
| ^~~~~
net/mctp/test/route-test.c:1258:42: warning: 'bind_addr8_netdefault' defined but not used [-Wunused-const-variable=]
1258 | static const struct mctp_test_bind_setup bind_addr8_netdefault, type1 = {
| ^~~~~~~~~~~~~~~~~~~~~
net/mctp/test/route-test.c: In function 'mctp_bind_pair_desc':
>> net/mctp/test/route-test.c:1340:49: warning: '%s' directive output may be truncated writing up to 99 bytes into a region of size between 87 and 101 [-Wformat-truncation=]
1340 | "{bind(addr %d, type %d, net %d%s)} {bind(addr %d, type %d, net %d%s)} -> error %d",
| ^~
1341 | t->bind1->bind_addr, t->bind1->bind_type, t->bind1->bind_net, peer1,
| ~~~~~
net/mctp/test/route-test.c:1340:18: note: directive argument in the range [0, 255]
1340 | "{bind(addr %d, type %d, net %d%s)} {bind(addr %d, type %d, net %d%s)} -> error %d",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/mctp/test/route-test.c:1340:18: note: directive argument in the range [0, 255]
net/mctp/test/route-test.c:1339:9: note: 'snprintf' output between 71 and 307 bytes into a destination of size 128
1339 | snprintf(desc, KUNIT_PARAM_DESC_SIZE,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1340 | "{bind(addr %d, type %d, net %d%s)} {bind(addr %d, type %d, net %d%s)} -> error %d",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1341 | t->bind1->bind_addr, t->bind1->bind_type, t->bind1->bind_net, peer1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1342 | t->bind2->bind_addr, t->bind2->bind_type, t->bind2->bind_net, peer2,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1343 | t->error);
| ~~~~~~~~~
vim +1340 net/mctp/test/route-test.c
1257
> 1258 static const struct mctp_test_bind_setup bind_addr8_netdefault, type1 = {
1259 .bind_addr = 8, .bind_net = MCTP_NET_ANY, .bind_type = 1,
1260 };
1261
1262 /* 1 is default net */
1263 static const struct mctp_test_bind_setup bind_addr8_net1_type1 = {
1264 .bind_addr = 8, .bind_net = 1, .bind_type = 1,
1265 };
1266
1267 static const struct mctp_test_bind_setup bind_addrany_net1_type1 = {
1268 .bind_addr = MCTP_ADDR_ANY, .bind_net = 1, .bind_type = 1,
1269 };
1270
1271 /* 2 is an arbitrary net */
1272 static const struct mctp_test_bind_setup bind_addr8_net2_type1 = {
1273 .bind_addr = 8, .bind_net = 2, .bind_type = 1,
1274 };
1275
1276 static const struct mctp_test_bind_setup bind_addr8_netdefault_type1 = {
1277 .bind_addr = 8, .bind_net = MCTP_NET_ANY, .bind_type = 1,
1278 };
1279
1280 static const struct mctp_test_bind_setup bind_addrany_net2_type2 = {
1281 .bind_addr = MCTP_ADDR_ANY, .bind_net = 2, .bind_type = 2,
1282 };
1283
1284 static const struct mctp_test_bind_setup bind_addrany_net2_type1_peer9 = {
1285 .bind_addr = MCTP_ADDR_ANY, .bind_net = 2, .bind_type = 1,
1286 .have_peer = true, .peer_addr = 9, .peer_net = 2,
1287 };
1288
1289 struct mctp_bind_pair_test {
1290 const struct mctp_test_bind_setup *bind1;
1291 const struct mctp_test_bind_setup *bind2;
1292 int error;
1293 };
1294
1295 /* Pairs of binds and whether they will conflict */
1296 static const struct mctp_bind_pair_test mctp_bind_pair_tests[] = {
1297 /* Both ADDR_ANY, conflict */
1298 { &bind_addrany_netdefault_type1, &bind_addrany_netdefault_type1, EADDRINUSE },
1299 /* Same specific EID, conflict */
1300 { &bind_addr8_netdefault_type1, &bind_addr8_netdefault_type1, EADDRINUSE },
1301 /* ADDR_ANY vs specific EID, OK */
1302 { &bind_addrany_netdefault_type1, &bind_addr8_netdefault_type1, 0 },
1303 /* ADDR_ANY different types, OK */
1304 { &bind_addrany_net2_type2, &bind_addrany_net2_type1, 0 },
1305 /* ADDR_ANY different nets, OK */
1306 { &bind_addrany_net2_type1, &bind_addrany_netdefault_type1, 0 },
1307
1308 /* specific EID, NET_ANY (resolves to default)
1309 * vs specific EID, explicit default net 1, conflict
1310 */
1311 { &bind_addr8_netdefault_type1, &bind_addr8_net1_type1, EADDRINUSE },
1312
1313 /* specific EID, net 1 vs specific EID, net 2, ok */
1314 { &bind_addr8_net1_type1, &bind_addr8_net2_type1, 0 },
1315
1316 /* ANY_ADDR, NET_ANY (doesn't resolve to default)
1317 * vs ADDR_ANY, explicit default net 1, OK
1318 */
1319 { &bind_addrany_netdefault_type1, &bind_addrany_net1_type1, 0 },
1320
1321 /* specific remote peer doesn't conflict with any-peer bind */
1322 { &bind_addrany_net2_type1_peer9, &bind_addrany_net2_type1, 0 },
1323
1324 /* bind() NET_ANY is allowed with a connect() net */
1325 { &bind_addrany_net2_type1_peer9, &bind_addrany_netdefault_type1, 0 },
1326 };
1327
1328 static void mctp_bind_pair_desc(const struct mctp_bind_pair_test *t, char *desc)
1329 {
1330 char peer1[100] = {0}, peer2[100] = {0};
1331
1332 if (t->bind1->have_peer)
1333 snprintf(peer1, sizeof(peer1), ", peer %d net %d",
1334 t->bind1->peer_addr, t->bind1->peer_net);
1335 if (t->bind2->have_peer)
1336 snprintf(peer2, sizeof(peer2), ", peer %d net %d",
1337 t->bind2->peer_addr, t->bind2->peer_net);
1338
1339 snprintf(desc, KUNIT_PARAM_DESC_SIZE,
> 1340 "{bind(addr %d, type %d, net %d%s)} {bind(addr %d, type %d, net %d%s)} -> error %d",
1341 t->bind1->bind_addr, t->bind1->bind_type, t->bind1->bind_net, peer1,
1342 t->bind2->bind_addr, t->bind2->bind_type, t->bind2->bind_net, peer2,
1343 t->error);
1344 }
1345
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists