Messages in this thread | | | Date | Tue, 3 May 2016 14:44:42 +0900 | From | Sergey Senozhatsky <> | Subject | Re: [PATCH 2/2] zram: user per-cpu compression streams |
| |
On (05/03/16 14:23), Minchan Kim wrote: [..] > > - zram->max_comp_streams = num; > > - ret = len; > > -out: > > - up_write(&zram->init_lock); > > - return ret; > > At least, we need sanity check code, still? > Otherwise, user can echo "garbage" > /sys/xxx/max_comp_stream" and then > cat /sys/xxx/max_comp_stream returns num_online_cpus.
hm, I couldn't find any reason to keep the check. we completely ignore the value anyway, cat /sys/xxx/max_comp_stream will always return num_online_cpus(), regardless the correctness of supplied data; `garbage', `2', `1024', `32' make no difference.
-ss
| |