linux/drivers
Oleg Nesterov 232fb69a53 fbcon_set_all_vcs: fix kernel crash when switching the rotated consoles
echo 3 >> /sys/class/graphics/fbcon/rotate_all, then switch to another
console. Result:

	BUG: unable to handle kernel paging request at ffffc20005d00000
	IP: [bitfill_aligned+149/265] bitfill_aligned+0x95/0x109
	PGD 7e228067 PUD 7e229067 PMD 7bc1f067 PTE 0
	Oops: 0002 [1] SMP
	CPU 1
	Modules linked in: [...a lot...]
	Pid: 10, comm: events/1 Not tainted 2.6.26.5-45.fc9.x86_64 #1
	RIP: 0010:[bitfill_aligned+149/265]  [bitfill_aligned+149/265] bitfill_aligned+0x95/0x109
	RSP: 0018:ffff81007d811bc8  EFLAGS: 00010216
	RAX: ffffc20005d00000 RBX: 0000000000000000 RCX: 0000000000000400
	RDX: 0000000000000000 RSI: ffffc20005d00000 RDI: ffffffffffffffff
	RBP: ffff81007d811be0 R08: 0000000000000400 R09: 0000000000000040
	R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000010000
	R13: ffffffff811632f0 R14: 0000000000000006 R15: ffff81007cb85400
	FS:  0000000000000000(0000) GS:ffff81007e004780(0000) knlGS:0000000000000000
	CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
	CR2: ffffc20005d00000 CR3: 0000000000201000 CR4: 00000000000006e0
	DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
	DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
	Process events/1 (pid: 10, threadinfo ffff81007d810000, task ffff81007d808000)
	Stack:  ffff81007c9d75a0 0000000000000000 0000000000000000 ffff81007d811c80
	 ffffffff81163a61 ffff810000000000 ffffffff8115f9c8 0000001000000000
	 0000000100aaaaaa 000000007cd0d4a0 fffffd8a00000800 0001000000000000
	Call Trace:
	 [cfb_fillrect+523/798] cfb_fillrect+0x20b/0x31e
	 [soft_cursor+416/436] ? soft_cursor+0x1a0/0x1b4
	 [ccw_clear_margins+205/263] ccw_clear_margins+0xcd/0x107
	 [fbcon_clear_margins+59/61] fbcon_clear_margins+0x3b/0x3d
	 [fbcon_switch+1291/1466] fbcon_switch+0x50b/0x5ba
	 [redraw_screen+261/481] redraw_screen+0x105/0x1e1
	 [ccw_cursor+0/1869] ? ccw_cursor+0x0/0x74d
	 [complete_change_console+48/190] complete_change_console+0x30/0xbe
	 [change_console+115/120] change_console+0x73/0x78
	 [console_callback+0/292] ? console_callback+0x0/0x124
	 [console_callback+97/292] console_callback+0x61/0x124
	 [schedule_delayed_work+25/30] ? schedule_delayed_work+0x19/0x1e
	 [run_workqueue+139/282] run_workqueue+0x8b/0x11a
	 [worker_thread+221/238] worker_thread+0xdd/0xee
	 [autoremove_wake_function+0/56] ? autoremove_wake_function+0x0/0x38
	 [worker_thread+0/238] ? worker_thread+0x0/0xee
	 [kthread+73/118] kthread+0x49/0x76
	 [child_rip+10/18] child_rip+0xa/0x12
	 [kthread+0/118] ? kthread+0x0/0x76
	 [child_rip+0/18] ? child_rip+0x0/0x12

Because fbcon_set_all_vcs()->FBCON_SWAP() uses display->rotate == 0 instead
of fbcon_ops->rotate, and vc_resize() has no effect because it is called with
new_cols/rows == ->vc_cols/rows.

Tested on 2.6.26.5-45.fc9.x86_64, but
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git seems to
have the same problem.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: <stable@kernel.org>	[2.6.27.x, 2.6.26.x, maybe 2.6.25.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:45 -07:00
..
accessibility braille_console: only register notifiers when the braille console is used 2008-10-02 15:53:13 -07:00
acpi rtc-cmos: move wake setup from ACPI glue into RTC driver 2008-10-14 16:08:21 -07:00
amba
ata Merge commit 'origin' 2008-10-15 11:31:54 +11:00
atm Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2008-10-11 12:39:35 -07:00
auxdisplay
base Fix typo in the FIRMWARE_IN_KERNEL help 2008-10-16 11:21:32 -07:00
block Merge commit 'origin' 2008-10-15 11:31:54 +11:00
bluetooth Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
cdrom gdrom: change to use __blk_end_request() 2008-10-09 08:56:21 +02:00
char legacy rtc: remove needless/confusing HPET_RTC_IRQ option 2008-10-16 11:21:39 -07:00
clocksource clocksource, acpi_pm.c: fix check for monotonicity 2008-09-11 11:14:29 +02:00
connector
cpufreq [CPUFREQ] Fix BUG: using smp_processor_id() in preemptible code 2008-10-09 13:52:44 -04:00
cpuidle
crypto crypto: talitos - Avoid consecutive packets going out with same IV 2008-09-14 13:41:19 -07:00
dca
dio
dma dw_dmac: fix copy/paste bug in tasklet 2008-10-03 18:22:18 -07:00
edac removed unused #include <linux/version.h>'s 2008-08-23 12:14:12 -07:00
eisa
firewire
firmware ibft: fix target info parsing in ibft module 2008-09-02 19:21:40 -07:00
gpio gpiolib: request/free hooks 2008-10-16 11:21:40 -07:00
gpu misc: replace __FUNCTION__ with __func__ 2008-10-16 11:21:30 -07:00
hid HID: build drivers for all quirky devices by default 2008-10-14 23:51:05 +02:00
hwmon Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2008-10-15 08:07:35 -07:00
i2c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2008-10-15 08:07:35 -07:00
ide Kconfig: eliminate "def_bool n" constructs 2008-10-16 11:21:31 -07:00
ieee1394
infiniband vfs: Use const for kernel parser table 2008-10-13 10:10:37 -07:00
input omap drivers: switch to standard GPIO calls 2008-10-16 11:21:40 -07:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-10-14 10:28:49 -07:00
leds Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2008-10-11 12:39:35 -07:00
lguest lguest: update commentry 2008-08-26 00:19:28 +10:00
macintosh
mca
md raid, fastboot: hide RAID autodetect option if MD is compiled as a module 2008-10-12 08:25:14 -07:00
media Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2008-10-13 14:03:59 -07:00
memstick memstick: change to use __blk_end_request() 2008-10-09 08:56:20 +02:00
message i2o: Fix 32/64bit DMA locking 2008-10-16 11:21:38 -07:00
mfd mfd: Fix warning in WM8350 2008-10-13 21:51:57 +01:00
misc AT91: atmel_pwm only available for certain AT91 processors 2008-10-16 11:21:32 -07:00
mmc Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2008-10-13 17:13:56 +01:00
mtd omap drivers: switch to standard GPIO calls 2008-10-16 11:21:40 -07:00
net Remove Andrew Morton's old email accounts 2008-10-16 11:21:32 -07:00
nubus nubus: fix mis-indented statement 2008-10-16 11:21:30 -07:00
of Merge commit 'gcl/gcl-next' 2008-10-14 10:11:27 +11:00
oprofile Merge branch 'linus' into oprofile-v2 2008-10-13 11:05:51 +02:00
parisc
parport Remove Andrew Morton's old email accounts 2008-10-16 11:21:32 -07:00
pci Merge commit 'origin' 2008-10-15 11:31:54 +11:00
pcmcia Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
pnp Merge commit 'origin' 2008-10-15 11:31:54 +11:00
power olpc: olpc_battery.c sparse endian annotations 2008-10-16 11:21:30 -07:00
ps3
rapidio
regulator da903x: add regulator support for DA9030/DA9034 2008-10-13 21:51:57 +01:00
rtc rtc-ds1672 new style driver 2008-10-16 11:21:40 -07:00
s390 misc: replace __FUNCTION__ with __func__ 2008-10-16 11:21:30 -07:00
sbus sparc: Kill sbus mostek RTC driver. 2008-09-03 15:55:32 -07:00
scsi m68k: Atari SCSI needs NVRAM 2008-10-14 10:23:27 -07:00
serial Merge commit 'origin' 2008-10-15 11:31:54 +11:00
sh
sn
spi spi: core and gpio expanders use subsys_init 2008-10-16 11:21:38 -07:00
ssb Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
tc
telephony
thermal
uio
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
video fbcon_set_all_vcs: fix kernel crash when switching the rotated consoles 2008-10-16 11:21:45 -07:00
virtio virtio_balloon: fix towards_target when deflating balloon 2008-08-26 00:19:25 +10:00
w1
watchdog Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog 2008-10-12 11:51:32 -07:00
xen xen: remove unused balloon.h 2008-10-03 10:04:10 +02:00
zorro
Kconfig
Makefile