TSP touchscreen controller driver exposes sysfs entries vulnerability
The TSP touchscreen controller driver exposes several sysfs entries through which the driver may be configured. One such entry, 'cmd', allows the user to write commands to be executed by the driver. Specifically, the 'cmd' entry is writable, and is present under '/sys/devices/virtual/sec/tsp/cmd'. Writes to this sysfs entry are handled by the function 'cmd_store', under drivers/input/touchscreen/sec_ts/sec_ts_fn.c. This function fails to validate the length of the supplied buffer, before copying data from it into two memory locations. First, the data is copied into a static structure and second, the user-supplied data is copied into a local stack-allocated buffer, allowing the attacker to overwrite the data on the stack, including the value of frame pointer and return address, simply by providing a buffer of length >CMD_STR_LEN.