From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932611AbbLROCu (ORCPT ); Fri, 18 Dec 2015 09:02:50 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:55431 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932132AbbLROCt (ORCPT ); Fri, 18 Dec 2015 09:02:49 -0500 X-AuditID: cbfec7f4-f79026d00000418a-62-56741206e471 Subject: Re: [PATCH] err.h: add type checking to IS_ERR_VALUE macro To: kbuild test robot References: <201512181904.10FwDTvV%fengguang.wu@intel.com> Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, Bartlomiej Zolnierkiewicz , Marek Szyprowski , Andrew Morton , Viresh Kumar From: Andrzej Hajda Message-id: <56741203.8000404@samsung.com> Date: Fri, 18 Dec 2015 15:02:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-version: 1.0 In-reply-to: <201512181904.10FwDTvV%fengguang.wu@intel.com> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNLMWRmVeSWpSXmKPExsVy+t/xK7psQiVhBju+a1rMWb+GzWLjjPWs FseuT2S2uLxrDpvFq+ZHbBZrj9xlt9j41cOB3eP+XnaPxXteMnncubaHzePEjN8sHn1bVjF6 fN4kF8AWxWWTkpqTWZZapG+XwJUxf+Yp9oKLthW/duxibGD8oNfFyMkhIWAi8efwNiYIW0zi wr31bF2MXBxCAksZJXZ3PGMHSQgJPGeUeDaDDcQWFnCW+PT+KlCcg0NEQFVixW5viBIrif7u q8wgvcwCHxklVn7dBTaUTUBT4u/mm2C9vAJaEm1H7jOC2CxAvTPfTWIGmSMqECGxaEcmRImg xI/J91hAbE4Ba4mzDdPBVjEL6Encv6gFEmYWkJfYvOYt8wRGgVlIOmYhVM1CUrWAkXkVo2hq aXJBcVJ6rqFecWJucWleul5yfu4mRkiQf9nBuPiY1SFGAQ5GJR5eA7biMCHWxLLiytxDjBIc zEoivILHgUK8KYmVValF+fFFpTmpxYcYpTlYlMR55+56HyIkkJ5YkpqdmlqQWgSTZeLglGpg rIxRFUwMOzuhslbE18h/k8lTu5hnbKdeiXpPynBN+qVgf+GKyf2bdzpi6m8EHAjLEXx1IlLm 90mBpZHPVK3svkgyu0Ver3gUMj2ljSe0o+IJF8fOv5O+e953faJ90HjPfpUZrgGnlRmqO74d Zu057dByb1lY64OU/AKtuRu3pNhK6lYsS7mrxFKckWioxVxUnAgAvx6gyG4CAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi kbuild test robot, Thanks for tests :) Log below shows there are IS_ERR_VALUE usage bugs present in the kernel, which SmPL patch did not detected. These bugs should be fixed before accepting current version of my patch. If alternative version will be chosen, 'bugs' should become valid code. Regards Andrzej On 12/18/2015 12:22 PM, kbuild test robot wrote: > Hi Andrzej, > > [auto build test WARNING on v4.4-rc5] > [also build test WARNING on next-20151217] > > url: https://github.com/0day-ci/linux/commits/Andrzej-Hajda/err-h-add-type-checking-to-IS_ERR_VALUE-macro/20151218-185839 > config: m68k-sun3_defconfig (attached as .config) > reproduce: > wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # save the attached .config to linux build tree > make.cross ARCH=m68k > > All warnings (new ones prefixed by >>): > > In file included from include/uapi/linux/stddef.h:1:0, > from include/linux/stddef.h:4, > from include/uapi/linux/posix_types.h:4, > from include/uapi/linux/types.h:13, > from include/linux/types.h:5, > from include/uapi/linux/sysinfo.h:4, > from include/uapi/linux/kernel.h:4, > from include/linux/cache.h:4, > from net/ipv4/netfilter/ip_tables.c:13: > In function 'find_check_entry.isra.12', > inlined from 'translate_table' at net/ipv4/netfilter/ip_tables.c:868:7: > include/linux/compiler.h:484:38: error: call to '__compiletime_assert_674' declared with attribute error: Invalid IS_ERR_VALUE argument type > _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) > ^ > include/linux/compiler.h:467:4: note: in definition of macro '__compiletime_assert' > prefix ## suffix(); \ > ^ > include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert' > _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) > ^ > include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert' > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > ^ > include/linux/err.h:24:5: note: in expansion of macro 'BUILD_BUG_ON_MSG' > BUILD_BUG_ON_MSG((typeof(x))(-MAX_ERRNO) != (unsigned long)-MAX_ERRNO, "Invalid IS_ERR_VALUE argument type");\ > ^ >>> net/ipv4/netfilter/ip_tables.c:674:6: note: in expansion of macro 'IS_ERR_VALUE' > if (IS_ERR_VALUE(e->counters.pcnt)) > ^ > -- > In file included from include/linux/linkage.h:4:0, > from include/linux/kernel.h:6, > from net/ipv4/netfilter/arp_tables.c:13: > In function 'find_check_entry.isra.14', > inlined from 'translate_table' at net/ipv4/netfilter/arp_tables.c:702:7: > include/linux/compiler.h:484:38: error: call to '__compiletime_assert_530' declared with attribute error: Invalid IS_ERR_VALUE argument type > _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) > ^ > include/linux/compiler.h:467:4: note: in definition of macro '__compiletime_assert' > prefix ## suffix(); \ > ^ > include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert' > _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) > ^ > include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert' > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > ^ > include/linux/err.h:24:5: note: in expansion of macro 'BUILD_BUG_ON_MSG' > BUILD_BUG_ON_MSG((typeof(x))(-MAX_ERRNO) != (unsigned long)-MAX_ERRNO, "Invalid IS_ERR_VALUE argument type");\ > ^ >>> net/ipv4/netfilter/arp_tables.c:530:6: note: in expansion of macro 'IS_ERR_VALUE' > if (IS_ERR_VALUE(e->counters.pcnt)) > ^ > -- > In file included from include/linux/linkage.h:4:0, > from include/linux/kernel.h:6, > from net/ipv6/netfilter/ip6_tables.c:15: > In function 'find_check_entry.isra.12', > inlined from 'translate_table' at net/ipv6/netfilter/ip6_tables.c:880:7: > include/linux/compiler.h:484:38: error: call to '__compiletime_assert_687' declared with attribute error: Invalid IS_ERR_VALUE argument type > _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) > ^ > include/linux/compiler.h:467:4: note: in definition of macro '__compiletime_assert' > prefix ## suffix(); \ > ^ > include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert' > _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) > ^ > include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert' > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > ^ > include/linux/err.h:24:5: note: in expansion of macro 'BUILD_BUG_ON_MSG' > BUILD_BUG_ON_MSG((typeof(x))(-MAX_ERRNO) != (unsigned long)-MAX_ERRNO, "Invalid IS_ERR_VALUE argument type");\ > ^ >>> net/ipv6/netfilter/ip6_tables.c:687:6: note: in expansion of macro 'IS_ERR_VALUE' > if (IS_ERR_VALUE(e->counters.pcnt)) > ^ > > vim +/IS_ERR_VALUE +674 net/ipv4/netfilter/ip_tables.c > > 022748a9 Denys Vlasenko 2008-01-14 658 static int > a83d8e8d Alexey Dobriyan 2010-01-18 659 find_check_entry(struct ipt_entry *e, struct net *net, const char *name, > 0559518b Jan Engelhardt 2010-02-24 660 unsigned int size) > ^1da177e Linus Torvalds 2005-04-16 661 { > 87a2e70d Jan Engelhardt 2010-10-13 662 struct xt_entry_target *t; > 6709dbbb Jan Engelhardt 2007-02-07 663 struct xt_target *target; > ^1da177e Linus Torvalds 2005-04-16 664 int ret; > ^1da177e Linus Torvalds 2005-04-16 665 unsigned int j; > 9b4fce7a Jan Engelhardt 2008-10-08 666 struct xt_mtchk_param mtpar; > dcea992a Jan Engelhardt 2010-02-24 667 struct xt_entry_match *ematch; > ^1da177e Linus Torvalds 2005-04-16 668 > a96be246 Dmitry Mishin 2006-12-12 669 ret = check_entry(e, name); > a96be246 Dmitry Mishin 2006-12-12 670 if (ret) > a96be246 Dmitry Mishin 2006-12-12 671 return ret; > 590bdf7f Dmitry Mishin 2006-10-30 672 > 71ae0dff Florian Westphal 2015-06-11 673 e->counters.pcnt = xt_percpu_counter_alloc(); > 71ae0dff Florian Westphal 2015-06-11 @674 if (IS_ERR_VALUE(e->counters.pcnt)) > 71ae0dff Florian Westphal 2015-06-11 675 return -ENOMEM; > 71ae0dff Florian Westphal 2015-06-11 676 > ^1da177e Linus Torvalds 2005-04-16 677 j = 0; > a83d8e8d Alexey Dobriyan 2010-01-18 678 mtpar.net = net; > 9b4fce7a Jan Engelhardt 2008-10-08 679 mtpar.table = name; > 9b4fce7a Jan Engelhardt 2008-10-08 680 mtpar.entryinfo = &e->ip; > 9b4fce7a Jan Engelhardt 2008-10-08 681 mtpar.hook_mask = e->comefrom; > 916a917d Jan Engelhardt 2008-10-08 682 mtpar.family = NFPROTO_IPV4; > > :::::: The code at line 674 was first introduced by commit > :::::: 71ae0dff02d756e4d2ca710b79f2ff5390029a5f netfilter: xtables: use percpu rule counters > > :::::: TO: Florian Westphal > :::::: CC: Pablo Neira Ayuso > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation