linux-stable/drivers
Viresh Kumar 85cf551905 cpufreq: Use struct kobj_attribute instead of struct global_attr
commit 625c85a62c upstream.

The cpufreq_global_kobject is created using kobject_create_and_add()
helper, which assigns the kobj_type as dynamic_kobj_ktype and show/store
routines are set to kobj_attr_show() and kobj_attr_store().

These routines pass struct kobj_attribute as an argument to the
show/store callbacks. But all the cpufreq files created using the
cpufreq_global_kobject expect the argument to be of type struct
attribute. Things work fine currently as no one accesses the "attr"
argument. We may not see issues even if the argument is used, as struct
kobj_attribute has struct attribute as its first element and so they
will both get same address.

But this is logically incorrect and we should rather use struct
kobj_attribute instead of struct global_attr in the cpufreq core and
drivers and the show/store callbacks should take struct kobj_attribute
as argument instead.

This bug is caught using CFI CLANG builds in android kernel which
catches mismatch in function prototypes for such callbacks.

Reported-by: Donghee Han <dh.han@samsung.com>
Reported-by: Sangkyu Kim <skwith.kim@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-13 14:03:06 -07:00
..
accessibility
acpi ACPI: NUMA: Use correct type for printing addresses on i386-PAE 2019-02-20 10:20:48 +01:00
amba
android binder: fix race that allows malicious free of live buffer 2018-12-05 19:41:26 +01:00
ata sata_rcar: fix deferred probing 2019-02-12 19:46:03 +01:00
atm atm: he: fix sign-extension overflow on large shift 2019-02-27 10:08:05 +01:00
auxdisplay
base OPP: Use opp_table->regulators to verify no regulator case 2019-02-12 19:46:03 +01:00
bcma
block Revert "loop: Fold __loop_release into loop_release" 2019-03-05 17:57:58 +01:00
bluetooth Bluetooth: btbcm: Add entry for BCM4335C0 UART bluetooth 2018-11-13 11:14:54 -08:00
bus bus: arm-cci: remove unnecessary unreachable() 2018-12-01 09:42:49 +01:00
cdrom gdrom: fix a memory leak bug 2019-02-12 19:46:09 +01:00
char char/mwave: fix potential Spectre v1 vulnerability 2019-01-31 08:13:43 +01:00
clk clk: vc5: Abort clock configuration without upstream clock 2019-03-05 17:57:58 +01:00
clocksource clocksource/drivers/integrator-ap: Add missing of_node_put() 2019-01-26 09:37:05 +01:00
connector
cpufreq cpufreq: Use struct kobj_attribute instead of struct global_attr 2019-03-13 14:03:06 -07:00
cpuidle cpuidle: big.LITTLE: fix refcount leak 2019-02-12 19:46:03 +01:00
crypto crypto: ux500 - Use proper enum in hash_set_dma_transfer 2019-02-12 19:46:08 +01:00
dax dev-dax: check_vma: ratelimit dev_info-s 2018-08-24 13:09:08 +02:00
dca
devfreq
dio
dma dmaengine: imx-dma: fix wrong callback invoke 2019-02-12 19:46:12 +01:00
dma-buf
edac EDAC, skx_edac: Fix logical channel intermediate decoding 2018-11-13 11:15:06 -08:00
eisa
extcon extcon: Release locking when sending the notification of connector state 2018-09-09 19:55:56 +02:00
firewire
firmware x86/platform/UV: Use efi_runtime_lock to serialise BIOS calls 2019-02-20 10:20:53 +01:00
fmc
fpga fpga: altera-cvp: Fix registration for CvP incapable devices 2019-02-12 19:45:58 +01:00
fsi
gpio gpio: pcf857x: Fix interrupts on multiple instances 2019-02-06 17:31:35 +01:00
gpu drm/amd/powerplay: OD setting fix on Vega10 2019-03-05 17:58:00 +01:00
hid HID: debug: fix the ring buffer implementation 2019-02-15 08:09:13 +01:00
hsi
hv Drivers: hv: vmbus: Check for ring when getting debug info 2019-01-31 08:13:44 +01:00
hwmon hwmon: (tmp421) Correct the misspelling of the tmp442 compatible attribute in OF device ID table 2019-02-27 10:08:05 +01:00
hwspinlock
hwtracing intel_th: msu: Fix an off-by-one in attribute store 2019-01-13 10:01:07 +01:00
i2c i2c-axxia: check for error conditions first 2019-02-12 19:46:03 +01:00
ide ide: pmac: add of_node_put() 2018-12-21 14:13:14 +01:00
idle intel_idle: Graceful probe failure when MWAIT is disabled 2018-08-09 12:16:39 +02:00
iio iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to millicelsius 2019-02-15 08:09:11 +01:00
infiniband RDMA/srp: Rework SCSI device reset handling 2019-02-27 10:08:07 +01:00
input Input: elantech - enable 3rd button support on Fujitsu CELSIUS H780 2019-02-20 10:20:53 +01:00
iommu iommu/arm-smmu-v3: Use explicit mb() when moving cons pointer 2019-02-12 19:46:03 +01:00
ipack
irqchip irqchip/gic-v3-its: Plug allocation race for devices sharing a DevID 2019-02-12 19:46:12 +01:00
isdn isdn: avm: Fix string plus integer warning from Clang 2019-02-27 10:08:06 +01:00
leds leds: lp5523: fix a missing check of return value of lp55xx_read 2019-02-27 10:08:05 +01:00
lightnvm lightnvm: pblk: fix two sleep-in-atomic-context bugs 2018-11-13 11:14:52 -08:00
macintosh macintosh/via-pmu: Add missing mmio accessors 2018-09-19 22:43:41 +02:00
mailbox mailbox: xgene-slimpro: Fix potential NULL pointer dereference 2018-09-09 19:55:54 +02:00
mcb
md dm thin: fix bug where bio that overwrites thin block ignores FUA 2019-02-20 10:20:54 +01:00
media media: coda: fix H.264 deblocking filter controls 2019-02-12 19:46:02 +01:00
memory memory: tegra: Apply interrupts mask per SoC 2018-08-03 07:50:38 +02:00
memstick memstick: Prevent memstick host from getting runtime suspended during card detection 2019-02-12 19:46:04 +01:00
message
mfd mfd: mc13xxx: Fix a missing check of a register-read failure 2019-02-27 10:08:03 +01:00
misc eeprom: at24: add support for 24c2048 2019-02-20 10:20:44 +01:00
mmc mmc: sdhci-esdhc-imx: correct the fix of ERR004536 2019-03-05 17:58:02 +01:00
mtd mtd: rawnand: gpmi: fix MX28 bus master lockup problem 2019-02-15 08:09:11 +01:00
mux
net ibmveth: Do not process frames after calling napi_reschedule 2019-03-05 17:58:01 +01:00
nfc NFC: nfcmrvl_uart: fix OF child-node lookup 2018-12-01 09:42:54 +01:00
ntb
nubus
nvdimm libnvdimm, pfn: Pad pfn namespaces relative to other regions 2018-12-13 09:18:54 +01:00
nvme nvme-pci: use the same attributes when freeing host_mem_desc_bufs. 2019-02-20 10:20:50 +01:00
nvmem nvmem: Don't let a NULL cell_id for nvmem_cell_get() crash us 2018-08-24 13:09:14 +02:00
of OF: properties: add missing of_node_put 2019-01-23 08:09:49 +01:00
oprofile
parisc
parport parport: sunbpp: fix error return code 2018-09-26 08:38:12 +02:00
pci switchtec: Fix SWITCHTEC_IOCTL_EVENT_IDX_ALL flags overwrite 2019-02-12 19:46:04 +01:00
pcmcia pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges 2018-11-13 11:14:46 -08:00
perf arm64: perf: Reject stand-alone CHAIN events for PMUv3 2018-10-18 09:16:24 +02:00
phy phy: tegra: remove redundant self assignment of 'map' 2019-02-27 10:08:09 +01:00
pinctrl pinctrl: max77620: Use define directive for max77620_pinconf_param values 2019-02-27 10:08:08 +01:00
platform platform/chrome: don't report EC_MKBP_EVENT_SENSOR_FIFO as wakeup 2019-02-12 19:45:58 +01:00
pnp
power power: supply: olpc_battery: correct the temperature units 2019-01-13 10:01:07 +01:00
powercap
pps
ps3
ptp ptp: Fix pass zero to ERR_PTR() in ptp_clock_register 2019-02-12 19:45:59 +01:00
pwm pwm: meson: Fix mux clock names 2018-09-15 09:45:27 +02:00
rapidio
ras
regulator regulator: fix crash caused by null driver data 2018-10-03 17:00:55 -07:00
remoteproc
reset reset: make device_reset_optional() really optional 2018-12-08 13:03:40 +01:00
rpmsg rpmsg: smd: fix memory leak on channel create 2018-11-13 11:15:12 -08:00
rtc rtc: m41t80: Correct alarm month range with RTC reads 2019-01-09 17:14:52 +01:00
s390 s390/zcrypt: improve special ap message cmd handling 2019-02-12 19:46:01 +01:00
sbus drivers/sbus/char: add of_node_put() 2018-12-21 14:13:13 +01:00
scsi scsi: csiostor: fix NULL pointer dereference in csio_vport_set_state() 2019-03-05 17:58:01 +01:00
sfi
sh
sn
soc soc: bcm: brcmstb: Don't leak device tree node reference 2019-02-12 19:46:00 +01:00
spi spi: bcm2835: Unbreak the build of esoteric configs 2019-01-09 17:14:53 +01:00
spmi
ssb
staging staging: android: ion: Support cpu access during dma_buf_detach 2019-03-05 17:58:01 +01:00
target scsi: target: use consistent left-aligned ASCII INQUIRY data 2019-01-26 09:37:03 +01:00
tc TC: Set DMA masks for devices 2018-11-13 11:15:11 -08:00
tee
thermal drivers: thermal: int340x_thermal: Fix sysfs race condition 2019-03-05 17:58:00 +01:00
thunderbolt
tty serial: fsl_lpuart: fix maximum acceptable baud rate with over-sampling 2019-03-05 17:58:00 +01:00
uio Revert "uio: use request_threaded_irq instead" 2019-02-15 08:09:14 +01:00
usb usb: gadget: Potential NULL dereference on allocation error 2019-03-05 17:57:59 +01:00
uwb uwb: hwa-rc: fix memory leak at probe 2018-10-03 17:00:46 -07:00
vfio
vhost vhost: correctly check the return value of translate_desc() in log_used() 2019-02-23 09:06:43 +01:00
video fbdev: fbcon: Fix unregister crash when more than one framebuffer 2019-02-12 19:46:07 +01:00
virt
virtio virtio_balloon: fix increment of vb->num_pfns in fill_balloon() 2018-10-13 09:27:30 +02:00
vlynq
vme
w1 w1: omap-hdq: fix missing bus unregister at removal 2018-11-13 11:15:09 -08:00
watchdog watchdog: renesas_wdt: don't set divider while watchdog is running 2019-02-12 19:46:03 +01:00
xen xen/pvcalls: remove set but not used variable 'intf' 2019-02-27 10:08:03 +01:00
zorro
Kconfig
Makefile