]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
driver core: platform: Don't read past the end of "driver_override" buffer
authorNicolai Stange <nstange@suse.de>
Mon, 11 Sep 2017 07:45:42 +0000 (09:45 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 19 Oct 2017 14:49:02 +0000 (09:49 -0500)
commit1c47b758fecb693e06695bdb9b0c88a87bb4a4c6
treebc7b777298e568fb1b125d0f60ca08ceff496462
parentc2cd5248bd44898c02123a35a97b2869b17a852e
driver core: platform: Don't read past the end of "driver_override" buffer

BugLink: http://bugs.launchpad.net/bugs/1723145
commit bf563b01c2895a4bfd1a29cc5abc67fe706ecffd upstream.

When printing the driver_override parameter when it is 4095 and 4094 bytes
long, the printing code would access invalid memory because we need count+1
bytes for printing.

Reject driver_override values of these lengths in driver_override_store().

This is in close analogy to commit 4efe874aace5 ("PCI: Don't read past the
end of sysfs "driver_override" buffer") from Sasha Levin.

Fixes: 3d713e0e382e ("driver core: platform: add device binding path 'driver_override'")
Signed-off-by: Nicolai Stange <nstange@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/base/platform.c