Search Linux Wireless

Re: [RFC] Simulate medium behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 14, 2009 at 09:12:49PM +0200, Johannes Berg wrote:
> On Thu, 2009-05-14 at 20:45 +0200, Daniel Wagner wrote:
> 
> Looks good to me, couple of comments below.
> 
> > +static int hwsim_fops_group_read(void *dat, u64 *val)
> > +{
> > +	struct mac80211_hwsim_data *data = dat;
> > +	*val = data->group;
> > +	return 0;
> > +}
> > +
> > +static int hwsim_fops_group_write(void *dat, u64 val)
> > +{
> > +	struct mac80211_hwsim_data *data = dat;
> > +	data->group = val;
> > +	return 0;
> > +}
> > +
> > +DEFINE_SIMPLE_ATTRIBUTE(hwsim_fops_group,
> > +			hwsim_fops_group_read, hwsim_fops_group_write,
> > +			"%llu\n");
> 
> I think %llx would work better for this? At least I can do bitops better
> in hex :)

Yeah, I have to improve my copy&paste-foo :)

> 
> >  		data->debugfs_ps = debugfs_create_file("ps", 0666,
> >  						       data->debugfs, data,
> >  						       &hwsim_fops_ps);
> > +		data->debugfs_group = debugfs_create_file("group", 0666,
> > +							data->debugfs, data,
> > +							&hwsim_fops_group);
> 
> Good thing this is a test module only... debugfs files with user access
> permissions are a security risk. (a user can open the file and leave the
> fd open, if root then rmmods future reads/writes to the fd by the user
> crash the kernel)

There isn't much we can do about that, right? 

> Anyway looks good, please submit properly with [PATCH] etc :)

Done. 

Thanks for reviewing!

cheers,
daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux