Skip to content

Commit 31cc48b

Browse files
Mark BellonLinus Torvalds
authored andcommitted
[PATCH] MPBL0010 driver sysfs permissions wide open
The MPBL0010 Telco clock driver (drivers/char/tlclk.c) uses 0222 (anyone can write) permissions on its writable sysfs entries. Alter the permissions to 0220 (owner and group can write). The use case for this driver is to configure the fail over behavior of the clock hardware. That should be done by the more privileged users. Signed-off-by: Mark Bellon <mbellon@mvista.com> Acked-by: "Gross, Mark" <mark.gross@intel.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 14a6283 commit 31cc48b

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

‎drivers/char/tlclk.c‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ static ssize_t store_received_ref_clk3a(struct device *d,
327327
return strnlen(buf, count);
328328
}
329329

330-
static DEVICE_ATTR(received_ref_clk3a, S_IWUGO, NULL,
330+
static DEVICE_ATTR(received_ref_clk3a, (S_IWUSR|S_IWGRP), NULL,
331331
store_received_ref_clk3a);
332332

333333

@@ -349,7 +349,7 @@ static ssize_t store_received_ref_clk3b(struct device *d,
349349
return strnlen(buf, count);
350350
}
351351

352-
static DEVICE_ATTR(received_ref_clk3b, S_IWUGO, NULL,
352+
static DEVICE_ATTR(received_ref_clk3b, (S_IWUSR|S_IWGRP), NULL,
353353
store_received_ref_clk3b);
354354

355355

@@ -371,7 +371,7 @@ static ssize_t store_enable_clk3b_output(struct device *d,
371371
return strnlen(buf, count);
372372
}
373373

374-
static DEVICE_ATTR(enable_clk3b_output, S_IWUGO, NULL,
374+
static DEVICE_ATTR(enable_clk3b_output, (S_IWUSR|S_IWGRP), NULL,
375375
store_enable_clk3b_output);
376376

377377
static ssize_t store_enable_clk3a_output(struct device *d,
@@ -392,7 +392,7 @@ static ssize_t store_enable_clk3a_output(struct device *d,
392392
return strnlen(buf, count);
393393
}
394394

395-
static DEVICE_ATTR(enable_clk3a_output, S_IWUGO, NULL,
395+
static DEVICE_ATTR(enable_clk3a_output, (S_IWUSR|S_IWGRP), NULL,
396396
store_enable_clk3a_output);
397397

398398
static ssize_t store_enable_clkb1_output(struct device *d,
@@ -413,7 +413,7 @@ static ssize_t store_enable_clkb1_output(struct device *d,
413413
return strnlen(buf, count);
414414
}
415415

416-
static DEVICE_ATTR(enable_clkb1_output, S_IWUGO, NULL,
416+
static DEVICE_ATTR(enable_clkb1_output, (S_IWUSR|S_IWGRP), NULL,
417417
store_enable_clkb1_output);
418418

419419

@@ -435,7 +435,7 @@ static ssize_t store_enable_clka1_output(struct device *d,
435435
return strnlen(buf, count);
436436
}
437437

438-
static DEVICE_ATTR(enable_clka1_output, S_IWUGO, NULL,
438+
static DEVICE_ATTR(enable_clka1_output, (S_IWUSR|S_IWGRP), NULL,
439439
store_enable_clka1_output);
440440

441441
static ssize_t store_enable_clkb0_output(struct device *d,
@@ -456,7 +456,7 @@ static ssize_t store_enable_clkb0_output(struct device *d,
456456
return strnlen(buf, count);
457457
}
458458

459-
static DEVICE_ATTR(enable_clkb0_output, S_IWUGO, NULL,
459+
static DEVICE_ATTR(enable_clkb0_output, (S_IWUSR|S_IWGRP), NULL,
460460
store_enable_clkb0_output);
461461

462462
static ssize_t store_enable_clka0_output(struct device *d,
@@ -477,7 +477,7 @@ static ssize_t store_enable_clka0_output(struct device *d,
477477
return strnlen(buf, count);
478478
}
479479

480-
static DEVICE_ATTR(enable_clka0_output, S_IWUGO, NULL,
480+
static DEVICE_ATTR(enable_clka0_output, (S_IWUSR|S_IWGRP), NULL,
481481
store_enable_clka0_output);
482482

483483
static ssize_t store_select_amcb2_transmit_clock(struct device *d,
@@ -519,7 +519,7 @@ static ssize_t store_select_amcb2_transmit_clock(struct device *d,
519519
return strnlen(buf, count);
520520
}
521521

522-
static DEVICE_ATTR(select_amcb2_transmit_clock, S_IWUGO, NULL,
522+
static DEVICE_ATTR(select_amcb2_transmit_clock, (S_IWUSR|S_IWGRP), NULL,
523523
store_select_amcb2_transmit_clock);
524524

525525
static ssize_t store_select_amcb1_transmit_clock(struct device *d,
@@ -560,7 +560,7 @@ static ssize_t store_select_amcb1_transmit_clock(struct device *d,
560560
return strnlen(buf, count);
561561
}
562562

563-
static DEVICE_ATTR(select_amcb1_transmit_clock, S_IWUGO, NULL,
563+
static DEVICE_ATTR(select_amcb1_transmit_clock, (S_IWUSR|S_IWGRP), NULL,
564564
store_select_amcb1_transmit_clock);
565565

566566
static ssize_t store_select_redundant_clock(struct device *d,
@@ -581,7 +581,7 @@ static ssize_t store_select_redundant_clock(struct device *d,
581581
return strnlen(buf, count);
582582
}
583583

584-
static DEVICE_ATTR(select_redundant_clock, S_IWUGO, NULL,
584+
static DEVICE_ATTR(select_redundant_clock, (S_IWUSR|S_IWGRP), NULL,
585585
store_select_redundant_clock);
586586

587587
static ssize_t store_select_ref_frequency(struct device *d,
@@ -602,7 +602,7 @@ static ssize_t store_select_ref_frequency(struct device *d,
602602
return strnlen(buf, count);
603603
}
604604

605-
static DEVICE_ATTR(select_ref_frequency, S_IWUGO, NULL,
605+
static DEVICE_ATTR(select_ref_frequency, (S_IWUSR|S_IWGRP), NULL,
606606
store_select_ref_frequency);
607607

608608
static ssize_t store_filter_select(struct device *d,
@@ -623,7 +623,7 @@ static ssize_t store_filter_select(struct device *d,
623623
return strnlen(buf, count);
624624
}
625625

626-
static DEVICE_ATTR(filter_select, S_IWUGO, NULL, store_filter_select);
626+
static DEVICE_ATTR(filter_select, (S_IWUSR|S_IWGRP), NULL, store_filter_select);
627627

628628
static ssize_t store_hardware_switching_mode(struct device *d,
629629
struct device_attribute *attr, const char *buf, size_t count)
@@ -643,7 +643,7 @@ static ssize_t store_hardware_switching_mode(struct device *d,
643643
return strnlen(buf, count);
644644
}
645645

646-
static DEVICE_ATTR(hardware_switching_mode, S_IWUGO, NULL,
646+
static DEVICE_ATTR(hardware_switching_mode, (S_IWUSR|S_IWGRP), NULL,
647647
store_hardware_switching_mode);
648648

649649
static ssize_t store_hardware_switching(struct device *d,
@@ -664,7 +664,7 @@ static ssize_t store_hardware_switching(struct device *d,
664664
return strnlen(buf, count);
665665
}
666666

667-
static DEVICE_ATTR(hardware_switching, S_IWUGO, NULL,
667+
static DEVICE_ATTR(hardware_switching, (S_IWUSR|S_IWGRP), NULL,
668668
store_hardware_switching);
669669

670670
static ssize_t store_refalign (struct device *d,
@@ -684,7 +684,7 @@ static ssize_t store_refalign (struct device *d,
684684
return strnlen(buf, count);
685685
}
686686

687-
static DEVICE_ATTR(refalign, S_IWUGO, NULL, store_refalign);
687+
static DEVICE_ATTR(refalign, (S_IWUSR|S_IWGRP), NULL, store_refalign);
688688

689689
static ssize_t store_mode_select (struct device *d,
690690
struct device_attribute *attr, const char *buf, size_t count)
@@ -704,7 +704,7 @@ static ssize_t store_mode_select (struct device *d,
704704
return strnlen(buf, count);
705705
}
706706

707-
static DEVICE_ATTR(mode_select, S_IWUGO, NULL, store_mode_select);
707+
static DEVICE_ATTR(mode_select, (S_IWUSR|S_IWGRP), NULL, store_mode_select);
708708

709709
static ssize_t store_reset (struct device *d,
710710
struct device_attribute *attr, const char *buf, size_t count)
@@ -724,7 +724,7 @@ static ssize_t store_reset (struct device *d,
724724
return strnlen(buf, count);
725725
}
726726

727-
static DEVICE_ATTR(reset, S_IWUGO, NULL, store_reset);
727+
static DEVICE_ATTR(reset, (S_IWUSR|S_IWGRP), NULL, store_reset);
728728

729729
static struct attribute *tlclk_sysfs_entries[] = {
730730
&dev_attr_current_ref.attr,

0 commit comments

Comments
 (0)