[PATCH] lcd: Add checks to CAP_SYS_ADMIN to potentially dangerous ioctl's

Linux Kernel Mailing List <[email protected]>
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1587, 2005/01/29 14:25:32-02:00, [email protected]

	[PATCH] lcd: Add checks to CAP_SYS_ADMIN to potentially dangerous ioctl's
	
	This patch adds CAP_SYS_ADMIN checks to the potentially dangerous ioctls FLASH_Erase and FLASH_Burn
	in the Cobalt LCD interface driver.
	
	Signed-off-by: James Nelson <[email protected]>



 lcd.c |    4 ++++
 1 files changed, 4 insertions(+)


diff -Nru a/drivers/char/lcd.c b/drivers/char/lcd.c
--- a/drivers/char/lcd.c	2005-01-30 15:37:20 -08:00
+++ b/drivers/char/lcd.c	2005-01-30 15:37:20 -08:00
@@ -386,6 +386,8 @@
 
 		int ctr=0;
 
+		if (!capable(CAP_SYS_ADMIN)) return -EPERM;
+
 		    // Chip Erase Sequence
 		WRITE_FLASH( kFlash_Addr1, kFlash_Data1 );
 		WRITE_FLASH( kFlash_Addr2, kFlash_Data2 );
@@ -421,6 +423,8 @@
 		
 
                 struct lcd_display display;
+
+		if (!capable(CAP_SYS_ADMIN)) return -EPERM;
 
                 if(copy_from_user(&display, (struct lcd_display*)arg, sizeof(struct lcd_display)))
 		  return -EFAULT;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.