Re: modules registering as sysctl handlers

Muli Ben-Yehuda
2004-03-03T09:28:21Z

[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

On Wed, Mar 03, 2004 at 11:05:39AM +1100, Rusty Russell wrote:

> Al is referring to the fact that there's no protection for a dynamically
> allocated ctl_table.
>
> However, an owner field and standard module_get() would solve the case
> of statically declared ctl_table.

That's what I had in mind.

> I don't know that there's a current user who requires it though?

Yes, there are. Using the attached scriptlet on a 2.6.1 tree I had
lying around:

[root@hydra kernel]# /tmp/find-register-sysctl
/lib/modules/2.6.1/kernel/drivers/cdrom/cdrom.ko uses register_sysctl
/lib/modules/2.6.1/kernel/drivers/parport/parport.ko uses register_sysctl
/lib/modules/2.6.1/kernel/net/appletalk/appletalk.ko uses register_sysctl
/lib/modules/2.6.1/kernel/net/ipx/ipx.ko uses register_sysctl
/lib/modules/2.6.1/kernel/net/irda/irda.ko uses register_sysctl
/lib/modules/2.6.1/kernel/net/sctp/sctp.ko uses register_sysctl

I'm building 2.6.3-bk with allmodconfig now. Once it's done, I'll post
the resulting list.

#!/bin/sh

KERNEL_VER=2.6.1
for f in `find /lib/modules/${KERNEL_VER} -name "*.ko"`; do
nm $f | grep register_sysctl 2>&1 > /dev/null
if [ "x$?" == "x0" ]; then
echo "$f uses register_sysctl"
fi
done

Cheers,
Muli
--
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]