Possible reentrancy issue in be_iopoll

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

 



Hi Jayamohan.

I think that there is a reentrancy issue in "drivers/scsi/be2iscsi/be_main.c::be_iopoll". The driver creates "NAPI" context per core which is fine, however the above routine declares the ret variable as static! Thus there is only one instance of this variable, so if this routine is called from more than one thread of execution the result is unpredictable.

        static unsigned int ret;
        .....

        ret = beiscsi_process_cq(pbe_eq);
<----------------------------------------------------------------------------------Another thread can enter here and change "ret".
        if (ret < budget) {
               ....
        }
<----------------------------------------------------------------------------------Another thread can enter here and change "ret".
        return ret;

I can't submit a patch without checking it first, which is impossible since I don't have the HW, but the fix seems trivial, just take out the static.

Best regards,

S.P.

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux