Skip to contentSkip to conversation

console: limit the range of VGACON_SOFT_SCROLLBACK_SIZE

PATCH In review Amerigo Wang 2 participants 3 messages Dec 25, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 console: limit the range of VGACON_SOFT_SCROLLBACK_SIZE

BuraphaLinux reported that we will trigger a mm warning when we CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=65536, this is because mm cann't allocate so many pages. We should limit the range of CONFIG_VGACON_SOFT_SCROLLBACK_SIZE, don't give a user any chance to trigger that.

---

drivers/video/console/Kconfig +1 -0
index fc7d9bb..8e8f18d 100644
@@ -37,6 +37,7 @@ config VGACON_SOFT_SCROLLBACK
 config VGACON_SOFT_SCROLLBACK_SIZE
        int "Scrollback Buffer Size (in KB)"
        depends on VGACON_SOFT_SCROLLBACK
+       range 1 1024
        default "64"
        help
          Enter the amount of System RAM to allocate for the scrollback
author
#1 lore raw

Adding some Cc's in the original thread. :)

Quoted 23 lines · Amerigo Wang

BuraphaLinux reported that we will trigger a mm warning when we CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=65536, this is because mm cann't allocate so many pages. We should limit the range of CONFIG_VGACON_SOFT_SCROLLBACK_SIZE, don't give a user any chance to trigger that.

---

drivers/video/console/Kconfig +1 -0
index fc7d9bb..8e8f18d 100644
@@ -37,6 +37,7 @@ config VGACON_SOFT_SCROLLBACK
 config VGACON_SOFT_SCROLLBACK_SIZE
        int "Scrollback Buffer Size (in KB)"
        depends on VGACON_SOFT_SCROLLBACK
+       range 1 1024
        default "64"
        help
          Enter the amount of System RAM to allocate for the scrollback
Tested-by on v1 1/1
#2 lore raw
In reply to Amerigo Wang
Quoted 18 lines · Amerigo Wang

BuraphaLinux reported that we will trigger a mm warning when we CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=65536, this is because mm cann't allocate so many pages. We should limit the range of CONFIG_VGACON_SOFT_SCROLLBACK_SIZE, don't give a user any chance to trigger that.

---

drivers/video/console/Kconfig +0 -0
index fc7d9bb..8e8f18d 100644

drivers/video/console/Kconfig config VGACON_SOFT_SCROLLBACK · line 43

Quoted 7 lines
drivers/video/console/Kconfig +1 -0
@@ -37,6 +37,7 @@ config VGACON_SOFT_SCROLLBACK
 config VGACON_SOFT_SCROLLBACK_SIZE
        int "Scrollback Buffer Size (in KB)"
        depends on VGACON_SOFT_SCROLLBACK
+       range 1 1024
        default "64"
        help
          Enter the amount of System RAM to allocate for the scrollback

This fixed the problem. Thank you for the fix. I texted on 2.6.32.2 with your patch added, x86_64 kernel.