From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Jeremy Kerr <jk@codeconstruct.com.au>,
netdev@vger.kernel.org
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
Matt Johnston <matt@codeconstruct.com.au>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
David Howells <dhowells@redhat.com>,
Alexander Lobakin <aleksander.lobakin@intel.com>,
Liang Chen <liangchen.linux@gmail.com>,
Johannes Berg <johannes.berg@intel.com>
Subject: Re: [PATCH net-next 06/11] net: mctp: provide a more specific tag allocation ioctl
Date: Mon, 19 Feb 2024 11:22:12 +0300 [thread overview]
Message-ID: <95174361-e247-4792-866b-d77152659fd6@moroto.mountain> (raw)
In-Reply-To: <424009ba3e320ae93eb6bd44ef5e474aa5c9221f.1708071380.git.jk@codeconstruct.com.au>
Hi Jeremy,
kernel test robot noticed the following build warnings:
url: https://github.com/intel-lab-lkp/linux/commits/Jeremy-Kerr/net-mctp-avoid-confusion-over-local-peer-dest-source-addresses/20240216-163203
base: net-next/main
patch link: https://lore.kernel.org/r/424009ba3e320ae93eb6bd44ef5e474aa5c9221f.1708071380.git.jk%40codeconstruct.com.au
patch subject: [PATCH net-next 06/11] net: mctp: provide a more specific tag allocation ioctl
config: parisc-randconfig-r081-20240218 (https://download.01.org/0day-ci/archive/20240218/202402181713.OQAPBmZC-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 13.2.0
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>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202402181713.OQAPBmZC-lkp@intel.com/
smatch warnings:
net/mctp/af_mctp.c:389 mctp_ioctl_tag_copy_from_user() warn: was && intended here instead of ||?
vim +389 net/mctp/af_mctp.c
28828bad95a357 Jeremy Kerr 2024-02-16 356 static int mctp_ioctl_tag_copy_from_user(unsigned long arg,
28828bad95a357 Jeremy Kerr 2024-02-16 357 struct mctp_ioc_tag_ctl2 *ctl,
28828bad95a357 Jeremy Kerr 2024-02-16 358 bool tagv2)
28828bad95a357 Jeremy Kerr 2024-02-16 359 {
28828bad95a357 Jeremy Kerr 2024-02-16 360 struct mctp_ioc_tag_ctl ctl_compat;
28828bad95a357 Jeremy Kerr 2024-02-16 361 unsigned long size;
28828bad95a357 Jeremy Kerr 2024-02-16 362 void *ptr;
28828bad95a357 Jeremy Kerr 2024-02-16 363 int rc;
28828bad95a357 Jeremy Kerr 2024-02-16 364
28828bad95a357 Jeremy Kerr 2024-02-16 365 if (tagv2) {
28828bad95a357 Jeremy Kerr 2024-02-16 366 size = sizeof(*ctl);
28828bad95a357 Jeremy Kerr 2024-02-16 367 ptr = ctl;
28828bad95a357 Jeremy Kerr 2024-02-16 368 } else {
28828bad95a357 Jeremy Kerr 2024-02-16 369 size = sizeof(ctl_compat);
28828bad95a357 Jeremy Kerr 2024-02-16 370 ptr = &ctl_compat;
28828bad95a357 Jeremy Kerr 2024-02-16 371 }
28828bad95a357 Jeremy Kerr 2024-02-16 372
28828bad95a357 Jeremy Kerr 2024-02-16 373 rc = copy_from_user(ptr, (void __user *)arg, size);
28828bad95a357 Jeremy Kerr 2024-02-16 374 if (rc)
28828bad95a357 Jeremy Kerr 2024-02-16 375 return -EFAULT;
28828bad95a357 Jeremy Kerr 2024-02-16 376
28828bad95a357 Jeremy Kerr 2024-02-16 377 if (!tagv2) {
28828bad95a357 Jeremy Kerr 2024-02-16 378 /* compat, using defaults for new fields */
28828bad95a357 Jeremy Kerr 2024-02-16 379 ctl->net = MCTP_INITIAL_DEFAULT_NET;
28828bad95a357 Jeremy Kerr 2024-02-16 380 ctl->peer_addr = ctl_compat.peer_addr;
28828bad95a357 Jeremy Kerr 2024-02-16 381 ctl->local_addr = MCTP_ADDR_ANY;
28828bad95a357 Jeremy Kerr 2024-02-16 382 ctl->flags = ctl_compat.flags;
28828bad95a357 Jeremy Kerr 2024-02-16 383 ctl->tag = ctl_compat.tag;
28828bad95a357 Jeremy Kerr 2024-02-16 384 }
28828bad95a357 Jeremy Kerr 2024-02-16 385
28828bad95a357 Jeremy Kerr 2024-02-16 386 if (ctl->flags)
28828bad95a357 Jeremy Kerr 2024-02-16 387 return -EINVAL;
28828bad95a357 Jeremy Kerr 2024-02-16 388
28828bad95a357 Jeremy Kerr 2024-02-16 @389 if (!(ctl->local_addr != MCTP_ADDR_ANY ||
28828bad95a357 Jeremy Kerr 2024-02-16 390 ctl->local_addr != MCTP_ADDR_NULL))
28828bad95a357 Jeremy Kerr 2024-02-16 391 return -EINVAL;
Should be &&. This function will always return -EINVAL. I haven't
looked at the context outside of this automatically generated email but
it suggests a failure in our test process.
28828bad95a357 Jeremy Kerr 2024-02-16 392
28828bad95a357 Jeremy Kerr 2024-02-16 393 return 0;
28828bad95a357 Jeremy Kerr 2024-02-16 394 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-02-19 8:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-16 8:19 [PATCH net-next 00/11] MCTP core protocol updates, minor fixes & tests Jeremy Kerr
2024-02-16 8:19 ` [PATCH net-next 01/11] net: mctp: avoid confusion over local/peer dest/source addresses Jeremy Kerr
2024-02-16 8:19 ` [PATCH net-next 02/11] net: mctp: Add some detail on the key allocation implementation Jeremy Kerr
2024-02-16 8:19 ` [PATCH net-next 03/11] net: mctp: make key lookups match the ANY address on either local or peer Jeremy Kerr
2024-02-16 8:19 ` [PATCH net-next 04/11] net: mctp: tests: create test skbs with the correct net and device Jeremy Kerr
2024-02-16 8:19 ` [PATCH net-next 05/11] net: mctp: separate key correlation across nets Jeremy Kerr
2024-02-16 8:19 ` [PATCH net-next 06/11] net: mctp: provide a more specific tag allocation ioctl Jeremy Kerr
2024-02-19 8:22 ` Dan Carpenter [this message]
2024-02-19 9:48 ` Jeremy Kerr
2024-02-16 8:19 ` [PATCH net-next 07/11] net: mctp: tests: Add netid argument to __mctp_route_test_init Jeremy Kerr
2024-02-16 8:19 ` [PATCH net-next 08/11] net: mctp: tests: Add MCTP net isolation tests Jeremy Kerr
2024-02-16 8:19 ` [PATCH net-next 09/11] net: mctp: copy skb ext data when fragmenting Jeremy Kerr
2024-02-16 8:19 ` [PATCH net-next 10/11] net: mctp: tests: Test that outgoing skbs have flow data populated Jeremy Kerr
2024-02-16 14:23 ` Jakub Kicinski
2024-02-17 3:32 ` Jeremy Kerr
2024-02-16 8:19 ` [PATCH net-next 11/11] net: mctp: tests: Add a test for proper tag creation on local output Jeremy Kerr
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=95174361-e247-4792-866b-d77152659fd6@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=aleksander.lobakin@intel.com \
--cc=dhowells@redhat.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jk@codeconstruct.com.au \
--cc=johannes.berg@intel.com \
--cc=kuba@kernel.org \
--cc=liangchen.linux@gmail.com \
--cc=lkp@intel.com \
--cc=matt@codeconstruct.com.au \
--cc=netdev@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=pabeni@redhat.com \
/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