Re: Add a "enable" sysfs attribute to the pci devices to allowuserspace (Xorg) to enable devices without doing foul direct access
From: Eric W. Biederman
Date: Sun May 14 2006 - 22:13:40 EST
Arjan van de Ven <arjan@xxxxxxxxxxxxxxx> writes:
>> > + if (!pdev)
>> > + return 1;
>>
>> Can this happen?
>
> eh I suppose not; the other code doesn't check it either; fixed
>
>>
>> > + /* this can crash the machine when done on the "wrong" device */
>> > + if (!capable(CAP_SYS_ADMIN))
>> > + return 1;
>>
>> Don't the file's permissions suffice?
>
> that's a more philosophical question; you can ask that question about
> the entire capability system ;) Other code in the same file uses this
> same capability for a same level of access though.
A minor nit. This level of access should really be CAP_SYS_RAWIO.
Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/