Skip to content

Commit 57e3707

Browse files
t-8chJoelgranados
authored andcommitted
bpf: Constify ctl_table argument of filter function
The sysctl core is moving to allow "struct ctl_table" in read-only memory. As a preparation for that all functions handling "struct ctl_table" need to be able to work with "const struct ctl_table". As __cgroup_bpf_run_filter_sysctl() does not modify its table, it can be adapted trivially. Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Joel Granados <[email protected]>
1 parent 8cf0b93 commit 57e3707

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/linux/bpf-cgroup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor,
138138
short access, enum cgroup_bpf_attach_type atype);
139139

140140
int __cgroup_bpf_run_filter_sysctl(struct ctl_table_header *head,
141-
struct ctl_table *table, int write,
141+
const struct ctl_table *table, int write,
142142
char **buf, size_t *pcount, loff_t *ppos,
143143
enum cgroup_bpf_attach_type atype);
144144

kernel/bpf/cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ const struct bpf_verifier_ops cg_dev_verifier_ops = {
16911691
* returned value != 1 during execution. In all other cases 0 is returned.
16921692
*/
16931693
int __cgroup_bpf_run_filter_sysctl(struct ctl_table_header *head,
1694-
struct ctl_table *table, int write,
1694+
const struct ctl_table *table, int write,
16951695
char **buf, size_t *pcount, loff_t *ppos,
16961696
enum cgroup_bpf_attach_type atype)
16971697
{

0 commit comments

Comments
 (0)