All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: kbuild-all@01.org, netdev@vger.kernel.org,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Eric Biggers <ebiggers@kernel.org>,
	linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au,
	edumazet@google.com, davem@davemloft.net, kuznet@ms2.inr.ac.ru,
	yoshfuji@linux-ipv6.org, jbaron@akamai.com, cpaasch@apple.com,
	David.Laight@aculab.com, ycheng@google.com
Subject: Re: [PATCH net-next v2 1/1] net: fastopen: robustness and endianness fixes for SipHash
Date: Fri, 21 Jun 2019 07:03:38 +0800	[thread overview]
Message-ID: <201906210722.4v8arL9y%lkp@intel.com> (raw)
In-Reply-To: <20190619065510.23514-2-ard.biesheuvel@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 8526 bytes --]

Hi Ard,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Ard-Biesheuvel/net-fastopen-follow-up-tweaks-for-SipHash-switch/20190621-060434
config: i386-randconfig-x009-201924 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   net//ipv4/tcp_fastopen.c: In function 'tcp_fastopen_reset_cipher':
>> net//ipv4/tcp_fastopen.c:82:16: warning: missing braces around initializer [-Wmissing-braces]
     ctx->key[0] = (siphash_key_t){
                   ^
      get_unaligned_le64(primary_key),
      {
   net//ipv4/tcp_fastopen.c:85:2:
     };
     }
   net//ipv4/tcp_fastopen.c:87:17: warning: missing braces around initializer [-Wmissing-braces]
      ctx->key[1] = (siphash_key_t){
                    ^
       get_unaligned_le64(backup_key),
       {
   net//ipv4/tcp_fastopen.c:90:3:
      };
      }
   Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
   Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
   Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_read
   Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_write
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_read
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_set
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_add
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_inc
   Cyclomatic Complexity 2 arch/x86/include/asm/atomic.h:arch_atomic_try_cmpxchg
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_read
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_set
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_add
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_inc
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_try_cmpxchg
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls
   Cyclomatic Complexity 1 include/uapi/linux/byteorder/little_endian.h:__le64_to_cpup
   Cyclomatic Complexity 1 include/uapi/linux/byteorder/little_endian.h:__le32_to_cpup
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
   Cyclomatic Complexity 1 include/linux/percpu-defs.h:__this_cpu_preempt_check
   Cyclomatic Complexity 5 include/linux/string.h:memcmp
   Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
   Cyclomatic Complexity 6 arch/x86/include/asm/preempt.h:__preempt_count_add
   Cyclomatic Complexity 6 arch/x86/include/asm/preempt.h:__preempt_count_sub
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_lock
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock
   Cyclomatic Complexity 1 include/linux/rcupdate.h:__rcu_read_lock
   Cyclomatic Complexity 1 include/linux/rcupdate.h:__rcu_read_unlock
   Cyclomatic Complexity 1 include/linux/rcutiny.h:rcu_is_watching
   Cyclomatic Complexity 67 include/linux/slab.h:kmalloc_large
   Cyclomatic Complexity 3 include/linux/slab.h:kmalloc
   Cyclomatic Complexity 1 include/linux/slab.h:kzalloc
   Cyclomatic Complexity 1 include/linux/refcount.h:refcount_set
   Cyclomatic Complexity 1 include/linux/refcount.h:refcount_read
   Cyclomatic Complexity 1 include/linux/skbuff.h:skb_end_pointer
   Cyclomatic Complexity 1 include/linux/skbuff.h:__skb_insert
   Cyclomatic Complexity 1 include/linux/skbuff.h:__skb_queue_before
   Cyclomatic Complexity 1 include/linux/skbuff.h:__skb_queue_tail
   Cyclomatic Complexity 1 include/linux/skbuff.h:skb_transport_header
   Cyclomatic Complexity 1 include/linux/skbuff.h:skb_network_header
   Cyclomatic Complexity 1 include/net/net_namespace.h:read_pnet
   Cyclomatic Complexity 1 include/linux/unaligned/access_ok.h:get_unaligned_le64
   Cyclomatic Complexity 1 include/net/dst.h:dst_metric_raw
   Cyclomatic Complexity 1 include/net/sock.h:sk_has_account
   Cyclomatic Complexity 2 include/net/sock.h:sk_mem_charge
   Cyclomatic Complexity 1 include/net/sock.h:sock_net
   Cyclomatic Complexity 1 include/net/inet_sock.h:inet_sk
   Cyclomatic Complexity 1 include/net/inet_connection_sock.h:inet_csk
   Cyclomatic Complexity 1 include/linux/tcp.h:tcp_hdr
   Cyclomatic Complexity 1 include/linux/tcp.h:__tcp_hdrlen
   Cyclomatic Complexity 1 include/linux/tcp.h:tcp_hdrlen
   Cyclomatic Complexity 1 include/linux/tcp.h:tcp_rsk
   Cyclomatic Complexity 1 include/linux/tcp.h:tcp_sk
   Cyclomatic Complexity 1 include/linux/ipv6.h:ipv6_hdr
   Cyclomatic Complexity 1 include/linux/ip.h:ip_hdr
   Cyclomatic Complexity 4 include/net/tcp.h:tcp_fastopen_cookie_match
   Cyclomatic Complexity 1 include/net/tcp.h:tcp_fastopen_context_len
   Cyclomatic Complexity 3 include/net/tcp.h:tcp_segs_in
   Cyclomatic Complexity 8 include/net/tcp.h:tcp_fastopen_get_ctx
   Cyclomatic Complexity 1 include/linux/rcupdate.h:rcu_lock_acquire
   Cyclomatic Complexity 4 include/linux/rcupdate.h:rcu_read_lock
   Cyclomatic Complexity 1 include/linux/rcupdate.h:rcu_lock_release
   Cyclomatic Complexity 4 include/linux/rcupdate.h:rcu_read_unlock
   Cyclomatic Complexity 1 net//ipv4/tcp_fastopen.c:tcp_fastopen_ctx_free
   Cyclomatic Complexity 1 include/linux/lockdep.h:lock_is_held
   Cyclomatic Complexity 3 include/net/sock.h:lockdep_sock_is_held
   Cyclomatic Complexity 5 include/net/sock.h:__sk_dst_get
   Cyclomatic Complexity 2 include/net/dst.h:refdst_drop
   Cyclomatic Complexity 2 include/net/dst.h:skb_dst_drop
   Cyclomatic Complexity 5 include/net/dst.h:dst_metric
   Cyclomatic Complexity 5 net//ipv4/tcp_fastopen.c:tcp_fastopen_no_cookie
   Cyclomatic Complexity 3 include/linux/atomic-fallback.h:atomic_fetch_add_unless
   Cyclomatic Complexity 1 include/linux/atomic-fallback.h:atomic_add_unless
   Cyclomatic Complexity 1 include/linux/atomic-fallback.h:atomic_inc_not_zero
   Cyclomatic Complexity 6 include/net/sock.h:sk_dst_get
   Cyclomatic Complexity 1 include/linux/skbuff.h:__skb_pull
   Cyclomatic Complexity 2 include/linux/skbuff.h:skb_orphan
   Cyclomatic Complexity 1 include/net/sock.h:skb_set_owner_r
   Cyclomatic Complexity 2 include/net/sock.h:sock_put
   Cyclomatic Complexity 2 include/net/request_sock.h:__reqsk_free
   Cyclomatic Complexity 2 include/net/request_sock.h:reqsk_free
   Cyclomatic Complexity 2 include/net/request_sock.h:reqsk_put
   Cyclomatic Complexity 7 net//ipv4/tcp_fastopen.c:tcp_fastopen_queue_check
   Cyclomatic Complexity 11 include/linux/siphash.h:___siphash_aligned
   Cyclomatic Complexity 1 include/linux/siphash.h:siphash
   Cyclomatic Complexity 3 net//ipv4/tcp_fastopen.c:__tcp_fastopen_cookie_gen_cipher

