File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,22 @@ static void idletimer_tg_expired(unsigned long data)
116
116
schedule_work (& timer -> work );
117
117
}
118
118
119
+ static int idletimer_check_sysfs_name (const char * name , unsigned int size )
120
+ {
121
+ int ret ;
122
+
123
+ ret = xt_check_proc_name (name , size );
124
+ if (ret < 0 )
125
+ return ret ;
126
+
127
+ if (!strcmp (name , "power" ) ||
128
+ !strcmp (name , "subsystem" ) ||
129
+ !strcmp (name , "uevent" ))
130
+ return - EINVAL ;
131
+
132
+ return 0 ;
133
+ }
134
+
119
135
static int idletimer_tg_create (struct idletimer_tg_info * info )
120
136
{
121
137
int ret ;
@@ -126,6 +142,10 @@ static int idletimer_tg_create(struct idletimer_tg_info *info)
126
142
goto out ;
127
143
}
128
144
145
+ ret = idletimer_check_sysfs_name (info -> label , sizeof (info -> label ));
146
+ if (ret < 0 )
147
+ goto out_free_timer ;
148
+
129
149
sysfs_attr_init (& info -> timer -> attr .attr );
130
150
info -> timer -> attr .attr .name = kstrdup (info -> label , GFP_KERNEL );
131
151
if (!info -> timer -> attr .attr .name ) {
You can’t perform that action at this time.
0 commit comments