mbox series

[0/3] Fixes multiple sysctl proc_handler usage error

Message ID 20241112131357.49582-1-nicolas.bouchinet@clip-os.org
Headers show
Series Fixes multiple sysctl proc_handler usage error | expand

Message

Nicolas Bouchinet Nov. 12, 2024, 1:13 p.m. UTC
From: Nicolas Bouchinet <nicolas.bouchinet@ssi.gouv.fr>

Hi, while reading sysctl code I encountered two sysctl proc_handler
parameters common errors.

The first one is to declare .data as a different type thant the return of
the used .proc_handler, i.e. using proch_dointvec, thats convert a char
string to signed integers, and storing the result in a .data that is backed
by an unsigned int. User can then write "-1" string, which results in a
different value stored in the .data variable. This can lead to type
conversion errors in branches and thus to potential security issues.