Re: Suggestion for fixing the variable length array used in the kernel.

Christopher Li
2013-03-09T18:10:13Z

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

On Fri, Mar 8, 2013 at 9:39 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Fri, Mar 08, 2013 at 04:29:22PM -0800, Andrew Morton wrote:
>> Roughly how many instances of this are there kernel-wide?
>>
>
> Around 150 on x86 allmodconfig. They are pretty well audited.

I saw 207 on x86-64 allmodconfig. See the list that I attached.

Can you elaborate the well audited part? How it was audited?

I try to figure out if it is worth the trouble to fix it.

Chris

[-- Attachment #2: var-array-error --]
[-- Type: application/octet-stream, Size: 13659 bytes --]

lib/bch.c:190:24: error: bad constant expression
lib/bch.c:437:36: error: bad constant expression
lib/bch.c:1117:55: error: bad constant expression
lib/vsprintf.c:610:18: error: bad constant expression
lib/libcrc32c.c:46:47: error: bad constant expression
lib/reed_solomon/decode_rs.c:34:32: error: bad constant expression
lib/reed_solomon/decode_rs.c:34:42: error: bad constant expression
lib/reed_solomon/decode_rs.c:35:27: error: bad constant expression
lib/reed_solomon/decode_rs.c:35:42: error: bad constant expression
lib/reed_solomon/decode_rs.c:35:61: error: bad constant expression
lib/reed_solomon/decode_rs.c:36:23: error: bad constant expression
lib/reed_solomon/decode_rs.c:36:43: error: bad constant expression
lib/reed_solomon/decode_rs.c:36:53: error: bad constant expression
lib/reed_solomon/decode_rs.c:34:32: error: bad constant expression
lib/reed_solomon/decode_rs.c:34:42: error: bad constant expression
lib/reed_solomon/decode_rs.c:35:27: error: bad constant expression
lib/reed_solomon/decode_rs.c:35:42: error: bad constant expression
lib/reed_solomon/decode_rs.c:35:61: error: bad constant expression
lib/reed_solomon/decode_rs.c:36:23: error: bad constant expression
lib/reed_solomon/decode_rs.c:36:43: error: bad constant expression
lib/reed_solomon/decode_rs.c:36:53: error: bad constant expression
lib/btree.c:315:49: error: bad constant expression
lib/btree.c:641:30: error: bad constant expression
lib/btree.c:642:30: error: bad constant expression
arch/x86/xen/enlighten.c:500:30: error: bad constant expression
arch/x86/xen/enlighten.c:549:30: error: bad constant expression
arch/x86/xen/mmu.c:1343:17: error: bad constant expression
sound/core/oss/pcm_oss.c:1670:61: error: bad constant expression
sound/core/pcm_native.c:172:37: error: bad constant expression
sound/soc/soc-core.c:97:25: error: bad constant expression
sound/soc/soc-core.c:98:29: error: bad constant expression
drivers/usb/gadget/f_fs.c:1914:74: error: bad constant expression
drivers/usb/gadget/f_fs.c:1915:61: error: bad constant expression
drivers/usb/gadget/f_fs.c:1916:61: error: bad constant expression
drivers/usb/gadget/f_fs.c:2213:38: error: bad constant expression
drivers/usb/gadget/f_fs.c:2215:40: error: bad constant expression
drivers/usb/gadget/f_fs.c:2217:40: error: bad constant expression
drivers/usb/gadget/f_fs.c:2218:32: error: bad constant expression
drivers/usb/gadget/f_fs.c:2219:37: error: bad constant expression
drivers/usb/gadget/f_fs.c:553:44: error: bad constant expression
drivers/isdn/mISDN/dsp_hwec.c:71:31: error: bad constant expression
drivers/isdn/mISDN/l1oip_core.c:280:22: error: bad constant expression
drivers/mfd/stmpe.c:250:17: error: bad constant expression
drivers/mfd/stmpe.c:763:16: error: bad constant expression
drivers/media/usb/dvb-usb-v2/af9035.c:123:19: error: bad constant expression
drivers/media/usb/dvb-usb-v2/af9035.c:225:34: error: bad constant expression
drivers/media/usb/dvb-usb-v2/af9035.c:254:34: error: bad constant expression
drivers/media/usb/dvb-usb-v2/af9015.c:403:16: error: bad constant expression
drivers/media/usb/dvb-usb-v2/mxl111sf.c:66:20: error: bad constant expression
drivers/media/usb/dvb-usb/dibusb-common.c:106:23: error: bad constant expression
drivers/media/usb/dvb-usb/cxusb.c:60:20: error: bad constant expression
drivers/media/usb/dvb-usb/cxusb.c:161:43: error: bad constant expression
drivers/media/usb/dvb-usb/cxusb.c:175:34: error: bad constant expression
drivers/media/usb/dvb-usb/cxusb.c:175:54: error: bad constant expression
drivers/media/usb/dvb-usb/cxusb.c:194:34: error: bad constant expression
drivers/media/usb/dvb-usb/dw2102.c:308:36: error: bad constant expression
drivers/media/usb/dvb-usb/dw2102.c:325:44: error: bad constant expression
drivers/media/usb/dvb-usb/dw2102.c:335:44: error: bad constant expression
drivers/media/usb/dvb-usb/dw2102.c:401:53: error: bad constant expression
drivers/media/usb/dvb-usb/dw2102.c:430:52: error: bad constant expression
drivers/media/usb/dvb-usb/dw2102.c:463:36: error: bad constant expression
drivers/media/usb/dvb-usb/dw2102.c:481:44: error: bad constant expression
drivers/media/usb/dvb-usb/dw2102.c:563:47: error: bad constant expression
drivers/media/usb/dvb-usb/dw2102.c:590:52: error: bad constant expression
drivers/media/usb/dvb-usb/dw2102.c:602:52: error: bad constant expression
drivers/media/tuners/tda18218.c:27:18: error: bad constant expression
drivers/media/tuners/tda18218.c:66:19: error: bad constant expression
drivers/media/tuners/e4000.c:27:18: error: bad constant expression
drivers/media/tuners/e4000.c:55:16: error: bad constant expression
drivers/media/tuners/tda18212.c:35:19: error: bad constant expression
drivers/media/tuners/tda18212.c:64:16: error: bad constant expression
drivers/media/tuners/tuner-xc2028.c:550:53: error: bad constant expression
drivers/media/tuners/fc2580.c:44:18: error: bad constant expression
drivers/media/tuners/fc2580.c:72:16: error: bad constant expression
drivers/media/dvb-frontends/rtl2832.c:165:17: error: bad constant expression
drivers/media/dvb-frontends/zl10039.c:101:22: error: bad constant expression
drivers/media/dvb-frontends/stb6100.c:186:23: error: bad constant expression
drivers/media/dvb-frontends/mt312.c:99:22: error: bad constant expression
drivers/media/dvb-frontends/s5h1420.c:839:28: error: bad constant expression
drivers/media/dvb-frontends/af9033.c:43:18: error: bad constant expression
drivers/media/dvb-frontends/cxd2820r_core.c:29:19: error: bad constant expression
drivers/media/dvb-frontends/cxd2820r_core.c:58:16: error: bad constant expression
drivers/media/dvb-frontends/stv0367.c:770:20: error: bad constant expression
drivers/media/dvb-frontends/tda10071.c:30:19: error: bad constant expression
drivers/media/dvb-frontends/tda10071.c:59:16: error: bad constant expression
drivers/media/dvb-frontends/tda18271c2dd.c:142:22: error: bad constant expression
drivers/media/dvb-frontends/itd1000.c:55:17: error: bad constant expression
drivers/media/dvb-frontends/rtl2830.c:34:17: error: bad constant expression
drivers/media/dvb-frontends/stb0899_drv.c:502:18: error: bad constant expression
drivers/media/dvb-frontends/af9013.c:53:17: error: bad constant expression
drivers/media/dvb-frontends/stv6110x.c:64:20: error: bad constant expression
drivers/media/dvb-frontends/nxt200x.c:98:21: error: bad constant expression
drivers/media/dvb-frontends/bcm3510.c:204:19: error: bad constant expression
drivers/media/dvb-frontends/bcm3510.c:204:30: error: bad constant expression
drivers/media/dvb-frontends/stv090x.c:725:18: error: bad constant expression
drivers/media/dvb-frontends/stv6110.c:71:23: error: bad constant expression
drivers/media/pci/cx25821/cx25821-video-upstream.c:314:20: error: bad constant expression
drivers/media/pci/cx25821/cx25821-video-upstream.c:417:20: error: bad constant expression
drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c:270:20: error: bad constant expression
drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c:373:20: error: bad constant expression
drivers/media/pci/ttpci/av7110_hw.c:491:21: error: bad constant expression
drivers/media/pci/cx23885/cimax2.c:128:23: error: bad constant expression
drivers/input/keyboard/stmpe-keypad.c:142:24: error: bad constant expression
drivers/dma/dmatest.c:281:53: error: bad constant expression
drivers/dma/dmatest.c:342:37: error: bad constant expression
drivers/dma/dmatest.c:343:37: error: bad constant expression
drivers/dma/dmatest.c:420:43: error: bad constant expression
drivers/dma/ioat/dma_v3.c:789:27: error: bad constant expression
drivers/dma/ioat/dma_v3.c:806:27: error: bad constant expression
drivers/gpu/drm/gma500/psb_intel_sdvo.c:431:27: error: bad constant expression
drivers/gpu/drm/gma500/psb_intel_sdvo.c:432:38: error: bad constant expression
drivers/md/dm-crypt.c:530:47: error: bad constant expression
drivers/md/dm-stripe.c:319:33: error: bad constant expression
drivers/md/dm-raid1.c:258:34: error: bad constant expression
drivers/md/dm-raid1.c:628:34: error: bad constant expression
drivers/md/dm-raid1.c:1359:36: error: bad constant expression
drivers/md/raid10.c:664:48: error: bad constant expression
drivers/md/raid10.c:4508:40: error: bad constant expression
drivers/misc/tifm_7xx1.c:241:33: error: bad constant expression
drivers/net/wimax/i2400m/fw.c:655:32: error: bad constant expression
drivers/rtc/rtc-bq32k.c:68:28: error: bad constant expression
drivers/mtd/nftlmount.c:272:27: error: bad constant expression
drivers/mtd/inftlmount.c:340:27: error: bad constant expression
drivers/mtd/nand/denali.c:399:27: error: bad constant expression
drivers/video/via/via_aux_vt1631.c:39:16: error: bad constant expression
drivers/video/via/via_aux_sii164.c:39:16: error: bad constant expression
drivers/video/via/via_aux_vt1636.c:39:16: error: bad constant expression
drivers/video/via/via_aux_vt1632.c:39:16: error: bad constant expression
drivers/gpio/gpio-stmpe.c:237:19: error: bad constant expression
drivers/scsi/bfa/bfad_bsg.c:863:13: error: bad constant expression
drivers/scsi/eata.c:2118:26: error: bad constant expression
drivers/scsi/eata.c:2118:39: error: bad constant expression
drivers/scsi/eata.c:2118:52: error: bad constant expression
drivers/scsi/dpt_i2o.c:1804:27: error: bad constant expression
drivers/scsi/aic7xxx/aic7xxx_core.c:6852:29: error: bad constant expression
drivers/scsi/aic7xxx/aic7xxx_core.c:6853:27: error: bad constant expression
drivers/scsi/aic7xxx/aic7xxx_core.c:6854:25: error: bad constant expression
drivers/scsi/aic7xxx/aic79xx_core.c:9354:29: error: bad constant expression
drivers/scsi/aic7xxx/aic79xx_core.c:9355:27: error: bad constant expression
drivers/scsi/aic7xxx/aic79xx_core.c:9356:25: error: bad constant expression
drivers/scsi/osd/osd_initiator.c:1840:45: error: bad constant expression
drivers/staging/media/lirc/lirc_zilog.c:944:47: error: bad constant expression
drivers/staging/line6/midi.c:50:34: error: bad constant expression
net/ipv6/xfrm6_state.c:64:19: error: bad constant expression
net/ipv6/netfilter/ip6_tables.c:68:16: error: bad constant expression
net/bluetooth/amp.c:153:55: error: bad constant expression
net/rds/connection.c:438:40: error: bad constant expression
net/llc/llc_sap.c:395:33: error: bad constant expression
net/netfilter/nfnetlink.c:182:61: error: bad constant expression
net/netfilter/nfnetlink_cttimeout.c:60:67: error: bad constant expression
net/core/pktgen.c:883:30: error: bad constant expression
net/core/rtnetlink.c:1766:41: error: bad constant expression
net/ipv4/netfilter/ip_tables.c:67:16: error: bad constant expression
net/ipv4/netfilter/arp_tables.c:59:16: error: bad constant expression
security/integrity/ima/ima_crypto.c:50:47: error: bad constant expression
security/integrity/ima/ima_crypto.c:102:47: error: bad constant expression
security/integrity/ima/ima_crypto.c:129:47: error: bad constant expression
fs/ntfs/compress.c:199:58: error: bad constant expression
fs/ntfs/mft.c:471:33: error: bad constant expression
fs/ntfs/mft.c:676:33: error: bad constant expression
fs/ntfs/aops.c:929:48: error: bad constant expression
fs/xfs/xfs_inode_item.c:749:48: error: bad constant expression
fs/exofs/ore.c:148:50: error: bad constant expression
fs/exofs/ore.c:150:64: error: bad constant expression
fs/exofs/ore.c:151:44: error: bad constant expression
fs/exofs/ore.c:169:58: error: bad constant expression
fs/exofs/ore.c:172:64: error: bad constant expression
fs/exofs/ore.c:173:44: error: bad constant expression
fs/exofs/super.c:553:51: error: bad constant expression
fs/exofs/super.c:554:38: error: bad constant expression
fs/exofs/ore_raid.c:77:60: error: bad constant expression
fs/exofs/ore_raid.c:80:44: error: bad constant expression
fs/exofs/ore_raid.c:81:47: error: bad constant expression
fs/exofs/ore_raid.c:82:43: error: bad constant expression
fs/exofs/ore_raid.c:83:26: error: bad constant expression
fs/reiserfs/inode.c:1666:24: error: bad constant expression
fs/nfs/unlink.c:475:34: error: bad constant expression
fs/nfs/objlayout/objio_osd.c:336:59: error: bad constant expression
fs/btrfs/raid56.c:1138:28: error: bad constant expression
fs/isofs/compress.c:61:44: error: bad constant expression
fs/isofs/compress.c:307:28: error: bad constant expression
fs/pstore/ram_core.c:85:25: error: bad constant expression
fs/pstore/ram_core.c:98:25: error: bad constant expression
scripts/mod/modpost.c:2194:46: error: bad constant expression
crypto/xcbc.c:69:17: error: bad constant expression
crypto/hmac.c:57:47: error: bad constant expression
crypto/async_tx/raid6test.c:89:45: error: bad constant expression
crypto/async_tx/async_pq.c:61:29: error: bad constant expression
crypto/async_tx/async_pq.c:278:34: error: bad constant expression
crypto/ctr.c:61:22: error: bad constant expression
crypto/ctr.c:110:22: error: bad constant expression
crypto/cbc.c:149:20: error: bad constant expression
crypto/algif_hash.c:188:42: error: bad constant expression
crypto/shash.c:81:40: error: bad constant expression
crypto/shash.c:117:40: error: bad constant expression
crypto/cipher.c:70:24: error: bad constant expression
crypto/cts.c:81:16: error: bad constant expression
crypto/cts.c:81:29: error: bad constant expression
crypto/cts.c:85:15: error: bad constant expression
crypto/cts.c:86:20: error: bad constant expression
crypto/cts.c:86:34: error: bad constant expression
crypto/cts.c:167:16: error: bad constant expression
crypto/cts.c:171:15: error: bad constant expression
crypto/cts.c:172:20: error: bad constant expression
crypto/cts.c:172:34: error: bad constant expression
crypto/pcbc.c:80:19: error: bad constant expression
crypto/pcbc.c:160:19: error: bad constant expression