Re: [PATCH] driver core: restrict buffer length in online_store()

2017-07-20 Thread Greg KH
On Fri, Jul 21, 2017 at 08:39:04AM +0800, Tiezhu Yang wrote: > According to Documentation/ABI/testing/sysfs-devices-online, in order to > control CPU N's hotplug state, we should write one of 'Yy1Nn0' to the file > /sys/devices/system/cpu/cpuN/online, other values should be invalid. so the >

[PATCH] driver core: restrict buffer length in online_store()

2017-07-20 Thread Tiezhu Yang
According to Documentation/ABI/testing/sysfs-devices-online, in order to control CPU N's hotplug state, we should write one of 'Yy1Nn0' to the file /sys/devices/system/cpu/cpuN/online, other values should be invalid. so the buffer length should be 2, buf[0] is one of 'Yy1Nn0' and buf[1] is '\n'.