vim +82 net//ipv4/tcp_fastopen.c

    68	
    69	int tcp_fastopen_reset_cipher(struct net *net, struct sock *sk,
    70				      void *primary_key, void *backup_key)
    71	{
    72		struct tcp_fastopen_context *ctx, *octx;
    73		struct fastopen_queue *q;
    74		int err = 0;
    75	
    76		ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
    77		if (!ctx) {
    78			err = -ENOMEM;
    79			goto out;
    80		}
    81	
  > 82		ctx->key[0] = (siphash_key_t){
    83			get_unaligned_le64(primary_key),
    84			get_unaligned_le64(primary_key + 8)
    85		};
    86		if (backup_key) {
    87			ctx->key[1] = (siphash_key_t){
    88				get_unaligned_le64(backup_key),
    89				get_unaligned_le64(backup_key + 8)
    90			};
    91			ctx->num = 2;
    92		} else {
    93			ctx->num = 1;
    94		}
    95	
    96		spin_lock(&net->ipv4.tcp_fastopen_ctx_lock);
    97		if (sk) {
    98			q = &inet_csk(sk)->icsk_accept_queue.fastopenq;
    99			octx = rcu_dereference_protected(q->ctx,
   100				lockdep_is_held(&net->ipv4.tcp_fastopen_ctx_lock));
   101			rcu_assign_pointer(q->ctx, ctx);
   102		} else {
   103			octx = rcu_dereference_protected(net->ipv4.tcp_fastopen_ctx,
   104				lockdep_is_held(&net->ipv4.tcp_fastopen_ctx_lock));
   105			rcu_assign_pointer(net->ipv4.tcp_fastopen_ctx, ctx);
   106		}
   107		spin_unlock(&net->ipv4.tcp_fastopen_ctx_lock);
   108	
   109		if (octx)
   110			call_rcu(&octx->rcu, tcp_fastopen_ctx_free);
   111	out:
   112		return err;
   113	}
   114	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29016 bytes --]

      parent reply	other threads:[~2019-06-20 23:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19  6:55 [PATCH net-next v2 0/1] net: fastopen: follow-up tweaks for SipHash switch Ard Biesheuvel
2019-06-19  6:55 ` [PATCH net-next v2 1/1] net: fastopen: robustness and endianness fixes for SipHash Ard Biesheuvel
2019-06-19 17:25   ` Eric Biggers
2019-06-19 21:42   ` David Miller
2019-06-19 21:47     ` Ard Biesheuvel
2019-06-20 23:03   ` kbuild test robot [this message]

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=201906210722.4v8arL9y%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=David.Laight@aculab.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=cpaasch@apple.com \
    --cc=davem@davemloft.net \
    --cc=ebiggers@kernel.org \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jbaron@akamai.com \
    --cc=kbuild-all@01.org \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-crypto@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ycheng@google.com \
    --cc=yoshfuji@linux-ipv6.org \
    /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.