Skip to contentSkip to conversation

Incorrect permissions on parport sysctls.

PATCH Dave Jones 3 participants 4 messages Aug 9, 2005 Parallel port

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

We have a bunch of 'probe' sysctl's in parport, which are readable. (world readable even). Make them write-only. Without this, sysctl -a will try to read these files.

drivers/parport/procfs.c renamed from drivers/parport/procfs.c~ +5 -5
@@ -286,19 +286,19 @@ static const struct parport_sysctl_table
 		PARPORT_DEVICES_ROOT_DIR,
 #ifdef CONFIG_PARPORT_1284
 		{ DEV_PARPORT_AUTOPROBE, "autoprobe",
-		  NULL, 0, 0444, NULL,
+		  NULL, 0, 0200, NULL,
 		  &do_autoprobe },
 		{ DEV_PARPORT_AUTOPROBE + 1, "autoprobe0",
-		 NULL, 0, 0444, NULL,
+		 NULL, 0, 0200, NULL,
 		 &do_autoprobe },
 		{ DEV_PARPORT_AUTOPROBE + 2, "autoprobe1",
-		  NULL, 0, 0444, NULL,
+		  NULL, 0, 0200, NULL,
 		  &do_autoprobe },
 		{ DEV_PARPORT_AUTOPROBE + 3, "autoprobe2",
-		  NULL, 0, 0444, NULL,
+		  NULL, 0, 0200, NULL,
 		  &do_autoprobe },
 		{ DEV_PARPORT_AUTOPROBE + 4, "autoprobe3",
-		  NULL, 0, 0444, NULL,
+		  NULL, 0, 0200, NULL,
 		  &do_autoprobe },
 #endif /* IEEE 1284 support */
 		{0}
#1 lore raw
Quoted 4 lines

We have a bunch of 'probe' sysctl's in parport, which are readable. (world readable even). Make them write-only. Without this, sysctl -a will try to read these files.

Why write-only? Donot you want to read back what you've written there sometime? IMO 0600.

Jan Engelhardt

#2 lore raw
In reply to Dave Jones
Quoted 3 lines · Dave Jones

We have a bunch of 'probe' sysctl's in parport, which are readable. (world readable even). Make them write-only. Without this, sysctl -a will try to read these files.

??

This change is wrong. The probing happens at module load time, and the IEEE 1284 device IDs are stored for later retrieval to user space via these sysctls.

They are backed by read-only variables. Reading does not trigger any device interaction.

Make them 0400 if you think it's a security issue: but then, /proc/ide/hda/model etc should also get the same treatment.

Tim.
*/

author
#3 lore raw
Quoted 12 lines · Tim Waugh
Quoted 3 lines · Dave Jones

We have a bunch of 'probe' sysctl's in parport, which are readable. (world readable even). Make them write-only. Without this, sysctl -a will try to read these files.

??

This change is wrong. The probing happens at module load time, and the IEEE 1284 device IDs are stored for later retrieval to user space via these sysctls.

Quoted 5 lines

They are backed by read-only variables. Reading does not trigger any device interaction.

Make them 0400 if you think it's a security issue: but then, /proc/ide/hda/model etc should also get the same treatment.

It wasn't a security related change. As I mentioned above, sysctl -a would fail to read them anyway when I last tried (circa 2.6.9/10)

I'll try and reproduce without that patch later today.

Dave