[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1bf1aefb-adfd-4f43-35c7-5b320d43faf8@i-love.sakura.ne.jp>
Date: Tue, 19 May 2020 13:44:30 +0900
From: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
To: Xiaoming Ni <nixiaoming@...wei.com>, keescook@...omium.org
Cc: mcgrof@...nel.org, yzaikin@...gle.com, adobriyan@...il.com,
mingo@...nel.org, gpiccoli@...onical.com, rdna@...com,
patrick.bellasi@....com, sfr@...b.auug.org.au,
akpm@...ux-foundation.org, mhocko@...e.com, vbabka@...e.cz,
tglx@...utronix.de, peterz@...radead.org,
Jisheng.Zhang@...aptics.com, khlebnikov@...dex-team.ru,
bigeasy@...utronix.de, pmladek@...e.com,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
wangle6@...wei.com, alex.huangjianhui@...wei.com
Subject: Re: [PATCH v4 2/4] sysctl: Move some boundary constants form sysctl.c
to sysctl_vals
On 2020/05/19 12:31, Xiaoming Ni wrote:
> Some boundary (.extra1 .extra2) constants (E.g: neg_one two) in
> sysctl.c are used in multiple features. Move these variables to
> sysctl_vals to avoid adding duplicate variables when cleaning up
> sysctls table.
>
> Signed-off-by: Xiaoming Ni <nixiaoming@...wei.com>
> Reviewed-by: Kees Cook <keescook@...omium.org>
I feel that it is use of
void *extra1;
void *extra2;
in "struct ctl_table" that requires constant values indirection.
Can't we get rid of sysctl_vals using some "union" like below?
struct ctl_table {
const char *procname; /* Text ID for /proc/sys, or zero */
void *data;
int maxlen;
umode_t mode;
struct ctl_table *child; /* Deprecated */
proc_handler *proc_handler; /* Callback for text formatting */
struct ctl_table_poll *poll;
union {
void *min_max_ptr[2];
int min_max_int[2];
long min_max_long[2];
};
} __randomize_layout;
Powered by blists - more mailing lists