>> +#if !(defined(__FreeBSD_kernel__) && defined(__x86_64__))
>>         ioperm(0, 1024, 1);
>> +#endif
>>         iopl(3);
>
> Does the code work with this change? I'd be suspicious...

In fact ioperm() is completely redundant here even on linux/i386.
ioperm() permits access to SOME ports, but following iopl() permits
access to ALL ports.

See http://www.logix.cz/michal/doc/i386/chp08-03.htm:

In protected mode, when it encounters an I/O instruction (IN, INS, OUT, or
OUTS), the processor first checks whether CPL . IOPL. If this condition is
true, the I/O operation may proceed. If not true, the processor checks the
I/O permission map.

Kfreebsd-amd64 does not have ioperm() interface exported by the kernel at
all, the patch tries to be non intrusive for other architectures.
Petr






-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to