* [PATCH 07/20] video: sn9c102: world-wirtable sysfs files [not found] <cover.1296818921.git.segoon@openwall.com> @ 2011-02-04 12:23 ` Vasiliy Kulikov 2011-02-04 15:29 ` Mauro Carvalho Chehab 2011-02-04 20:28 ` Luca Risolia 2011-03-12 20:23 ` [PATCH 00/20] world-writable files in sysfs and debugfs Vasiliy Kulikov 1 sibling, 2 replies; 12+ messages in thread From: Vasiliy Kulikov @ 2011-02-04 12:23 UTC (permalink / raw) To: linux-kernel Cc: security, Luca Risolia, Mauro Carvalho Chehab, linux-usb, linux-media Don't allow everybody to change video settings. Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> --- Compile tested only. drivers/media/video/sn9c102/sn9c102_core.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c index 84984f6..ce56a1c 100644 --- a/drivers/media/video/sn9c102/sn9c102_core.c +++ b/drivers/media/video/sn9c102/sn9c102_core.c @@ -1430,9 +1430,9 @@ static DEVICE_ATTR(i2c_reg, S_IRUGO | S_IWUSR, sn9c102_show_i2c_reg, sn9c102_store_i2c_reg); static DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR, sn9c102_show_i2c_val, sn9c102_store_i2c_val); -static DEVICE_ATTR(green, S_IWUGO, NULL, sn9c102_store_green); -static DEVICE_ATTR(blue, S_IWUGO, NULL, sn9c102_store_blue); -static DEVICE_ATTR(red, S_IWUGO, NULL, sn9c102_store_red); +static DEVICE_ATTR(green, S_IWUSR, NULL, sn9c102_store_green); +static DEVICE_ATTR(blue, S_IWUSR, NULL, sn9c102_store_blue); +static DEVICE_ATTR(red, S_IWUSR, NULL, sn9c102_store_red); static DEVICE_ATTR(frame_header, S_IRUGO, sn9c102_show_frame_header, NULL); -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 07/20] video: sn9c102: world-wirtable sysfs files 2011-02-04 12:23 ` [PATCH 07/20] video: sn9c102: world-wirtable sysfs files Vasiliy Kulikov @ 2011-02-04 15:29 ` Mauro Carvalho Chehab 2011-02-04 20:28 ` Luca Risolia 1 sibling, 0 replies; 12+ messages in thread From: Mauro Carvalho Chehab @ 2011-02-04 15:29 UTC (permalink / raw) To: Vasiliy Kulikov Cc: linux-kernel, security, Luca Risolia, linux-usb, linux-media Em 04-02-2011 10:23, Vasiliy Kulikov escreveu: > Don't allow everybody to change video settings. > > Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> > --- > Compile tested only. > > drivers/media/video/sn9c102/sn9c102_core.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c > index 84984f6..ce56a1c 100644 > --- a/drivers/media/video/sn9c102/sn9c102_core.c > +++ b/drivers/media/video/sn9c102/sn9c102_core.c > @@ -1430,9 +1430,9 @@ static DEVICE_ATTR(i2c_reg, S_IRUGO | S_IWUSR, > sn9c102_show_i2c_reg, sn9c102_store_i2c_reg); > static DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR, > sn9c102_show_i2c_val, sn9c102_store_i2c_val); > -static DEVICE_ATTR(green, S_IWUGO, NULL, sn9c102_store_green); > -static DEVICE_ATTR(blue, S_IWUGO, NULL, sn9c102_store_blue); > -static DEVICE_ATTR(red, S_IWUGO, NULL, sn9c102_store_red); > +static DEVICE_ATTR(green, S_IWUSR, NULL, sn9c102_store_green); > +static DEVICE_ATTR(blue, S_IWUSR, NULL, sn9c102_store_blue); > +static DEVICE_ATTR(red, S_IWUSR, NULL, sn9c102_store_red); > static DEVICE_ATTR(frame_header, S_IRUGO, sn9c102_show_frame_header, NULL); Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 07/20] video: sn9c102: world-wirtable sysfs files 2011-02-04 12:23 ` [PATCH 07/20] video: sn9c102: world-wirtable sysfs files Vasiliy Kulikov 2011-02-04 15:29 ` Mauro Carvalho Chehab @ 2011-02-04 20:28 ` Luca Risolia 1 sibling, 0 replies; 12+ messages in thread From: Luca Risolia @ 2011-02-04 20:28 UTC (permalink / raw) To: Vasiliy Kulikov Cc: linux-kernel, security, Mauro Carvalho Chehab, linux-usb, linux-media Thanks. Acked-by: Luca Risolia <luca.risolia@studio.unibo.it> Vasiliy Kulikov ha scritto: > Don't allow everybody to change video settings. > > Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> > --- > Compile tested only. > > drivers/media/video/sn9c102/sn9c102_core.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c > index 84984f6..ce56a1c 100644 > --- a/drivers/media/video/sn9c102/sn9c102_core.c > +++ b/drivers/media/video/sn9c102/sn9c102_core.c > @@ -1430,9 +1430,9 @@ static DEVICE_ATTR(i2c_reg, S_IRUGO | S_IWUSR, > sn9c102_show_i2c_reg, sn9c102_store_i2c_reg); > static DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR, > sn9c102_show_i2c_val, sn9c102_store_i2c_val); > -static DEVICE_ATTR(green, S_IWUGO, NULL, sn9c102_store_green); > -static DEVICE_ATTR(blue, S_IWUGO, NULL, sn9c102_store_blue); > -static DEVICE_ATTR(red, S_IWUGO, NULL, sn9c102_store_red); > +static DEVICE_ATTR(green, S_IWUSR, NULL, sn9c102_store_green); > +static DEVICE_ATTR(blue, S_IWUSR, NULL, sn9c102_store_blue); > +static DEVICE_ATTR(red, S_IWUSR, NULL, sn9c102_store_red); > static DEVICE_ATTR(frame_header, S_IRUGO, sn9c102_show_frame_header, NULL); > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 00/20] world-writable files in sysfs and debugfs [not found] <cover.1296818921.git.segoon@openwall.com> 2011-02-04 12:23 ` [PATCH 07/20] video: sn9c102: world-wirtable sysfs files Vasiliy Kulikov @ 2011-03-12 20:23 ` Vasiliy Kulikov 2011-03-14 22:18 ` [Security] " Andrew Morton 2011-03-15 2:26 ` James Bottomley 1 sibling, 2 replies; 12+ messages in thread From: Vasiliy Kulikov @ 2011-03-12 20:23 UTC (permalink / raw) To: linux-kernel, linux-omap, linux-arm-kernel, linux-usb, linux-media, platform-driver-x86, acpi4asus-user, rtc-linux, linux-scsi, open-iscsi, security > Vasiliy Kulikov (20): > mach-ux500: mbox-db5500: world-writable sysfs fifo file > leds: lp5521: world-writable sysfs engine* files > leds: lp5523: world-writable engine* sysfs files > misc: ep93xx_pwm: world-writable sysfs files > rtc: rtc-ds1511: world-writable sysfs nvram file > scsi: aic94xx: world-writable sysfs update_bios file > scsi: iscsi: world-writable sysfs priv_sess file These are still not merged :( ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Security] [PATCH 00/20] world-writable files in sysfs and debugfs 2011-03-12 20:23 ` [PATCH 00/20] world-writable files in sysfs and debugfs Vasiliy Kulikov @ 2011-03-14 22:18 ` Andrew Morton 2011-03-15 2:26 ` James Bottomley 1 sibling, 0 replies; 12+ messages in thread From: Andrew Morton @ 2011-03-14 22:18 UTC (permalink / raw) To: Vasiliy Kulikov Cc: linux-kernel, linux-omap, linux-arm-kernel, linux-usb, linux-media, platform-driver-x86, acpi4asus-user, rtc-linux, linux-scsi, open-iscsi, security On Sat, 12 Mar 2011 23:23:06 +0300 Vasiliy Kulikov <segoon@openwall.com> wrote: > > Vasiliy Kulikov (20): > > mach-ux500: mbox-db5500: world-writable sysfs fifo file > > leds: lp5521: world-writable sysfs engine* files > > leds: lp5523: world-writable engine* sysfs files > > misc: ep93xx_pwm: world-writable sysfs files > > rtc: rtc-ds1511: world-writable sysfs nvram file > > scsi: aic94xx: world-writable sysfs update_bios file > > scsi: iscsi: world-writable sysfs priv_sess file > > These are still not merged :( I grabbed them and shall merge some and send others at relevant maintainers, thanks. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 00/20] world-writable files in sysfs and debugfs 2011-03-12 20:23 ` [PATCH 00/20] world-writable files in sysfs and debugfs Vasiliy Kulikov 2011-03-14 22:18 ` [Security] " Andrew Morton @ 2011-03-15 2:26 ` James Bottomley 2011-03-15 3:09 ` [Security] " Greg KH 1 sibling, 1 reply; 12+ messages in thread From: James Bottomley @ 2011-03-15 2:26 UTC (permalink / raw) To: Vasiliy Kulikov Cc: linux-kernel, linux-omap, linux-arm-kernel, linux-usb, linux-media, platform-driver-x86, acpi4asus-user, rtc-linux, linux-scsi, open-iscsi, security On Sat, 2011-03-12 at 23:23 +0300, Vasiliy Kulikov wrote: > > Vasiliy Kulikov (20): > > mach-ux500: mbox-db5500: world-writable sysfs fifo file > > leds: lp5521: world-writable sysfs engine* files > > leds: lp5523: world-writable engine* sysfs files > > misc: ep93xx_pwm: world-writable sysfs files > > rtc: rtc-ds1511: world-writable sysfs nvram file > > scsi: aic94xx: world-writable sysfs update_bios file > > scsi: iscsi: world-writable sysfs priv_sess file > > These are still not merged :( OK, so I've not been tracking where we are in the dizzying ride on security systems. However, I thought we landed up in the privilege separation arena using capabilities. That means that world writeable files aren't necessarily a problem as long as the correct capabilities checks are in place, right? James ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Security] [PATCH 00/20] world-writable files in sysfs and debugfs 2011-03-15 2:26 ` James Bottomley @ 2011-03-15 3:09 ` Greg KH 2011-03-15 11:50 ` James Bottomley 0 siblings, 1 reply; 12+ messages in thread From: Greg KH @ 2011-03-15 3:09 UTC (permalink / raw) To: James Bottomley Cc: Vasiliy Kulikov, security, acpi4asus-user, linux-scsi, rtc-linux, linux-usb, linux-kernel, platform-driver-x86, open-iscsi, linux-omap, linux-arm-kernel, linux-media On Mon, Mar 14, 2011 at 10:26:05PM -0400, James Bottomley wrote: > On Sat, 2011-03-12 at 23:23 +0300, Vasiliy Kulikov wrote: > > > Vasiliy Kulikov (20): > > > mach-ux500: mbox-db5500: world-writable sysfs fifo file > > > leds: lp5521: world-writable sysfs engine* files > > > leds: lp5523: world-writable engine* sysfs files > > > misc: ep93xx_pwm: world-writable sysfs files > > > rtc: rtc-ds1511: world-writable sysfs nvram file > > > scsi: aic94xx: world-writable sysfs update_bios file > > > scsi: iscsi: world-writable sysfs priv_sess file > > > > These are still not merged :( > > OK, so I've not been tracking where we are in the dizzying ride on > security systems. However, I thought we landed up in the privilege > separation arena using capabilities. That means that world writeable > files aren't necessarily a problem as long as the correct capabilities > checks are in place, right? There are no capability checks on sysfs files right now, so these all need to be fixed. thanks, greg k-h ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Security] [PATCH 00/20] world-writable files in sysfs and debugfs 2011-03-15 3:09 ` [Security] " Greg KH @ 2011-03-15 11:50 ` James Bottomley 2011-03-15 14:18 ` Greg KH 2011-03-15 16:08 ` Vasiliy Kulikov 0 siblings, 2 replies; 12+ messages in thread From: James Bottomley @ 2011-03-15 11:50 UTC (permalink / raw) To: Greg KH Cc: Vasiliy Kulikov, security, acpi4asus-user, linux-scsi, rtc-linux, linux-usb, linux-kernel, platform-driver-x86, open-iscsi, linux-omap, linux-arm-kernel, linux-media On Mon, 2011-03-14 at 20:09 -0700, Greg KH wrote: > On Mon, Mar 14, 2011 at 10:26:05PM -0400, James Bottomley wrote: > > On Sat, 2011-03-12 at 23:23 +0300, Vasiliy Kulikov wrote: > > > > Vasiliy Kulikov (20): > > > > mach-ux500: mbox-db5500: world-writable sysfs fifo file > > > > leds: lp5521: world-writable sysfs engine* files > > > > leds: lp5523: world-writable engine* sysfs files > > > > misc: ep93xx_pwm: world-writable sysfs files > > > > rtc: rtc-ds1511: world-writable sysfs nvram file > > > > scsi: aic94xx: world-writable sysfs update_bios file > > > > scsi: iscsi: world-writable sysfs priv_sess file > > > > > > These are still not merged :( > > > > OK, so I've not been tracking where we are in the dizzying ride on > > security systems. However, I thought we landed up in the privilege > > separation arena using capabilities. That means that world writeable > > files aren't necessarily a problem as long as the correct capabilities > > checks are in place, right? > > There are no capability checks on sysfs files right now, so these all > need to be fixed. That statement is true but irrelevant, isn't it? There can't be capabilities within sysfs files because the system that does them has no idea what the capabilities would be. If there were capabilities checks, they'd have to be in the implementing routines. I think the questions are twofold: 1. Did anyone actually check for capabilities before assuming world writeable files were wrong? 2. Even if there aren't any capabilities checks in the implementing routines, should there be (are we going the separated capabilities route vs the monolithic root route)? James ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Security] [PATCH 00/20] world-writable files in sysfs and debugfs 2011-03-15 11:50 ` James Bottomley @ 2011-03-15 14:18 ` Greg KH 2011-03-15 14:25 ` James Bottomley 2011-03-15 16:08 ` Vasiliy Kulikov 1 sibling, 1 reply; 12+ messages in thread From: Greg KH @ 2011-03-15 14:18 UTC (permalink / raw) To: James Bottomley Cc: Vasiliy Kulikov, security, acpi4asus-user, linux-scsi, rtc-linux, linux-usb, linux-kernel, platform-driver-x86, open-iscsi, linux-omap, linux-arm-kernel, linux-media On Tue, Mar 15, 2011 at 07:50:28AM -0400, James Bottomley wrote: > On Mon, 2011-03-14 at 20:09 -0700, Greg KH wrote: > > On Mon, Mar 14, 2011 at 10:26:05PM -0400, James Bottomley wrote: > > > On Sat, 2011-03-12 at 23:23 +0300, Vasiliy Kulikov wrote: > > > > > Vasiliy Kulikov (20): > > > > > mach-ux500: mbox-db5500: world-writable sysfs fifo file > > > > > leds: lp5521: world-writable sysfs engine* files > > > > > leds: lp5523: world-writable engine* sysfs files > > > > > misc: ep93xx_pwm: world-writable sysfs files > > > > > rtc: rtc-ds1511: world-writable sysfs nvram file > > > > > scsi: aic94xx: world-writable sysfs update_bios file > > > > > scsi: iscsi: world-writable sysfs priv_sess file > > > > > > > > These are still not merged :( > > > > > > OK, so I've not been tracking where we are in the dizzying ride on > > > security systems. However, I thought we landed up in the privilege > > > separation arena using capabilities. That means that world writeable > > > files aren't necessarily a problem as long as the correct capabilities > > > checks are in place, right? > > > > There are no capability checks on sysfs files right now, so these all > > need to be fixed. > > That statement is true but irrelevant, isn't it? There can't be > capabilities within sysfs files because the system that does them has no > idea what the capabilities would be. If there were capabilities checks, > they'd have to be in the implementing routines. Ah, you are correct, sorry for the misunderstanding. > I think the questions are twofold: > > 1. Did anyone actually check for capabilities before assuming world > writeable files were wrong? I do not think so as the majority (i.e. all the ones that I looked at) did no such checks. > 2. Even if there aren't any capabilities checks in the implementing > routines, should there be (are we going the separated > capabilities route vs the monolithic root route)? I think the general consensus is that we go the monolithic root route for sysfs files in that we do not allow them to be world writable. Do you have any exceptions that you know of that do these checks? thanks, greg k-h ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Security] [PATCH 00/20] world-writable files in sysfs and debugfs 2011-03-15 14:18 ` Greg KH @ 2011-03-15 14:25 ` James Bottomley 0 siblings, 0 replies; 12+ messages in thread From: James Bottomley @ 2011-03-15 14:25 UTC (permalink / raw) To: Greg KH Cc: Vasiliy Kulikov, security, acpi4asus-user, linux-scsi, rtc-linux, linux-usb, linux-kernel, platform-driver-x86, open-iscsi, linux-omap, linux-arm-kernel, linux-media On Tue, 2011-03-15 at 07:18 -0700, Greg KH wrote: > On Tue, Mar 15, 2011 at 07:50:28AM -0400, James Bottomley wrote: > > On Mon, 2011-03-14 at 20:09 -0700, Greg KH wrote: > > > There are no capability checks on sysfs files right now, so these all > > > need to be fixed. > > > > That statement is true but irrelevant, isn't it? There can't be > > capabilities within sysfs files because the system that does them has no > > idea what the capabilities would be. If there were capabilities checks, > > they'd have to be in the implementing routines. > > Ah, you are correct, sorry for the misunderstanding. > > > I think the questions are twofold: > > > > 1. Did anyone actually check for capabilities before assuming world > > writeable files were wrong? > > I do not think so as the majority (i.e. all the ones that I looked at) > did no such checks. OK, as long as someone checked, I'm happy. > > 2. Even if there aren't any capabilities checks in the implementing > > routines, should there be (are we going the separated > > capabilities route vs the monolithic root route)? > > I think the general consensus is that we go the monolithic root route > for sysfs files in that we do not allow them to be world writable. > > Do you have any exceptions that you know of that do these checks? Heh, I didn't call our security vacillations a dizzying ride for nothing. I know the goal once was to try to run a distro without root daemons (which is what required the capabilities stuff). I'm actually trying to avoid the issue ... I just want to make sure that people who care aren't all moving in different directions. James ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Security] [PATCH 00/20] world-writable files in sysfs and debugfs 2011-03-15 11:50 ` James Bottomley 2011-03-15 14:18 ` Greg KH @ 2011-03-15 16:08 ` Vasiliy Kulikov 2011-03-15 16:32 ` James Bottomley 1 sibling, 1 reply; 12+ messages in thread From: Vasiliy Kulikov @ 2011-03-15 16:08 UTC (permalink / raw) To: James Bottomley Cc: Greg KH, security, acpi4asus-user, linux-scsi, rtc-linux, linux-usb, linux-kernel, platform-driver-x86, open-iscsi, linux-omap, linux-arm-kernel, linux-media On Tue, Mar 15, 2011 at 07:50 -0400, James Bottomley wrote: > 1. Did anyone actually check for capabilities before assuming world > writeable files were wrong? I didn't check all these files as I haven't got these hardware :-) But as I can "chmod a+w" all sysfs files on my machine and they all become sensible to nonroot writes, I suppose there is nothing preventing nonroot users from writing to these buggy sysfs files. As you can see, there are no capable() checks in these drivers in open() or write(). > 2. Even if there aren't any capabilities checks in the implementing > routines, should there be (are we going the separated > capabilities route vs the monolithic root route)? IMO, In any case old good DAC security model must not be obsoleted just because someone thinks that MAC or anything else is more convenient for him. If sysfs is implemented via filesystem then it must support POSIX permissions semantic. MAC is very good in _some_ cases, but not instead of DAC. Thanks, -- Vasiliy Kulikov http://www.openwall.com - bringing security into open computing environments ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Security] [PATCH 00/20] world-writable files in sysfs and debugfs 2011-03-15 16:08 ` Vasiliy Kulikov @ 2011-03-15 16:32 ` James Bottomley 0 siblings, 0 replies; 12+ messages in thread From: James Bottomley @ 2011-03-15 16:32 UTC (permalink / raw) To: Vasiliy Kulikov Cc: Greg KH, security, acpi4asus-user, linux-scsi, rtc-linux, linux-usb, linux-kernel, platform-driver-x86, open-iscsi, linux-omap, linux-arm-kernel, linux-media On Tue, 2011-03-15 at 19:08 +0300, Vasiliy Kulikov wrote: > On Tue, Mar 15, 2011 at 07:50 -0400, James Bottomley wrote: > > 1. Did anyone actually check for capabilities before assuming world > > writeable files were wrong? > > I didn't check all these files as I haven't got these hardware :-) You don't need the hardware to check ... the question becomes is a capabilities test sitting in the implementation or not. > But > as I can "chmod a+w" all sysfs files on my machine and they all become > sensible to nonroot writes, I suppose there is nothing preventing > nonroot users from writing to these buggy sysfs files. As you can see, > there are no capable() checks in these drivers in open() or write(). > > > 2. Even if there aren't any capabilities checks in the implementing > > routines, should there be (are we going the separated > > capabilities route vs the monolithic root route)? > > IMO, In any case old good DAC security model must not be obsoleted just > because someone thinks that MAC or anything else is more convenient for > him. If sysfs is implemented via filesystem then it must support POSIX > permissions semantic. MAC is very good in _some_ cases, but not instead > of DAC. Um, I'm not sure that's even an issue. capabilities have CAP_ADMIN which is precisely the same check as owner == root. We use this a lot because ioctls ignore the standard unix DAC model. James ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-03-15 16:32 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1296818921.git.segoon@openwall.com>
2011-02-04 12:23 ` [PATCH 07/20] video: sn9c102: world-wirtable sysfs files Vasiliy Kulikov
2011-02-04 15:29 ` Mauro Carvalho Chehab
2011-02-04 20:28 ` Luca Risolia
2011-03-12 20:23 ` [PATCH 00/20] world-writable files in sysfs and debugfs Vasiliy Kulikov
2011-03-14 22:18 ` [Security] " Andrew Morton
2011-03-15 2:26 ` James Bottomley
2011-03-15 3:09 ` [Security] " Greg KH
2011-03-15 11:50 ` James Bottomley
2011-03-15 14:18 ` Greg KH
2011-03-15 14:25 ` James Bottomley
2011-03-15 16:08 ` Vasiliy Kulikov
2011-03-15 16:32 ` James Bottomley
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox