mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/7] procfs privacy: /proc/bus/pci
@ 2005-04-18 18:33 Lorenzo Hernández García-Hierro
  2005-04-18 19:29 ` Jesper Juhl
  0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Hernández García-Hierro @ 2005-04-18 18:33 UTC (permalink / raw)
  To: linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 367 bytes --]

This patch changes the permissions of the /proc/bus/pci directory entry,
so, non-root users are restricted of accessing it's content.

It's also available at:
http://pearls.tuxedo-es.org/patches/security/proc-privacy-1_drivers_pci_proc.c.patch

-- 
Lorenzo Hernández García-Hierro <lorenzo@gnu.org> 
[1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org]

[-- Attachment #1.2: proc-privacy-1_drivers_pci_proc.c.patch --]
[-- Type: text/x-patch, Size: 930 bytes --]

diff -puN drivers/pci/proc.c~proc-privacy-1 drivers/pci/proc.c
--- linux-2.6.11/drivers/pci/proc.c~proc-privacy-1	2005-04-17 17:50:49.033817704 +0200
+++ linux-2.6.11-lorenzo/drivers/pci/proc.c	2005-04-17 17:55:11.321943848 +0200
@@ -565,7 +565,7 @@ static struct file_operations proc_pci_o
 
 static void legacy_proc_init(void)
 {
-	struct proc_dir_entry * entry = create_proc_entry("pci", 0, NULL);
+	struct proc_dir_entry * entry = create_proc_entry("pci", S_IRUSR, NULL);
 	if (entry)
 		entry->proc_fops = &proc_pci_operations;
 }
@@ -594,7 +594,7 @@ static int __init pci_proc_init(void)
 {
 	struct proc_dir_entry *entry;
 	struct pci_dev *dev = NULL;
-	proc_bus_pci_dir = proc_mkdir("pci", proc_bus);
+	proc_bus_pci_dir = proc_mkdir_mode("pci", S_IRUSR | S_IXUSR, proc_bus);
 	entry = create_proc_entry("devices", 0, proc_bus_pci_dir);
 	if (entry)
 		entry->proc_fops = &proc_bus_pci_dev_operations;

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/7] procfs privacy: /proc/bus/pci
  2005-04-18 18:33 [PATCH 1/7] procfs privacy: /proc/bus/pci Lorenzo Hernández García-Hierro
@ 2005-04-18 19:29 ` Jesper Juhl
  0 siblings, 0 replies; 2+ messages in thread
From: Jesper Juhl @ 2005-04-18 19:29 UTC (permalink / raw)
  To: Lorenzo Hernández García-Hierro; +Cc: linux-kernel

On Mon, 18 Apr 2005, Lorenzo Hernández García-Hierro wrote:

> This patch changes the permissions of the /proc/bus/pci directory entry,
> so, non-root users are restricted of accessing it's content.
> It's also available at:
> http://pearls.tuxedo-es.org/patches/security/proc-privacy-1_drivers_pci_
> proc.c.patch
> -- 
> Lorenzo Hernández García-Hierro <lorenzo@gnu.org> 
> [1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org]
> 
> 
> begin 600 proc-privacy-1_drivers_pci_proc.c.patch
> M9&EF9B`M<'5.(&1R:79E<G,O<&-I+W!R;V,N8WYP<F]C+7!R:79A8WDM,2!D
> M<FEV97)S+W!C:2]P<F]C+F,-"BTM+2!L:6YU>"TR+C8N,3$O9')I=F5R<R]P
> M8VDO<')O8RYC?G!R;V,M<')I=F%C>2TQ"3(P,#4M,#0M,3<@,3<Z-3`Z-#DN
[snip]

Please send patches inline in emails. Not uuencoded, not as attachments, 
just plain inline text.


-- 
Jesper Juhl



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-18 19:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-18 18:33 [PATCH 1/7] procfs privacy: /proc/bus/pci Lorenzo Hernández García-Hierro
2005-04-18 19:29 ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®