From: kernel test robot <lkp@intel.com>
To: Chris Down <chris@chrisdown.name>, linux-nfs@vger.kernel.org
Cc: kbuild-all@lists.01.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Chuck Lever <chuck.lever@oracle.com>,
"J. Bruce Fields" <bfields@redhat.com>,
Trond Myklebust <trond.myklebust@hammerspace.com>
Subject: Re: [PATCH] SUNRPC: Output oversized frag reclen as ASCII if printable
Date: Sat, 20 Mar 2021 02:11:08 +0800 [thread overview]
Message-ID: <202103200209.ODecABxp-lkp@intel.com> (raw)
In-Reply-To: <YFS7L4FIQBDtIY9d@chrisdown.name>
[-- Attachment #1: Type: text/plain, Size: 3168 bytes --]
Hi Chris,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on nfs/linux-next]
[also build test WARNING on net/master ipvs/master net-next/master nfsd/nfsd-next v5.12-rc3]
[cannot apply to next-20210319]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Chris-Down/SUNRPC-Output-oversized-frag-reclen-as-ASCII-if-printable/20210319-225807
base: git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: i386-randconfig-s002-20210318 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-277-gc089cd2d-dirty
# https://github.com/0day-ci/linux/commit/05c000d59d3659fd34ca2ac15ebce6383362fb5a
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Chris-Down/SUNRPC-Output-oversized-frag-reclen-as-ASCII-if-printable/20210319-225807
git checkout 05c000d59d3659fd34ca2ac15ebce6383362fb5a
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> net/sunrpc/svcsock.c:883:22: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] len_be @@ got restricted __be32 [usertype] @@
net/sunrpc/svcsock.c:883:22: sparse: expected unsigned int [usertype] len_be
net/sunrpc/svcsock.c:883:22: sparse: got restricted __be32 [usertype]
vim +883 net/sunrpc/svcsock.c
866
867 /* The reclen is taken directly from the first four bytes of the message with
868 * the highest bit stripped, which makes it ripe for protocol mixups. For
869 * example, if someone tries to send a HTTP GET request to us, we'll interpret
870 * it as a 1195725856-sized fragment (ie. (u32)'GET '), and print a ratelimited
871 * KERN_NOTICE with that number verbatim.
872 *
873 * To allow users to more easily understand and debug these cases, this
874 * function decodes the purported length as ASCII, and returns it if all
875 * characters were printable. Otherwise, we return NULL.
876 *
877 * WARNING: Since we reuse the u32 directly, the return value is not null
878 * terminated, and must be printed using %.*s with
879 * sizeof(svc_sock_reclen(svsk)).
880 */
881 static char *svc_sock_reclen_ascii(struct svc_sock *svsk)
882 {
> 883 u32 len_be = cpu_to_be32(svc_sock_reclen(svsk));
884 char *len_be_ascii = (char *)&len_be;
885 size_t i;
886
887 for (i = 0; i < sizeof(len_be); i++) {
888 if (!isprint(len_be_ascii[i]))
889 return NULL;
890 }
891
892 return len_be_ascii;
893 }
894
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36430 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] SUNRPC: Output oversized frag reclen as ASCII if printable
Date: Sat, 20 Mar 2021 02:11:08 +0800 [thread overview]
Message-ID: <202103200209.ODecABxp-lkp@intel.com> (raw)
In-Reply-To: <YFS7L4FIQBDtIY9d@chrisdown.name>
[-- Attachment #1: Type: text/plain, Size: 3237 bytes --]
Hi Chris,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on nfs/linux-next]
[also build test WARNING on net/master ipvs/master net-next/master nfsd/nfsd-next v5.12-rc3]
[cannot apply to next-20210319]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Chris-Down/SUNRPC-Output-oversized-frag-reclen-as-ASCII-if-printable/20210319-225807
base: git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: i386-randconfig-s002-20210318 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-277-gc089cd2d-dirty
# https://github.com/0day-ci/linux/commit/05c000d59d3659fd34ca2ac15ebce6383362fb5a
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Chris-Down/SUNRPC-Output-oversized-frag-reclen-as-ASCII-if-printable/20210319-225807
git checkout 05c000d59d3659fd34ca2ac15ebce6383362fb5a
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> net/sunrpc/svcsock.c:883:22: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] len_be @@ got restricted __be32 [usertype] @@
net/sunrpc/svcsock.c:883:22: sparse: expected unsigned int [usertype] len_be
net/sunrpc/svcsock.c:883:22: sparse: got restricted __be32 [usertype]
vim +883 net/sunrpc/svcsock.c
866
867 /* The reclen is taken directly from the first four bytes of the message with
868 * the highest bit stripped, which makes it ripe for protocol mixups. For
869 * example, if someone tries to send a HTTP GET request to us, we'll interpret
870 * it as a 1195725856-sized fragment (ie. (u32)'GET '), and print a ratelimited
871 * KERN_NOTICE with that number verbatim.
872 *
873 * To allow users to more easily understand and debug these cases, this
874 * function decodes the purported length as ASCII, and returns it if all
875 * characters were printable. Otherwise, we return NULL.
876 *
877 * WARNING: Since we reuse the u32 directly, the return value is not null
878 * terminated, and must be printed using %.*s with
879 * sizeof(svc_sock_reclen(svsk)).
880 */
881 static char *svc_sock_reclen_ascii(struct svc_sock *svsk)
882 {
> 883 u32 len_be = cpu_to_be32(svc_sock_reclen(svsk));
884 char *len_be_ascii = (char *)&len_be;
885 size_t i;
886
887 for (i = 0; i < sizeof(len_be); i++) {
888 if (!isprint(len_be_ascii[i]))
889 return NULL;
890 }
891
892 return len_be_ascii;
893 }
894
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36430 bytes --]
next prev parent reply other threads:[~2021-03-19 18:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-19 14:54 [PATCH] SUNRPC: Output oversized frag reclen as ASCII if printable Chris Down
2021-03-19 14:58 ` Chuck Lever III
2021-03-19 15:07 ` Chris Down
2021-03-19 22:08 ` J. Bruce Fields
2021-03-22 14:28 ` Chuck Lever III
2021-03-19 15:02 ` Chris Down
2021-03-19 18:11 ` kernel test robot [this message]
2021-03-19 18:11 ` kernel test robot
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=202103200209.ODecABxp-lkp@intel.com \
--to=lkp@intel.com \
--cc=bfields@redhat.com \
--cc=chris@chrisdown.name \
--cc=chuck.lever@oracle.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=trond.myklebust@hammerspace.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 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.