Messages in this thread | | | From | David Laight <> | Subject | RE: [PATCH v2 5/9] selinux: services: update type for number of class permissions | Date | Fri, 4 Aug 2023 15:21:31 +0000 |
| |
From: Paul Moore > Sent: 04 August 2023 03:20 > > On Jul 28, 2023 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com> wrote: > > ... > > + u16 i, n = mapping->num_perms; ... > > for (; i < (sizeof(u32)*8); i++)
Don't dop arithmetic on types smaller than int. You are pretty much requesting the compiler add code to mask the result down to 16 bits after very operations.
David
- Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
| |