lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202109040806.KmCc3m4H-lkp@intel.com>
Date:   Sat, 4 Sep 2021 08:39:50 +0800
From:   kernel test robot <lkp@...el.com>
To:     Toms Atteka <cpp.code.lv@...il.com>, netdev@...r.kernel.org
Cc:     kbuild-all@...ts.01.org, Toms Atteka <cpp.code.lv@...il.com>
Subject: Re: [PATCH net-next v3] net: openvswitch: IPv6: Add IPv6 extension
 header support

Hi Toms,

Thank you for the patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Toms-Atteka/net-openvswitch-IPv6-Add-IPv6-extension-header-support/20210904-045602
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 29ce8f9701072fc221d9c38ad952de1a9578f95c
config: m68k-randconfig-r023-20210904 (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/dbd8852a931c7418829a31dcd51d8b2245f27f79
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Toms-Atteka/net-openvswitch-IPv6-Add-IPv6-extension-header-support/20210904-045602
        git checkout dbd8852a931c7418829a31dcd51d8b2245f27f79
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> net/openvswitch/flow.c:268:6: warning: no previous prototype for 'get_ipv6_ext_hdrs' [-Wmissing-prototypes]
     268 | void get_ipv6_ext_hdrs(struct sk_buff *skb, struct ipv6hdr *nh, u16 *ext_hdrs)
         |      ^~~~~~~~~~~~~~~~~


vim +/get_ipv6_ext_hdrs +268 net/openvswitch/flow.c

   241	
   242	/**
   243	 * Parses packet and sets IPv6 extension header flags.
   244	 *
   245	 * skb          buffer where extension header data starts in packet
   246	 * nh           ipv6 header
   247	 * ext_hdrs     flags are stored here
   248	 *
   249	 * OFPIEH12_UNREP is set if more than one of a given IPv6 extension header
   250	 * is unexpectedly encountered. (Two destination options headers may be
   251	 * expected and would not cause this bit to be set.)
   252	 *
   253	 * OFPIEH12_UNSEQ is set if IPv6 extension headers were not in the order
   254	 * preferred (but not required) by RFC 2460:
   255	 *
   256	 * When more than one extension header is used in the same packet, it is
   257	 * recommended that those headers appear in the following order:
   258	 *      IPv6 header
   259	 *      Hop-by-Hop Options header
   260	 *      Destination Options header
   261	 *      Routing header
   262	 *      Fragment header
   263	 *      Authentication header
   264	 *      Encapsulating Security Payload header
   265	 *      Destination Options header
   266	 *      upper-layer header
   267	 */
 > 268	void get_ipv6_ext_hdrs(struct sk_buff *skb, struct ipv6hdr *nh, u16 *ext_hdrs)
   269	{
   270		u8 next_type = nh->nexthdr;
   271		unsigned int start = skb_network_offset(skb) + sizeof(struct ipv6hdr);
   272		int dest_options_header_count = 0;
   273	
   274		*ext_hdrs = 0;
   275	
   276		while (ipv6_ext_hdr(next_type)) {
   277			struct ipv6_opt_hdr _hdr, *hp;
   278	
   279			switch (next_type) {
   280			case IPPROTO_NONE:
   281				*ext_hdrs |= OFPIEH12_NONEXT;
   282				/* stop parsing */
   283				return;
   284	
   285			case IPPROTO_ESP:
   286				if (*ext_hdrs & OFPIEH12_ESP)
   287					*ext_hdrs |= OFPIEH12_UNREP;
   288				if ((*ext_hdrs & ~(OFPIEH12_HOP | OFPIEH12_DEST |
   289						   OFPIEH12_ROUTER | IPPROTO_FRAGMENT |
   290						   OFPIEH12_AUTH | OFPIEH12_UNREP)) ||
   291				    dest_options_header_count >= 2) {
   292					*ext_hdrs |= OFPIEH12_UNSEQ;
   293				}
   294				*ext_hdrs |= OFPIEH12_ESP;
   295				break;
   296	
   297			case IPPROTO_AH:
   298				if (*ext_hdrs & OFPIEH12_AUTH)
   299					*ext_hdrs |= OFPIEH12_UNREP;
   300				if ((*ext_hdrs &
   301				     ~(OFPIEH12_HOP | OFPIEH12_DEST | OFPIEH12_ROUTER |
   302				       IPPROTO_FRAGMENT | OFPIEH12_UNREP)) ||
   303				    dest_options_header_count >= 2) {
   304					*ext_hdrs |= OFPIEH12_UNSEQ;
   305				}
   306				*ext_hdrs |= OFPIEH12_AUTH;
   307				break;
   308	
   309			case IPPROTO_DSTOPTS:
   310				if (dest_options_header_count == 0) {
   311					if (*ext_hdrs &
   312					    ~(OFPIEH12_HOP | OFPIEH12_UNREP))
   313						*ext_hdrs |= OFPIEH12_UNSEQ;
   314					*ext_hdrs |= OFPIEH12_DEST;
   315				} else if (dest_options_header_count == 1) {
   316					if (*ext_hdrs &
   317					    ~(OFPIEH12_HOP | OFPIEH12_DEST |
   318					      OFPIEH12_ROUTER | OFPIEH12_FRAG |
   319					      OFPIEH12_AUTH | OFPIEH12_ESP |
   320					      OFPIEH12_UNREP)) {
   321						*ext_hdrs |= OFPIEH12_UNSEQ;
   322					}
   323				} else {
   324					*ext_hdrs |= OFPIEH12_UNREP;
   325				}
   326				dest_options_header_count++;
   327				break;
   328	
   329			case IPPROTO_FRAGMENT:
   330				if (*ext_hdrs & OFPIEH12_FRAG)
   331					*ext_hdrs |= OFPIEH12_UNREP;
   332				if ((*ext_hdrs & ~(OFPIEH12_HOP |
   333						   OFPIEH12_DEST |
   334						   OFPIEH12_ROUTER |
   335						   OFPIEH12_UNREP)) ||
   336				    dest_options_header_count >= 2) {
   337					*ext_hdrs |= OFPIEH12_UNSEQ;
   338				}
   339				*ext_hdrs |= OFPIEH12_FRAG;
   340				break;
   341	
   342			case IPPROTO_ROUTING:
   343				if (*ext_hdrs & OFPIEH12_ROUTER)
   344					*ext_hdrs |= OFPIEH12_UNREP;
   345				if ((*ext_hdrs & ~(OFPIEH12_HOP |
   346						   OFPIEH12_DEST |
   347						   OFPIEH12_UNREP)) ||
   348				    dest_options_header_count >= 2) {
   349					*ext_hdrs |= OFPIEH12_UNSEQ;
   350				}
   351				*ext_hdrs |= OFPIEH12_ROUTER;
   352				break;
   353	
   354			case IPPROTO_HOPOPTS:
   355				if (*ext_hdrs & OFPIEH12_HOP)
   356					*ext_hdrs |= OFPIEH12_UNREP;
   357				/* OFPIEH12_HOP is set to 1 if a hop-by-hop IPv6
   358				 * extension header is present as the first
   359				 * extension header in the packet.
   360				 */
   361				if (*ext_hdrs == 0)
   362					*ext_hdrs |= OFPIEH12_HOP;
   363				else
   364					*ext_hdrs |= OFPIEH12_UNSEQ;
   365				break;
   366	
   367			default:
   368				return;
   369			}
   370	
   371			hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr);
   372			if (!hp)
   373				break;
   374			next_type = hp->nexthdr;
   375			start += ipv6_optlen(hp);
   376		};
   377	}
   378	

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

Download attachment ".config.gz" of type "application/gzip" (34337 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