ANDROID: fix up sysctl_vals change in 5.15.58
In commit 78e36f3b0dae ("sysctl: move some boundary constants from
sysctl.c to sysctl_vals"), the sysctl_vals[] array changed size and
contents, which does not work well when external modules are accessing
it and relying on it to have the same contents.
Fix this up by putting back the original values and size and creating a
new array, sysctl_vals_new, that is used by the #define values in
include/linux/sysctl.h. If any existing module that used sysctl_vals is
rebuilt, it will then require sysctl_vals_new to be exported (as it
pickes it up from the #define), so add the symbol to the exported symbol
list to ensure that existing code all still builds and works properly.
Functions changes summary: 0 Removed, 0 Changed (53 filtered out), 0 Added functions
Variables changes summary: 0 Removed, 0 Changed (1 filtered out), 1 Added variables
1 Added variable:
[A] 'const int sysctl_vals_new[10]'
Bug: 161946584
Fixes: 78e36f3b0dae ("sysctl: move some boundary constants from sysctl.c to sysctl_vals")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie543b101d5e3e4c91984d9f5fe52de0945fa0681
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1918,6 +1918,7 @@
|
||||
syscon_regmap_lookup_by_phandle
|
||||
sysctl_sched_features
|
||||
sysctl_vals
|
||||
sysctl_vals_new
|
||||
sysfs_add_file_to_group
|
||||
sysfs_add_link_to_group
|
||||
sysfs_create_bin_file
|
||||
|
||||
@@ -25,8 +25,10 @@ static const struct file_operations proc_sys_dir_file_operations;
|
||||
static const struct inode_operations proc_sys_dir_operations;
|
||||
|
||||
/* shared constants to be used in various sysctls */
|
||||
const int sysctl_vals[] = { -1, 0, 1, 2, 4, 100, 200, 1000, 3000, INT_MAX };
|
||||
const int sysctl_vals[] = { 0, 1, INT_MAX };
|
||||
EXPORT_SYMBOL(sysctl_vals);
|
||||
const int sysctl_vals_new[] = { -1, 0, 1, 2, 4, 100, 200, 1000, 3000, INT_MAX };
|
||||
EXPORT_SYMBOL(sysctl_vals_new);
|
||||
|
||||
/* Support for permanently empty directories */
|
||||
|
||||
|
||||
@@ -38,18 +38,19 @@ struct ctl_table_header;
|
||||
struct ctl_dir;
|
||||
|
||||
/* Keep the same order as in fs/proc/proc_sysctl.c */
|
||||
#define SYSCTL_NEG_ONE ((void *)&sysctl_vals[0])
|
||||
#define SYSCTL_ZERO ((void *)&sysctl_vals[1])
|
||||
#define SYSCTL_ONE ((void *)&sysctl_vals[2])
|
||||
#define SYSCTL_TWO ((void *)&sysctl_vals[3])
|
||||
#define SYSCTL_FOUR ((void *)&sysctl_vals[4])
|
||||
#define SYSCTL_ONE_HUNDRED ((void *)&sysctl_vals[5])
|
||||
#define SYSCTL_TWO_HUNDRED ((void *)&sysctl_vals[6])
|
||||
#define SYSCTL_ONE_THOUSAND ((void *)&sysctl_vals[7])
|
||||
#define SYSCTL_THREE_THOUSAND ((void *)&sysctl_vals[8])
|
||||
#define SYSCTL_INT_MAX ((void *)&sysctl_vals[9])
|
||||
#define SYSCTL_NEG_ONE ((void *)&sysctl_vals_new[0])
|
||||
#define SYSCTL_ZERO ((void *)&sysctl_vals_new[1])
|
||||
#define SYSCTL_ONE ((void *)&sysctl_vals_new[2])
|
||||
#define SYSCTL_TWO ((void *)&sysctl_vals_new[3])
|
||||
#define SYSCTL_FOUR ((void *)&sysctl_vals_new[4])
|
||||
#define SYSCTL_ONE_HUNDRED ((void *)&sysctl_vals_new[5])
|
||||
#define SYSCTL_TWO_HUNDRED ((void *)&sysctl_vals_new[6])
|
||||
#define SYSCTL_ONE_THOUSAND ((void *)&sysctl_vals_new[7])
|
||||
#define SYSCTL_THREE_THOUSAND ((void *)&sysctl_vals_new[8])
|
||||
#define SYSCTL_INT_MAX ((void *)&sysctl_vals_new[9])
|
||||
|
||||
extern const int sysctl_vals[];
|
||||
extern const int sysctl_vals_new[];
|
||||
|
||||
typedef int proc_handler(struct ctl_table *ctl, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos);
|
||||
|
||||
Reference in New Issue
Block a user