aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2010-12-10 13:56:18 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-10 13:56:18 -0500
commit983bbfd091be5b3e1a729f31cce29431fbff2d27 (patch)
treec86c0bce6f744993b2daa641e60559aec35bdced /drivers
parent64d74c6cbe52fbec90ead8f3bf53bfb10a1540d5 (diff)
Staging: iio: fix up world writable sysfs files.
You should not be able to write to sysfs files from any user. Cc: Graf Yang <graf.yang@analog.com> Cc: Michael Hennerich <michael.hennerich@analog.com> Cc: Jonathan Cameron <jic23@cam.ac.uk> Cc: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/iio/resolver/ad2s1210.c28
-rw-r--r--drivers/staging/iio/sysfs.h2
2 files changed, 15 insertions, 15 deletions
diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
index 34fb21aa8b0..c12f64cc40d 100644
--- a/drivers/staging/iio/resolver/ad2s1210.c
+++ b/drivers/staging/iio/resolver/ad2s1210.c
@@ -661,19 +661,19 @@ error_ret:
661static IIO_CONST_ATTR(description, 661static IIO_CONST_ATTR(description,
662 "Variable Resolution, 10-Bit to 16Bit R/D\n\ 662 "Variable Resolution, 10-Bit to 16Bit R/D\n\
663Converter with Reference Oscillator"); 663Converter with Reference Oscillator");
664static IIO_DEVICE_ATTR(raw_io, S_IRUGO | S_IWUGO, 664static IIO_DEVICE_ATTR(raw_io, S_IRUGO | S_IWUSR,
665 ad2s1210_show_raw, ad2s1210_store_raw, 0); 665 ad2s1210_show_raw, ad2s1210_store_raw, 0);
666static IIO_DEVICE_ATTR(reset, S_IWUGO, 666static IIO_DEVICE_ATTR(reset, S_IWUSR,
667 NULL, ad2s1210_store_softreset, 0); 667 NULL, ad2s1210_store_softreset, 0);
668static IIO_DEVICE_ATTR(fclkin, S_IRUGO | S_IWUGO, 668static IIO_DEVICE_ATTR(fclkin, S_IRUGO | S_IWUSR,
669 ad2s1210_show_fclkin, ad2s1210_store_fclkin, 0); 669 ad2s1210_show_fclkin, ad2s1210_store_fclkin, 0);
670static IIO_DEVICE_ATTR(fexcit, S_IRUGO | S_IWUGO, 670static IIO_DEVICE_ATTR(fexcit, S_IRUGO | S_IWUSR,
671 ad2s1210_show_fexcit, ad2s1210_store_fexcit, 0); 671 ad2s1210_show_fexcit, ad2s1210_store_fexcit, 0);
672static IIO_DEVICE_ATTR(control, S_IRUGO | S_IWUGO, 672static IIO_DEVICE_ATTR(control, S_IRUGO | S_IWUSR,
673 ad2s1210_show_control, ad2s1210_store_control, 0); 673 ad2s1210_show_control, ad2s1210_store_control, 0);
674static IIO_DEVICE_ATTR(bits, S_IRUGO | S_IWUGO, 674static IIO_DEVICE_ATTR(bits, S_IRUGO | S_IWUSR,
675 ad2s1210_show_resolution, ad2s1210_store_resolution, 0); 675 ad2s1210_show_resolution, ad2s1210_store_resolution, 0);
676static IIO_DEVICE_ATTR(fault, S_IRUGO | S_IWUGO, 676static IIO_DEVICE_ATTR(fault, S_IRUGO | S_IWUSR,
677 ad2s1210_show_fault, ad2s1210_clear_fault, 0); 677 ad2s1210_show_fault, ad2s1210_clear_fault, 0);
678static IIO_DEVICE_ATTR(pos, S_IRUGO, 678static IIO_DEVICE_ATTR(pos, S_IRUGO,
679 ad2s1210_show_pos, NULL, 0); 679 ad2s1210_show_pos, NULL, 0);
@@ -681,19 +681,19 @@ static IIO_DEVICE_ATTR(vel, S_IRUGO,
681 ad2s1210_show_vel, NULL, 0); 681 ad2s1210_show_vel, NULL, 0);
682static IIO_DEVICE_ATTR(pos_vel, S_IRUGO, 682static IIO_DEVICE_ATTR(pos_vel, S_IRUGO,
683 ad2s1210_show_pos_vel, NULL, 0); 683 ad2s1210_show_pos_vel, NULL, 0);
684static IIO_DEVICE_ATTR(los_thrd, S_IRUGO | S_IWUGO, 684static IIO_DEVICE_ATTR(los_thrd, S_IRUGO | S_IWUSR,
685 ad2s1210_show_reg, ad2s1210_store_reg, REG_LOS_THRD); 685 ad2s1210_show_reg, ad2s1210_store_reg, REG_LOS_THRD);
686static IIO_DEVICE_ATTR(dos_ovr_thrd, S_IRUGO | S_IWUGO, 686static IIO_DEVICE_ATTR(dos_ovr_thrd, S_IRUGO | S_IWUSR,
687 ad2s1210_show_reg, ad2s1210_store_reg, REG_DOS_OVR_THRD); 687 ad2s1210_show_reg, ad2s1210_store_reg, REG_DOS_OVR_THRD);
688static IIO_DEVICE_ATTR(dos_mis_thrd, S_IRUGO | S_IWUGO, 688static IIO_DEVICE_ATTR(dos_mis_thrd, S_IRUGO | S_IWUSR,
689 ad2s1210_show_reg, ad2s1210_store_reg, REG_DOS_MIS_THRD); 689 ad2s1210_show_reg, ad2s1210_store_reg, REG_DOS_MIS_THRD);
690static IIO_DEVICE_ATTR(dos_rst_max_thrd, S_IRUGO | S_IWUGO, 690static IIO_DEVICE_ATTR(dos_rst_max_thrd, S_IRUGO | S_IWUSR,
691 ad2s1210_show_reg, ad2s1210_store_reg, REG_DOS_RST_MAX_THRD); 691 ad2s1210_show_reg, ad2s1210_store_reg, REG_DOS_RST_MAX_THRD);
692static IIO_DEVICE_ATTR(dos_rst_min_thrd, S_IRUGO | S_IWUGO, 692static IIO_DEVICE_ATTR(dos_rst_min_thrd, S_IRUGO | S_IWUSR,
693 ad2s1210_show_reg, ad2s1210_store_reg, REG_DOS_RST_MIN_THRD); 693 ad2s1210_show_reg, ad2s1210_store_reg, REG_DOS_RST_MIN_THRD);
694static IIO_DEVICE_ATTR(lot_high_thrd, S_IRUGO | S_IWUGO, 694static IIO_DEVICE_ATTR(lot_high_thrd, S_IRUGO | S_IWUSR,
695 ad2s1210_show_reg, ad2s1210_store_reg, REG_LOT_HIGH_THRD); 695 ad2s1210_show_reg, ad2s1210_store_reg, REG_LOT_HIGH_THRD);
696static IIO_DEVICE_ATTR(lot_low_thrd, S_IRUGO | S_IWUGO, 696static IIO_DEVICE_ATTR(lot_low_thrd, S_IRUGO | S_IWUSR,
697 ad2s1210_show_reg, ad2s1210_store_reg, REG_LOT_LOW_THRD); 697 ad2s1210_show_reg, ad2s1210_store_reg, REG_LOT_LOW_THRD);
698 698
699static struct attribute *ad2s1210_attributes[] = { 699static struct attribute *ad2s1210_attributes[] = {
diff --git a/drivers/staging/iio/sysfs.h b/drivers/staging/iio/sysfs.h
index 18bdaac2509..24b74ddcd08 100644
--- a/drivers/staging/iio/sysfs.h
+++ b/drivers/staging/iio/sysfs.h
@@ -111,7 +111,7 @@ struct iio_const_attr {
111 * IIO_DEV_ATTR_RESET: resets the device 111 * IIO_DEV_ATTR_RESET: resets the device
112 **/ 112 **/
113#define IIO_DEV_ATTR_RESET(_store) \ 113#define IIO_DEV_ATTR_RESET(_store) \
114 IIO_DEVICE_ATTR(reset, S_IWUGO, NULL, _store, 0) 114 IIO_DEVICE_ATTR(reset, S_IWUSR, NULL, _store, 0)
115 115
116/** 116/**
117 * IIO_CONST_ATTR_NAME - constant identifier 117 * IIO_CONST_ATTR_NAME - constant identifier