Re: [PATCH] sg: protect access to to 'reserved' page array

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

 



Hi Hannes,

[auto build test WARNING on scsi/for-next]
[also build test WARNING on v4.10-rc6 next-20170201]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Hannes-Reinecke/sg-protect-access-to-to-reserved-page-array/20170201-192716
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-x004-201705 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

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/linux/list.h:4,
                    from include/linux/module.h:9,
                    from drivers/scsi/sg.c:29:
   drivers/scsi/sg.c: In function 'sg_ioctl':
   drivers/scsi/sg.c:896:37: error: implicit declaration of function 'sg_res_in_use' [-Werror=implicit-function-declaration]
       if ((0 == sfp->low_dma) && (0 == sg_res_in_use(sfp))) {
                                        ^
   include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> drivers/scsi/sg.c:896:4: note: in expansion of macro 'if'
       if ((0 == sfp->low_dma) && (0 == sg_res_in_use(sfp))) {
       ^~
   cc1: some warnings being treated as errors

vim +/if +896 drivers/scsi/sg.c

f8630bd7e Paul Burton     2016-08-19  880  		if (val >= mult_frac((s64)INT_MAX, USER_HZ, HZ))
f8630bd7e Paul Burton     2016-08-19  881  			val = min_t(s64, mult_frac((s64)INT_MAX, USER_HZ, HZ),
b9b6e80ad Paul Burton     2016-08-19  882  				    INT_MAX);
^1da177e4 Linus Torvalds  2005-04-16  883  		sfp->timeout_user = val;
f8630bd7e Paul Burton     2016-08-19  884  		sfp->timeout = mult_frac(val, HZ, USER_HZ);
^1da177e4 Linus Torvalds  2005-04-16  885  
^1da177e4 Linus Torvalds  2005-04-16  886  		return 0;
^1da177e4 Linus Torvalds  2005-04-16  887  	case SG_GET_TIMEOUT:	/* N.B. User receives timeout as return value */
^1da177e4 Linus Torvalds  2005-04-16  888  				/* strange ..., for backward compatibility */
^1da177e4 Linus Torvalds  2005-04-16  889  		return sfp->timeout_user;
^1da177e4 Linus Torvalds  2005-04-16  890  	case SG_SET_FORCE_LOW_DMA:
^1da177e4 Linus Torvalds  2005-04-16  891  		result = get_user(val, ip);
^1da177e4 Linus Torvalds  2005-04-16  892  		if (result)
^1da177e4 Linus Torvalds  2005-04-16  893  			return result;
^1da177e4 Linus Torvalds  2005-04-16  894  		if (val) {
^1da177e4 Linus Torvalds  2005-04-16  895  			sfp->low_dma = 1;
^1da177e4 Linus Torvalds  2005-04-16 @896  			if ((0 == sfp->low_dma) && (0 == sg_res_in_use(sfp))) {
^1da177e4 Linus Torvalds  2005-04-16  897  				val = (int) sfp->reserve.bufflen;
95e159d6d Hannes Reinecke 2014-06-25  898  				sg_remove_scat(sfp, &sfp->reserve);
^1da177e4 Linus Torvalds  2005-04-16  899  				sg_build_reserve(sfp, val);
^1da177e4 Linus Torvalds  2005-04-16  900  			}
^1da177e4 Linus Torvalds  2005-04-16  901  		} else {
cc833acbe Douglas Gilbert 2014-06-25  902  			if (atomic_read(&sdp->detaching))
^1da177e4 Linus Torvalds  2005-04-16  903  				return -ENODEV;
^1da177e4 Linus Torvalds  2005-04-16  904  			sfp->low_dma = sdp->device->host->unchecked_isa_dma;

:::::: The code at line 896 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux