All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v3 12/18] tcp: authopt: Add key selection controls
Date: Fri, 10 Dec 2021 00:57:20 +0800	[thread overview]
Message-ID: <202112100044.EM5GEcUJ-lkp@intel.com> (raw)
In-Reply-To: <131df4e36874ba12e77fda4387ef79317eeb4a79.1638962992.git.cdleonard@gmail.com>

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

Hi Leonard,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on 1fe5b01262844be03de98afdd56d1d393df04d7e]

url:    https://github.com/0day-ci/linux/commits/Leonard-Crestez/tcp-Initial-support-for-RFC5925-auth-option/20211208-194125
base:   1fe5b01262844be03de98afdd56d1d393df04d7e
config: m68k-randconfig-s031-20211209 (https://download.01.org/0day-ci/archive/20211210/202112100044.EM5GEcUJ-lkp(a)intel.com/config)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/8082f98bdfa221e0dc891e89beecb5d1e3ac64ac
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Leonard-Crestez/tcp-Initial-support-for-RFC5925-auth-option/20211208-194125
        git checkout 8082f98bdfa221e0dc891e89beecb5d1e3ac64ac
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=m68k SHELL=/bin/bash net/ipv4/

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/ipv4/tcp_authopt.c:343:23: sparse: sparse: incompatible types in comparison expression (different address spaces):
>> net/ipv4/tcp_authopt.c:343:23: sparse:    struct tcp_authopt_key_info [noderef] __rcu *
>> net/ipv4/tcp_authopt.c:343:23: sparse:    struct tcp_authopt_key_info *
   net/ipv4/tcp_authopt.c:345:23: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/ipv4/tcp_authopt.c:345:23: sparse:    struct tcp_authopt_key_info [noderef] __rcu *
   net/ipv4/tcp_authopt.c:345:23: sparse:    struct tcp_authopt_key_info *
   net/ipv4/tcp_authopt.c:369:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/ipv4/tcp_authopt.c:369:25: sparse:    struct tcp_authopt_key_info [noderef] __rcu *
   net/ipv4/tcp_authopt.c:369:25: sparse:    struct tcp_authopt_key_info *
   net/ipv4/tcp_authopt.c:509:20: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/ipv4/tcp_authopt.c:509:20: sparse:    struct tcp_authopt_key_info [noderef] __rcu *
   net/ipv4/tcp_authopt.c:509:20: sparse:    struct tcp_authopt_key_info *
   net/ipv4/tcp_authopt.c:528:13: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/ipv4/tcp_authopt.c:528:13: sparse:    struct tcp_authopt_key_info [noderef] __rcu *
   net/ipv4/tcp_authopt.c:528:13: sparse:    struct tcp_authopt_key_info *
   net/ipv4/tcp_authopt.c:529:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/ipv4/tcp_authopt.c:529:17: sparse:    struct tcp_authopt_key_info [noderef] __rcu *
   net/ipv4/tcp_authopt.c:529:17: sparse:    struct tcp_authopt_key_info *

vim +343 net/ipv4/tcp_authopt.c

   306	
   307	/**
   308	 * __tcp_authopt_select_key - select key for sending
   309	 *
   310	 * @sk: socket
   311	 * @info: socket's tcp_authopt_info
   312	 * @addr_sk: socket used for address lookup. Same as sk except for synack case
   313	 * @rnextkeyid: value of rnextkeyid caller should write in packet
   314	 * @locked: If we're holding the socket lock. This is false for some timewait and reset cases
   315	 *
   316	 * Result is protected by RCU and can't be stored, it may only be passed to
   317	 * tcp_authopt_hash and only under a single rcu_read_lock.
   318	 */
   319	struct tcp_authopt_key_info *__tcp_authopt_select_key(const struct sock *sk,
   320							      struct tcp_authopt_info *info,
   321							      const struct sock *addr_sk,
   322							      u8 *rnextkeyid,
   323							      bool locked)
   324	{
   325		struct tcp_authopt_key_info *key, *new_key = NULL;
   326	
   327		/* Listen sockets don't refer to any specific connection so we don't try
   328		 * to keep using the same key and ignore any received keyids.
   329		 */
   330		if (sk->sk_state == TCP_LISTEN) {
   331			int send_keyid = -1;
   332	
   333			if (info->flags & TCP_AUTHOPT_FLAG_LOCK_KEYID)
   334				send_keyid = info->send_keyid;
   335			key = tcp_authopt_lookup_send(info, addr_sk, send_keyid);
   336			if (key)
   337				*rnextkeyid = key->recv_id;
   338	
   339			return key;
   340		}
   341	
   342		if (locked)
 > 343			key = rcu_dereference_protected(info->send_key, lockdep_sock_is_held(sk));
   344		else
   345			key = rcu_dereference(info->send_key);
   346	
   347		/* Try to keep the same sending key unless user or peer requires a different key
   348		 * User request (via TCP_AUTHOPT_FLAG_LOCK_KEYID) always overrides peer request.
   349		 */
   350		if (info->flags & TCP_AUTHOPT_FLAG_LOCK_KEYID) {
   351			int send_keyid = info->send_keyid;
   352	
   353			if (!key || key->send_id != send_keyid)
   354				new_key = tcp_authopt_lookup_send(info, addr_sk, send_keyid);
   355		} else {
   356			if (!key || key->send_id != info->recv_rnextkeyid)
   357				new_key = tcp_authopt_lookup_send(info, addr_sk, info->recv_rnextkeyid);
   358		}
   359		/* If no key found with specific send_id try anything else. */
   360		if (!key && !new_key)
   361			new_key = tcp_authopt_lookup_send(info, addr_sk, -1);
   362	
   363		/* Update current key only if we hold the socket lock, otherwise we might
   364		 * store a pointer that goes stale
   365		 */
   366		if (new_key && key != new_key) {
   367			key = new_key;
   368			if (locked)
   369				rcu_assign_pointer(info->send_key, key);
   370		}
   371	
   372		if (key) {
   373			if (info->flags & TCP_AUTHOPT_FLAG_LOCK_RNEXTKEYID)
   374				*rnextkeyid = info->send_rnextkeyid;
   375			else
   376				*rnextkeyid = info->send_rnextkeyid = key->recv_id;
   377		}
   378	
   379		return key;
   380	}
   381	EXPORT_SYMBOL(__tcp_authopt_select_key);
   382	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

  reply	other threads:[~2021-12-09 16:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 11:37 [PATCH v3 00/18] tcp: Initial support for RFC5925 auth option Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 01/18] tcp: authopt: Initial support and key management Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 02/18] docs: Add user documentation for tcp_authopt Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 03/18] tcp: authopt: Add crypto initialization Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 04/18] tcp: md5: Refactor tcp_sig_hash_skb_data for AO Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 05/18] tcp: authopt: Compute packet signatures Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 06/18] tcp: authopt: Hook into tcp core Leonard Crestez
