[0/6] sysctl: Remove register_sysctl_table from parport

Message ID 20230515071446.2277292-1-j.granados@samsung.com
Headers
Series sysctl: Remove register_sysctl_table from parport |

Message

Joel Granados May 15, 2023, 7:14 a.m. UTC
  This is part of the general push to deprecate register_sysctl_paths and
register_sysctl_table. Parport driver uses the "CHILD" pointer
in the ctl_table structure to create its directory structure. We move to
the newer register_sysctl call and remove the pointer madness.

I have separated the parport into 5 patches to clarify the different
changes needed for the 3 calls to register_sysctl_paths. I can squash
them together if need be.

We no longer export the register_sysctl_table call as parport was the
last user from outside proc_sysctl.c. Also modified documentation slightly
so register_sysctl_table is no longer mentioned.

I'm waiting on the 0-day tests results.

Best
Joel

Joel Granados (6):
  parport: Move magic number "15" to a define
  parport: Remove register_sysctl_table from parport_proc_register
  parport: Remove register_sysctl_table from
    parport_device_proc_register
  parport: Remove register_sysctl_table from
    parport_default_proc_register
  parport: Removed sysctl related defines
  sysctl: stop exporting register_sysctl_table

 drivers/parport/procfs.c | 171 +++++++++++++++++++++------------------
 drivers/parport/share.c  |   2 +-
 fs/proc/proc_sysctl.c    |   5 +-
 include/linux/parport.h  |   2 +
 include/linux/sysctl.h   |   8 +-
 5 files changed, 97 insertions(+), 91 deletions(-)
  

Comments

Luis Chamberlain May 15, 2023, 8:24 p.m. UTC | #1
On Mon, May 15, 2023 at 09:14:40AM +0200, Joel Granados wrote:
> This is part of the general push to deprecate register_sysctl_paths and
> register_sysctl_table. Parport driver uses the "CHILD" pointer
> in the ctl_table structure to create its directory structure. We move to
> the newer register_sysctl call and remove the pointer madness.

Nice! Thanks for doing this and unwinding the sysctl use case which
takes the cake for the obfuscation use case of sysctls.

> I have separated the parport into 5 patches to clarify the different
> changes needed for the 3 calls to register_sysctl_paths. I can squash
> them together if need be.

I think it makes sense to keep them that way.

> We no longer export the register_sysctl_table call as parport was the
> last user from outside proc_sysctl.c. Also modified documentation slightly
> so register_sysctl_table is no longer mentioned.

We can go further, but I'll explain in patch review on the patches.

> I'm waiting on the 0-day tests results.

Nice!

  Luis
  
Joel Granados May 16, 2023, 2:06 p.m. UTC | #2
On Mon, May 15, 2023 at 01:24:06PM -0700, Luis Chamberlain wrote:
> On Mon, May 15, 2023 at 09:14:40AM +0200, Joel Granados wrote:
> > This is part of the general push to deprecate register_sysctl_paths and
> > register_sysctl_table. Parport driver uses the "CHILD" pointer
> > in the ctl_table structure to create its directory structure. We move to
> > the newer register_sysctl call and remove the pointer madness.
> 
> Nice! Thanks for doing this and unwinding the sysctl use case which
> takes the cake for the obfuscation use case of sysctls.
Indeed. They were being very creative :)

> 
> > I have separated the parport into 5 patches to clarify the different
> > changes needed for the 3 calls to register_sysctl_paths. I can squash
> > them together if need be.
> 
> I think it makes sense to keep them that way.
Fine by me :).

> 
> > We no longer export the register_sysctl_table call as parport was the
> > last user from outside proc_sysctl.c. Also modified documentation slightly
> > so register_sysctl_table is no longer mentioned.
> 
> We can go further, but I'll explain in patch review on the patches.
ok

> 
> > I'm waiting on the 0-day tests results.
> 
> Nice!
> 
>   Luis