Source-Changes archive

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

CVS commit: src/sys/dev/pci



Module Name:    src
Committed By:   kamil
Date:           Wed Jul  4 03:00:46 UTC 2018

Modified Files:
        src/sys/dev/pci: pciide_piix_reg.h

Log Message:
Avoid undefined behavior in pciiide macros

Cast the 'bytes' argument in PIIX_IDETIM_SET() and PIIX_IDETIM_CLEAR()
to unsigned int. This prevents UB because of shifting the bits and changing
the bit of signedness.

sys/dev/pci/piixide.c:714:11, left shift of 65535 by 16 places cannot be represented in type 'int'
sys/dev/pci/piixide.c:720:11, left shift of 32768 by 16 places cannot be represented in type 'int'

Detected with Kernel Undefined Behavior Sanitizer.

Reported by <Harry Pantazis>


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/pciide_piix_reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index