Re: [PATCH 2/6] net/x25: make neighbour params configurable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]<

 



Hi Martin,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]
[also build test ERROR on net/master linus/master sparc-next/master v5.10-rc4 next-20201116]
[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/Martin-Schiller/net-x25-add-remove-x25_link_device-by-NETDEV_REGISTER-UNREGISTER/20201116-153459
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 0064c5c1b3bf2a695c772c90e8dea38426a870ff
config: x86_64-randconfig-a011-20201116 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c044709b8fbea2a9a375e4173a6bd735f6866c0c)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/2d44533245f7e8388db93c53c26703ac52650e57
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Martin-Schiller/net-x25-add-remove-x25_link_device-by-NETDEV_REGISTER-UNREGISTER/20201116-153459
        git checkout 2d44533245f7e8388db93c53c26703ac52650e57
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All errors (new ones prefixed by >>):

>> net/x25/af_x25.c:1709:30: error: assigning to 'struct compat_x25_facilities' from incompatible type 'struct x25_facilities'
                   x25_subscr.facilities        = nb->facilities;
                                                ^ ~~~~~~~~~~~~~~
>> net/x25/af_x25.c:1761:24: error: assigning to 'struct x25_facilities' from incompatible type 'struct compat_x25_facilities'
                   nb->facilities        = x25_subscr.facilities;
                                         ^ ~~~~~~~~~~~~~~~~~~~~~
   2 errors generated.

vim +1709 net/x25/af_x25.c

  1678	
  1679	#ifdef CONFIG_COMPAT
  1680	static int compat_x25_subscr_ioctl(unsigned int cmd,
  1681			struct compat_x25_subscrip_struct __user *x25_subscr32)
  1682	{
  1683		struct compat_x25_subscrip_struct x25_subscr;
  1684		struct x25_neigh *nb;
  1685		struct net_device *dev;
  1686		int rc = -EINVAL;
  1687	
  1688		if (cmd != SIOCX25GSUBSCRIP && cmd != SIOCX25SSUBSCRIP)
  1689			goto out;
  1690	
  1691		rc = -EFAULT;
  1692		if (copy_from_user(&x25_subscr, x25_subscr32, sizeof(*x25_subscr32)))
  1693			goto out;
  1694	
  1695		rc = -EINVAL;
  1696		dev = x25_dev_get(x25_subscr.device);
  1697		if (dev == NULL)
  1698			goto out;
  1699	
  1700		nb = x25_get_neigh(dev);
  1701		if (nb == NULL)
  1702			goto out_dev_put;
  1703	
  1704		if (cmd == SIOCX25GSUBSCRIP) {
  1705			read_lock_bh(&x25_neigh_list_lock);
  1706			x25_subscr.extended = nb->extended;
  1707			x25_subscr.dce		     = nb->dce;
  1708			x25_subscr.lc		     = nb->lc;
> 1709			x25_subscr.facilities	     = nb->facilities;
  1710			x25_subscr.t20		     = nb->t20;
  1711			x25_subscr.global_facil_mask = nb->global_facil_mask;
  1712			read_unlock_bh(&x25_neigh_list_lock);
  1713			rc = copy_to_user(x25_subscr32, &x25_subscr,
  1714					sizeof(*x25_subscr32)) ? -EFAULT : 0;
  1715		} else {
  1716			rc = -EINVAL;
  1717	
  1718			if (dev->flags & IFF_UP)
  1719				return -EBUSY;
  1720	
  1721			if (x25_subscr.extended != 0 && x25_subscr.extended != 1)
  1722				goto out_dev_and_neigh_put;
  1723			if (x25_subscr.dce != 0 && x25_subscr.dce != 1)
  1724				goto out_dev_and_neigh_put;
  1725			if (x25_subscr.lc < 1 || x25_subscr.lc > 4095)
  1726				goto out_dev_and_neigh_put;
  1727			if (x25_subscr.facilities.pacsize_in < X25_PS16 ||
  1728			    x25_subscr.facilities.pacsize_in > X25_PS4096)
  1729				goto out_dev_and_neigh_put;
  1730			if (x25_subscr.facilities.pacsize_out < X25_PS16 ||
  1731			    x25_subscr.facilities.pacsize_out > X25_PS4096)
  1732				goto out_dev_and_neigh_put;
  1733			if (x25_subscr.facilities.winsize_in < 1 ||
  1734			    x25_subscr.facilities.winsize_in > 127)
  1735				goto out_dev_and_neigh_put;
  1736			if (x25_subscr.facilities.throughput) {
  1737				int out = x25_subscr.facilities.throughput & 0xf0;
  1738				int in  = x25_subscr.facilities.throughput & 0x0f;
  1739				if (!out)
  1740					x25_subscr.facilities.throughput |=
  1741						X25_DEFAULT_THROUGHPUT << 4;
  1742				else if (out < 0x30 || out > 0xD0)
  1743					goto out_dev_and_neigh_put;
  1744				if (!in)
  1745					x25_subscr.facilities.throughput |=
  1746						X25_DEFAULT_THROUGHPUT;
  1747				else if (in < 0x03 || in > 0x0D)
  1748					goto out_dev_and_neigh_put;
  1749			}
  1750			if (x25_subscr.facilities.reverse &&
  1751			    (x25_subscr.facilities.reverse & 0x81) != 0x81)
  1752				goto out_dev_and_neigh_put;
  1753			if (x25_subscr.t20 < 1 * HZ || x25_subscr.t20 > 300 * HZ)
  1754				goto out_dev_and_neigh_put;
  1755	
  1756			rc = 0;
  1757			write_lock_bh(&x25_neigh_list_lock);
  1758			nb->extended	      = x25_subscr.extended;
  1759			nb->dce		      = x25_subscr.dce;
  1760			nb->lc		      = x25_subscr.lc;
> 1761			nb->facilities	      = x25_subscr.facilities;
  1762			nb->t20		      = x25_subscr.t20;
  1763			nb->global_facil_mask = x25_subscr.global_facil_mask;
  1764			write_unlock_bh(&x25_neigh_list_lock);
  1765		}
  1766		dev_put(dev);
  1767	
  1768		x25_neigh_put(nb);
  1769	out:
  1770		return rc;
  1771	out_dev_and_neigh_put:
  1772		x25_neigh_put(nb);
  1773	out_dev_put:
  1774		dev_put(dev);
  1775		goto out;
  1776	}
  1777	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux