mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-29 14:05:19 +08:00
0d025d271e
There are three usercopy warnings which are currently being silenced for
gcc 4.6 and newer:
1) "copy_from_user() buffer size is too small" compile warning/error
This is a static warning which happens when object size and copy size
are both const, and copy size > object size. I didn't see any false
positives for this one. So the function warning attribute seems to
be working fine here.
Note this scenario is always a bug and so I think it should be
changed to *always* be an error, regardless of
CONFIG_DEBUG_STRICT_USER_COPY_CHECKS.
2) "copy_from_user() buffer size is not provably correct" compile warning
This is another static warning which happens when I enable
__compiletime_object_size() for new compilers (and
CONFIG_DEBUG_STRICT_USER_COPY_CHECKS). It happens when object size
is const, but copy size is *not*. In this case there's no way to
compare the two at build time, so it gives the warning. (Note the
warning is a byproduct of the fact that gcc has no way of knowing
whether the overflow function will be called, so the call isn't dead
code and the warning attribute is activated.)
So this warning seems to only indicate "this is an unusual pattern,
maybe you should check it out" rather than "this is a bug".
I get 102(!) of these warnings with allyesconfig and the
__compiletime_object_size() gcc check removed. I don't know if there
are any real bugs hiding in there, but from looking at a small
sample, I didn't see any. According to Kees, it does sometimes find
real bugs. But the false positive rate seems high.
3) "Buffer overflow detected" runtime warning
This is a runtime warning where object size is const, and copy size >
object size.
All three warnings (both static and runtime) were completely disabled
for gcc 4.6 with the following commit:
2fb0815c9e
("gcc4: disable __compiletime_object_size for GCC 4.6+")
That commit mistakenly assumed that the false positives were caused by a
gcc bug in __compiletime_object_size(). But in fact,
__compiletime_object_size() seems to be working fine. The false
positives were instead triggered by #2 above. (Though I don't have an
explanation for why the warnings supposedly only started showing up in
gcc 4.6.)
So remove warning #2 to get rid of all the false positives, and re-enable
warnings #1 and #3 by reverting the above commit.
Furthermore, since #1 is a real bug which is detected at compile time,
upgrade it to always be an error.
Having done all that, CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is no longer
needed.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: "H . Peter Anvin" <hpa@zytor.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Byungchul Park <byungchul.park@lge.com>
Cc: Nilay Vaish <nilayvaish@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
313 lines
7.3 KiB
Plaintext
313 lines
7.3 KiB
Plaintext
CONFIG_LOCALVERSION="-64bit"
|
|
# CONFIG_LOCALVERSION_AUTO is not set
|
|
CONFIG_SYSVIPC=y
|
|
CONFIG_POSIX_MQUEUE=y
|
|
CONFIG_BSD_PROCESS_ACCT=y
|
|
CONFIG_BSD_PROCESS_ACCT_V3=y
|
|
CONFIG_TASKSTATS=y
|
|
CONFIG_TASK_DELAY_ACCT=y
|
|
CONFIG_TASK_XACCT=y
|
|
CONFIG_TASK_IO_ACCOUNTING=y
|
|
# CONFIG_UTS_NS is not set
|
|
# CONFIG_IPC_NS is not set
|
|
# CONFIG_PID_NS is not set
|
|
# CONFIG_NET_NS is not set
|
|
CONFIG_RELAY=y
|
|
CONFIG_BLK_DEV_INITRD=y
|
|
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
|
# CONFIG_COMPAT_BRK is not set
|
|
CONFIG_MODULES=y
|
|
CONFIG_MODULE_FORCE_LOAD=y
|
|
CONFIG_MODULE_UNLOAD=y
|
|
CONFIG_MODULE_FORCE_UNLOAD=y
|
|
CONFIG_MODVERSIONS=y
|
|
CONFIG_BLK_DEV_INTEGRITY=y
|
|
# CONFIG_IOSCHED_DEADLINE is not set
|
|
CONFIG_PA8X00=y
|
|
CONFIG_64BIT=y
|
|
CONFIG_SMP=y
|
|
# CONFIG_COMPACTION is not set
|
|
CONFIG_HPPB=y
|
|
CONFIG_IOMMU_CCIO=y
|
|
CONFIG_GSC_LASI=y
|
|
CONFIG_GSC_WAX=y
|
|
CONFIG_PCI=y
|
|
CONFIG_PCI_STUB=m
|
|
CONFIG_PCI_IOV=y
|
|
CONFIG_GSC_DINO=y
|
|
CONFIG_PCI_LBA=y
|
|
CONFIG_BINFMT_MISC=m
|
|
CONFIG_NET=y
|
|
CONFIG_PACKET=y
|
|
CONFIG_UNIX=y
|
|
CONFIG_XFRM_USER=m
|
|
CONFIG_XFRM_SUB_POLICY=y
|
|
CONFIG_XFRM_MIGRATE=y
|
|
CONFIG_INET=y
|
|
CONFIG_IP_MULTICAST=y
|
|
CONFIG_IP_PNP=y
|
|
CONFIG_IP_PNP_BOOTP=y
|
|
CONFIG_INET_AH=m
|
|
CONFIG_INET_ESP=m
|
|
CONFIG_INET_XFRM_MODE_TRANSPORT=m
|
|
CONFIG_INET_XFRM_MODE_TUNNEL=m
|
|
CONFIG_INET_XFRM_MODE_BEET=m
|
|
CONFIG_INET_LRO=m
|
|
CONFIG_INET_DIAG=m
|
|
CONFIG_NETFILTER=y
|
|
# CONFIG_NETFILTER_ADVANCED is not set
|
|
CONFIG_NETFILTER_NETLINK_LOG=y
|
|
CONFIG_DCB=y
|
|
# CONFIG_WIRELESS is not set
|
|
CONFIG_DEVTMPFS=y
|
|
CONFIG_DEVTMPFS_MOUNT=y
|
|
CONFIG_BLK_DEV_LOOP=y
|
|
CONFIG_IDE=y
|
|
CONFIG_IDE_GD=m
|
|
CONFIG_IDE_GD_ATAPI=y
|
|
CONFIG_BLK_DEV_IDECD=m
|
|
CONFIG_BLK_DEV_NS87415=y
|
|
# CONFIG_SCSI_PROC_FS is not set
|
|
CONFIG_BLK_DEV_SD=y
|
|
CONFIG_BLK_DEV_SR=y
|
|
CONFIG_SCSI_ISCSI_ATTRS=y
|
|
CONFIG_SCSI_SRP_ATTRS=y
|
|
CONFIG_ISCSI_BOOT_SYSFS=y
|
|
CONFIG_SCSI_MPT2SAS=y
|
|
CONFIG_SCSI_LASI700=m
|
|
CONFIG_SCSI_SYM53C8XX_2=y
|
|
CONFIG_SCSI_ZALON=y
|
|
CONFIG_SCSI_QLA_ISCSI=m
|
|
CONFIG_SCSI_DH=y
|
|
CONFIG_ATA=y
|
|
CONFIG_PATA_SIL680=y
|
|
CONFIG_ATA_GENERIC=y
|
|
CONFIG_MD=y
|
|
CONFIG_MD_LINEAR=m
|
|
CONFIG_MD_RAID0=m
|
|
CONFIG_BLK_DEV_DM=m
|
|
CONFIG_DM_RAID=m
|
|
CONFIG_DM_UEVENT=y
|
|
CONFIG_FUSION=y
|
|
CONFIG_FUSION_SPI=y
|
|
CONFIG_FUSION_SAS=y
|
|
CONFIG_NETDEVICES=y
|
|
CONFIG_DUMMY=m
|
|
CONFIG_MACVLAN=m
|
|
CONFIG_MACVTAP=m
|
|
CONFIG_NETCONSOLE=m
|
|
CONFIG_NETCONSOLE_DYNAMIC=y
|
|
CONFIG_TUN=y
|
|
# CONFIG_NET_VENDOR_3COM is not set
|
|
# CONFIG_NET_VENDOR_ADAPTEC is not set
|
|
# CONFIG_NET_VENDOR_ALTEON is not set
|
|
# CONFIG_NET_VENDOR_AMD is not set
|
|
# CONFIG_NET_VENDOR_ATHEROS is not set
|
|
# CONFIG_NET_CADENCE is not set
|
|
# CONFIG_NET_VENDOR_BROADCOM is not set
|
|
# CONFIG_NET_VENDOR_BROCADE is not set
|
|
# CONFIG_NET_VENDOR_CHELSIO is not set
|
|
# CONFIG_NET_VENDOR_CISCO is not set
|
|
CONFIG_NET_TULIP=y
|
|
CONFIG_TULIP=y
|
|
# CONFIG_NET_VENDOR_DLINK is not set
|
|
# CONFIG_NET_VENDOR_EMULEX is not set
|
|
# CONFIG_NET_VENDOR_EXAR is not set
|
|
CONFIG_HP100=m
|
|
CONFIG_E1000=y
|
|
CONFIG_LASI_82596=y
|
|
# CONFIG_NET_VENDOR_MARVELL is not set
|
|
# CONFIG_NET_VENDOR_MELLANOX is not set
|
|
# CONFIG_NET_VENDOR_MICREL is not set
|
|
# CONFIG_NET_VENDOR_MYRI is not set
|
|
# CONFIG_NET_VENDOR_NATSEMI is not set
|
|
# CONFIG_NET_VENDOR_NVIDIA is not set
|
|
# CONFIG_NET_VENDOR_OKI is not set
|
|
CONFIG_QLA3XXX=m
|
|
CONFIG_QLCNIC=m
|
|
CONFIG_QLGE=m
|
|
# CONFIG_NET_VENDOR_REALTEK is not set
|
|
# CONFIG_NET_VENDOR_RDC is not set
|
|
# CONFIG_NET_VENDOR_SEEQ is not set
|
|
# CONFIG_NET_VENDOR_SILAN is not set
|
|
# CONFIG_NET_VENDOR_SIS is not set
|
|
# CONFIG_NET_VENDOR_SMSC is not set
|
|
# CONFIG_NET_VENDOR_STMICRO is not set
|
|
# CONFIG_NET_VENDOR_SUN is not set
|
|
# CONFIG_NET_VENDOR_TEHUTI is not set
|
|
# CONFIG_NET_VENDOR_TI is not set
|
|
# CONFIG_NET_VENDOR_VIA is not set
|
|
# CONFIG_NET_VENDOR_WIZNET is not set
|
|
CONFIG_PHYLIB=y
|
|
CONFIG_MARVELL_PHY=m
|
|
CONFIG_DAVICOM_PHY=m
|
|
CONFIG_QSEMI_PHY=m
|
|
CONFIG_LXT_PHY=m
|
|
CONFIG_CICADA_PHY=m
|
|
CONFIG_VITESSE_PHY=m
|
|
CONFIG_SMSC_PHY=m
|
|
CONFIG_BROADCOM_PHY=m
|
|
CONFIG_ICPLUS_PHY=m
|
|
CONFIG_REALTEK_PHY=m
|
|
CONFIG_NATIONAL_PHY=m
|
|
CONFIG_STE10XP=m
|
|
CONFIG_LSI_ET1011C_PHY=m
|
|
CONFIG_MDIO_BITBANG=m
|
|
CONFIG_SLIP=m
|
|
CONFIG_SLIP_COMPRESSED=y
|
|
CONFIG_SLIP_SMART=y
|
|
CONFIG_SLIP_MODE_SLIP6=y
|
|
# CONFIG_WLAN is not set
|
|
CONFIG_INPUT_EVDEV=y
|
|
# CONFIG_KEYBOARD_HIL_OLD is not set
|
|
# CONFIG_KEYBOARD_HIL is not set
|
|
# CONFIG_MOUSE_PS2 is not set
|
|
CONFIG_INPUT_MISC=y
|
|
CONFIG_SERIO_SERPORT=m
|
|
# CONFIG_HP_SDC is not set
|
|
CONFIG_SERIO_RAW=m
|
|
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
|
|
# CONFIG_LEGACY_PTYS is not set
|
|
CONFIG_NOZOMI=m
|
|
# CONFIG_DEVKMEM is not set
|
|
CONFIG_SERIAL_8250=y
|
|
# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
|
|
CONFIG_SERIAL_8250_CONSOLE=y
|
|
CONFIG_SERIAL_8250_NR_UARTS=8
|
|
CONFIG_SERIAL_8250_RUNTIME_UARTS=8
|
|
CONFIG_SERIAL_8250_EXTENDED=y
|
|
CONFIG_SERIAL_8250_MANY_PORTS=y
|
|
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
|
CONFIG_SERIAL_JSM=m
|
|
CONFIG_IPMI_HANDLER=y
|
|
CONFIG_IPMI_DEVICE_INTERFACE=y
|
|
CONFIG_IPMI_SI=y
|
|
# CONFIG_HW_RANDOM is not set
|
|
CONFIG_TCG_TPM=m
|
|
CONFIG_TCG_ATMEL=m
|
|
CONFIG_PTP_1588_CLOCK=m
|
|
CONFIG_SENSORS_I5K_AMB=m
|
|
CONFIG_SENSORS_F71882FG=m
|
|
CONFIG_SENSORS_PC87427=m
|
|
CONFIG_SENSORS_VT1211=m
|
|
CONFIG_SENSORS_VT8231=m
|
|
CONFIG_SENSORS_W83627EHF=m
|
|
CONFIG_WATCHDOG=y
|
|
CONFIG_SOFT_WATCHDOG=m
|
|
CONFIG_SSB=m
|
|
CONFIG_SSB_DRIVER_PCICORE=y
|
|
CONFIG_HTC_PASIC3=m
|
|
CONFIG_LPC_SCH=m
|
|
CONFIG_MFD_SM501=m
|
|
CONFIG_REGULATOR=y
|
|
CONFIG_REGULATOR_FIXED_VOLTAGE=m
|
|
CONFIG_REGULATOR_USERSPACE_CONSUMER=m
|
|
CONFIG_MEDIA_SUPPORT=m
|
|
CONFIG_AGP=y
|
|
CONFIG_AGP_PARISC=y
|
|
CONFIG_DRM=y
|
|
CONFIG_DRM_RADEON=y
|
|
CONFIG_DRM_RADEON_UMS=y
|
|
CONFIG_FIRMWARE_EDID=y
|
|
CONFIG_FB_MODE_HELPERS=y
|
|
CONFIG_BACKLIGHT_LCD_SUPPORT=y
|
|
# CONFIG_BACKLIGHT_GENERIC is not set
|
|
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
|
|
CONFIG_LOGO=y
|
|
# CONFIG_LOGO_LINUX_MONO is not set
|
|
CONFIG_HIDRAW=y
|
|
CONFIG_HID_PID=y
|
|
CONFIG_USB_HIDDEV=y
|
|
CONFIG_USB=y
|
|
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
|
|
CONFIG_USB_DYNAMIC_MINORS=y
|
|
CONFIG_USB_MON=m
|
|
CONFIG_USB_WUSB_CBAF=m
|
|
CONFIG_USB_XHCI_HCD=m
|
|
CONFIG_USB_EHCI_HCD=y
|
|
CONFIG_USB_OHCI_HCD=y
|
|
CONFIG_NEW_LEDS=y
|
|
CONFIG_LEDS_CLASS=y
|
|
CONFIG_LEDS_TRIGGERS=y
|
|
CONFIG_LEDS_TRIGGER_TIMER=y
|
|
CONFIG_LEDS_TRIGGER_ONESHOT=y
|
|
CONFIG_LEDS_TRIGGER_DISK=y
|
|
CONFIG_LEDS_TRIGGER_HEARTBEAT=m
|
|
CONFIG_LEDS_TRIGGER_BACKLIGHT=m
|
|
CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
|
|
CONFIG_UIO=y
|
|
CONFIG_UIO_PDRV_GENIRQ=m
|
|
CONFIG_UIO_AEC=m
|
|
CONFIG_UIO_SERCOS3=m
|
|
CONFIG_UIO_PCI_GENERIC=m
|
|
CONFIG_STAGING=y
|
|
CONFIG_EXT2_FS=y
|
|
CONFIG_EXT2_FS_XATTR=y
|
|
CONFIG_EXT2_FS_SECURITY=y
|
|
CONFIG_EXT3_FS=y
|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# CONFIG_SCHED_DEBUG is not set
|
|
CONFIG_TIMER_STATS=y
|
|
CONFIG_CRYPTO_MANAGER=y
|
|
CONFIG_CRYPTO_ECB=m
|
|
CONFIG_CRYPTO_PCBC=m
|
|
CONFIG_CRYPTO_MD4=m
|
|
CONFIG_CRYPTO_MD5=y
|
|
CONFIG_CRYPTO_MICHAEL_MIC=m
|
|
CONFIG_CRYPTO_SHA256=m
|
|
CONFIG_CRYPTO_ARC4=m
|
|
CONFIG_CRYPTO_FCRYPT=m
|
|
CONFIG_CRYPTO_DEFLATE=m
|
|
# CONFIG_CRYPTO_HW is not set
|
|
CONFIG_CRC_CCITT=m
|
|
CONFIG_LIBCRC32C=y
|
|
CONFIG_XZ_DEC_X86=y
|
|
CONFIG_XZ_DEC_POWERPC=y
|
|
CONFIG_XZ_DEC_IA64=y
|
|
CONFIG_XZ_DEC_ARM=y
|
|
CONFIG_XZ_DEC_ARMTHUMB=y
|
|
CONFIG_XZ_DEC_SPARC=y
|