2021-12-08 16:45   ` kernel test robot
2021-12-08 20:39   ` kernel test robot
2021-12-08 20:39     ` kernel test robot
2021-12-09 12:58   ` kernel test robot
2021-12-08 11:37 ` [PATCH v3 07/18] tcp: authopt: Disable via sysctl by default Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 08/18] tcp: authopt: Implement Sequence Number Extension Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 09/18] tcp: ipv6: Add AO signing for tcp_v6_send_response Leonard Crestez
2021-12-08 21:30   ` kernel test robot
2021-12-08 11:37 ` [PATCH v3 10/18] tcp: authopt: Add support for signing skb-less replies Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 11/18] tcp: ipv4: Add AO signing for " Leonard Crestez
2021-12-08 23:37   ` kernel test robot
2021-12-09 15:02   ` kernel test robot
2021-12-08 11:37 ` [PATCH v3 12/18] tcp: authopt: Add key selection controls Leonard Crestez
2021-12-09 16:57   ` kernel test robot [this message]
2021-12-08 11:37 ` [PATCH v3 13/18] tcp: authopt: Add initial l3index support Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 14/18] tcp: authopt: Add NOSEND/NORECV flags Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 15/18] tcp: authopt: Add prefixlen support Leonard Crestez
2021-12-09 19:01   ` kernel test robot
2021-12-08 11:37 ` [PATCH v3 16/18] selftests: nettest: Rename md5_prefix to key_addr_prefix Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 17/18] selftests: nettest: Initial tcp_authopt support Leonard Crestez
2021-12-08 11:37 ` [PATCH v3 18/18] selftests: net/fcnal: " Leonard Crestez
2021-12-13 10:31 ` [PATCH v3 00/18] tcp: Initial support for RFC5925 auth option Leonard Crestez

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=202112100044.EM5GEcUJ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.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.