Re: [External] [PATCH 2/2] platform/x86: thinkpad_acpi: Don't use test_bit on an integer

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

 



On Wed, Mar 09, 2022 at 12:08:26PM -0500, Mark Pearson wrote:
> Thanks Hans,
> 
> I hadn't realised that was the case - appreciate the fix

There are three hidden issues with bit operations being used over non-unsigned
long types: a) big-endianness (wrong bit order); b) out of boundaries access
due to BE or types when sizeof() < sizeof(unsigned long); c) unaligned access.

All of them are potential security holes and/or crashes.

> On 2022-03-09 12:05, Hans de Goede wrote:
> > test_bit can only be used on longs not on ints, fix this.

> > p.s. Mark, the need for the (void *) case in the code this replaces
> > should have been a hint that something was not right; and I should
> > have spotted that during review...

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux