Revision 85bd839983778fcd0c1c043327b14a046e979b39 authored by Gu Zheng on 10 June 2015, 18:14:43 UTC, committed by Linus Torvalds on 10 June 2015, 23:43:43 UTC
Izumi found the following oops when hot re-adding a node: BUG: unable to handle kernel paging request at ffffc90008963690 IP: __wake_up_bit+0x20/0x70 Oops: 0000 [#1] SMP CPU: 68 PID: 1237 Comm: rs:main Q:Reg Not tainted 4.1.0-rc5 #80 Hardware name: FUJITSU PRIMEQUEST2800E/SB, BIOS PRIMEQUEST 2000 Series BIOS Version 1.87 04/28/2015 task: ffff880838df8000 ti: ffff880017b94000 task.ti: ffff880017b94000 RIP: 0010:[<ffffffff810dff80>] [<ffffffff810dff80>] __wake_up_bit+0x20/0x70 RSP: 0018:ffff880017b97be8 EFLAGS: 00010246 RAX: ffffc90008963690 RBX: 00000000003c0000 RCX: 000000000000a4c9 RDX: 0000000000000000 RSI: ffffea101bffd500 RDI: ffffc90008963648 RBP: ffff880017b97c08 R08: 0000000002000020 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8a0797c73800 R13: ffffea101bffd500 R14: 0000000000000001 R15: 00000000003c0000 FS: 00007fcc7ffff700(0000) GS:ffff880874800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffc90008963690 CR3: 0000000836761000 CR4: 00000000001407e0 Call Trace: unlock_page+0x6d/0x70 generic_write_end+0x53/0xb0 xfs_vm_write_end+0x29/0x80 [xfs] generic_perform_write+0x10a/0x1e0 xfs_file_buffered_aio_write+0x14d/0x3e0 [xfs] xfs_file_write_iter+0x79/0x120 [xfs] __vfs_write+0xd4/0x110 vfs_write+0xac/0x1c0 SyS_write+0x58/0xd0 system_call_fastpath+0x12/0x76 Code: 5d c3 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 48 83 ec 20 65 48 8b 04 25 28 00 00 00 48 89 45 f8 31 c0 48 8d 47 48 <48> 39 47 48 48 c7 45 e8 00 00 00 00 48 c7 45 f0 00 00 00 00 48 RIP [<ffffffff810dff80>] __wake_up_bit+0x20/0x70 RSP <ffff880017b97be8> CR2: ffffc90008963690 Reproduce method (re-add a node):: Hot-add nodeA --> remove nodeA --> hot-add nodeA (panic) This seems an use-after-free problem, and the root cause is zone->wait_table was not set to *NULL* after free it in try_offline_node. When hot re-add a node, we will reuse the pgdat of it, so does the zone struct, and when add pages to the target zone, it will init the zone first (including the wait_table) if the zone is not initialized. The judgement of zone initialized is based on zone->wait_table: static inline bool zone_is_initialized(struct zone *zone) { return !!zone->wait_table; } so if we do not set the zone->wait_table to *NULL* after free it, the memory hotplug routine will skip the init of new zone when hot re-add the node, and the wait_table still points to the freed memory, then we will access the invalid address when trying to wake up the waiting people after the i/o operation with the page is done, such as mentioned above. Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Reported-by: Taku Izumi <izumi.taku@jp.fujitsu.com> Reviewed by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Tang Chen <tangchen@cn.fujitsu.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5879ae5
File | Mode | Size |
---|---|---|
pmbus | ||
Kconfig | -rw-r--r-- | 52.3 KB |
Makefile | -rw-r--r-- | 6.5 KB |
ab8500.c | -rw-r--r-- | 5.4 KB |
abituguru.c | -rw-r--r-- | 52.5 KB |
abituguru3.c | -rw-r--r-- | 40.8 KB |
abx500.c | -rw-r--r-- | 14.1 KB |
abx500.h | -rw-r--r-- | 2.0 KB |
acpi_power_meter.c | -rw-r--r-- | 23.8 KB |
ad7314.c | -rw-r--r-- | 3.8 KB |
ad7414.c | -rw-r--r-- | 6.3 KB |
ad7418.c | -rw-r--r-- | 7.1 KB |
adc128d818.c | -rw-r--r-- | 14.0 KB |
adcxx.c | -rw-r--r-- | 6.4 KB |
adm1021.c | -rw-r--r-- | 14.7 KB |
adm1025.c | -rw-r--r-- | 17.4 KB |
adm1026.c | -rw-r--r-- | 57.6 KB |
adm1029.c | -rw-r--r-- | 11.3 KB |
adm1031.c | -rw-r--r-- | 32.7 KB |
adm9240.c | -rw-r--r-- | 22.5 KB |
ads1015.c | -rw-r--r-- | 8.2 KB |
ads7828.c | -rw-r--r-- | 5.7 KB |
ads7871.c | -rw-r--r-- | 6.8 KB |
adt7310.c | -rw-r--r-- | 2.8 KB |
adt7410.c | -rw-r--r-- | 2.0 KB |
adt7411.c | -rw-r--r-- | 9.3 KB |
adt7462.c | -rw-r--r-- | 57.9 KB |
adt7470.c | -rw-r--r-- | 40.3 KB |
adt7475.c | -rw-r--r-- | 46.5 KB |
adt7x10.c | -rw-r--r-- | 13.3 KB |
adt7x10.h | -rw-r--r-- | 932 bytes |
amc6821.c | -rw-r--r-- | 27.0 KB |
applesmc.c | -rw-r--r-- | 32.5 KB |
asb100.c | -rw-r--r-- | 27.9 KB |
asc7621.c | -rw-r--r-- | 34.9 KB |
asus_atk0110.c | -rw-r--r-- | 33.1 KB |
atxp1.c | -rw-r--r-- | 8.3 KB |
coretemp.c | -rw-r--r-- | 22.0 KB |
da9052-hwmon.c | -rw-r--r-- | 8.2 KB |
da9055-hwmon.c | -rw-r--r-- | 7.5 KB |
dme1737.c | -rw-r--r-- | 77.9 KB |
ds1621.c | -rw-r--r-- | 11.8 KB |
ds620.c | -rw-r--r-- | 7.3 KB |
emc1403.c | -rw-r--r-- | 15.3 KB |
emc2103.c | -rw-r--r-- | 19.7 KB |
emc6w201.c | -rw-r--r-- | 15.8 KB |
f71805f.c | -rw-r--r-- | 48.1 KB |
f71882fg.c | -rw-r--r-- | 82.6 KB |
f75375s.c | -rw-r--r-- | 26.0 KB |
fam15h_power.c | -rw-r--r-- | 6.8 KB |
fschmd.c | -rw-r--r-- | 40.7 KB |
g760a.c | -rw-r--r-- | 5.6 KB |
g762.c | -rw-r--r-- | 28.2 KB |
gl518sm.c | -rw-r--r-- | 21.4 KB |
gl520sm.c | -rw-r--r-- | 26.4 KB |
gpio-fan.c | -rw-r--r-- | 16.0 KB |
hih6130.c | -rw-r--r-- | 7.6 KB |
htu21.c | -rw-r--r-- | 4.4 KB |
hwmon-vid.c | -rw-r--r-- | 10.1 KB |
hwmon.c | -rw-r--r-- | 6.8 KB |
i5500_temp.c | -rw-r--r-- | 4.1 KB |
i5k_amb.c | -rw-r--r-- | 15.7 KB |
ibmaem.c | -rw-r--r-- | 27.0 KB |
ibmpex.c | -rw-r--r-- | 14.9 KB |
ibmpowernv.c | -rw-r--r-- | 11.8 KB |
iio_hwmon.c | -rw-r--r-- | 4.7 KB |
ina209.c | -rw-r--r-- | 17.8 KB |
ina2xx.c | -rw-r--r-- | 13.5 KB |
it87.c | -rw-r--r-- | 83.8 KB |
jc42.c | -rw-r--r-- | 15.2 KB |
jz4740-hwmon.c | -rw-r--r-- | 4.2 KB |
k10temp.c | -rw-r--r-- | 6.7 KB |
k8temp.c | -rw-r--r-- | 9.0 KB |
lineage-pem.c | -rw-r--r-- | 14.9 KB |
lm63.c | -rw-r--r-- | 36.0 KB |
lm70.c | -rw-r--r-- | 4.8 KB |
lm73.c | -rw-r--r-- | 7.6 KB |
lm75.c | -rw-r--r-- | 14.7 KB |
lm75.h | -rw-r--r-- | 1.7 KB |
lm77.c | -rw-r--r-- | 10.6 KB |
lm78.c | -rw-r--r-- | 27.1 KB |
lm80.c | -rw-r--r-- | 19.9 KB |
lm83.c | -rw-r--r-- | 11.4 KB |
lm85.c | -rw-r--r-- | 46.8 KB |
lm87.c | -rw-r--r-- | 29.2 KB |
lm90.c | -rw-r--r-- | 49.1 KB |
lm92.c | -rw-r--r-- | 12.1 KB |
lm93.c | -rw-r--r-- | 83.4 KB |
lm95234.c | -rw-r--r-- | 20.9 KB |
lm95241.c | -rw-r--r-- | 11.4 KB |
lm95245.c | -rw-r--r-- | 13.4 KB |
ltc2945.c | -rw-r--r-- | 15.1 KB |
ltc4151.c | -rw-r--r-- | 5.2 KB |
ltc4215.c | -rw-r--r-- | 7.4 KB |
ltc4222.c | -rw-r--r-- | 6.8 KB |
ltc4245.c | -rw-r--r-- | 15.3 KB |
ltc4260.c | -rw-r--r-- | 5.2 KB |
ltc4261.c | -rw-r--r-- | 7.1 KB |
max1111.c | -rw-r--r-- | 6.9 KB |
max16065.c | -rw-r--r-- | 21.8 KB |
max1619.c | -rw-r--r-- | 9.2 KB |
max1668.c | -rw-r--r-- | 13.3 KB |
max197.c | -rw-r--r-- | 8.7 KB |
max6639.c | -rw-r--r-- | 17.9 KB |
max6642.c | -rw-r--r-- | 9.0 KB |
max6650.c | -rw-r--r-- | 18.4 KB |
max6697.c | -rw-r--r-- | 20.4 KB |
mc13783-adc.c | -rw-r--r-- | 8.0 KB |
mcp3021.c | -rw-r--r-- | 4.7 KB |
menf21bmc_hwmon.c | -rw-r--r-- | 6.1 KB |
nct6683.c | -rw-r--r-- | 35.8 KB |
nct6775.c | -rw-r--r-- | 122.6 KB |
nct7802.c | -rw-r--r-- | 25.3 KB |
nct7904.c | -rw-r--r-- | 17.6 KB |
ntc_thermistor.c | -rw-r--r-- | 17.0 KB |
pc87360.c | -rw-r--r-- | 55.0 KB |
pc87427.c | -rw-r--r-- | 39.6 KB |
pcf8591.c | -rw-r--r-- | 8.5 KB |
powr1220.c | -rw-r--r-- | 11.2 KB |
pwm-fan.c | -rw-r--r-- | 7.5 KB |
s3c-hwmon.c | -rw-r--r-- | 10.5 KB |
sch5627.c | -rw-r--r-- | 19.2 KB |
sch5636.c | -rw-r--r-- | 16.7 KB |
sch56xx-common.c | -rw-r--r-- | 16.0 KB |
sch56xx-common.h | -rw-r--r-- | 1.9 KB |
sht15.c | -rw-r--r-- | 28.5 KB |
sht21.c | -rw-r--r-- | 6.3 KB |
shtc1.c | -rw-r--r-- | 6.9 KB |
sis5595.c | -rw-r--r-- | 25.3 KB |
smm665.c | -rw-r--r-- | 20.4 KB |
smsc47b397.c | -rw-r--r-- | 8.7 KB |
smsc47m1.c | -rw-r--r-- | 24.3 KB |
smsc47m192.c | -rw-r--r-- | 19.8 KB |
thmc50.c | -rw-r--r-- | 12.8 KB |
tmp102.c | -rw-r--r-- | 8.2 KB |
tmp103.c | -rw-r--r-- | 5.1 KB |
tmp401.c | -rw-r--r-- | 21.7 KB |
tmp421.c | -rw-r--r-- | 8.4 KB |
twl4030-madc-hwmon.c | -rw-r--r-- | 4.1 KB |
ultra45_env.c | -rw-r--r-- | 8.3 KB |
vexpress.c | -rw-r--r-- | 7.1 KB |
via-cputemp.c | -rw-r--r-- | 8.5 KB |
via686a.c | -rw-r--r-- | 30.9 KB |
vt1211.c | -rw-r--r-- | 37.3 KB |
vt8231.c | -rw-r--r-- | 30.9 KB |
w83627ehf.c | -rw-r--r-- | 85.5 KB |
w83627hf.c | -rw-r--r-- | 56.3 KB |
w83781d.c | -rw-r--r-- | 56.7 KB |
w83791d.c | -rw-r--r-- | 50.3 KB |
w83792d.c | -rw-r--r-- | 54.7 KB |
w83793.c | -rw-r--r-- | 60.1 KB |
w83795.c | -rw-r--r-- | 62.1 KB |
w83l785ts.c | -rw-r--r-- | 8.0 KB |
w83l786ng.c | -rw-r--r-- | 20.9 KB |
wm831x-hwmon.c | -rw-r--r-- | 4.9 KB |
wm8350-hwmon.c | -rw-r--r-- | 3.1 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...