Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'audit-pr-20221107' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit

Pull audit fix from Paul Moore:
"A small audit patch to fix an instance of undefined behavior in a
shift operator caused when shifting a signed value too far, the same
case as the lsm patch merged previously.

While the fix is trivial and I can't imagine it causing a problem in a
backport, I'm not explicitly marking it for stable on the off chance
that there is some system out there which is relying on some wonky
unexpected behavior which this patch could break; *if* it does break,
IMO it's better that to happen in a minor or -rcX release and not in a
stable backport"

* tag 'audit-pr-20221107' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit:
audit: fix undefined behavior in bit shift for AUDIT_BIT

+1 -1
+1 -1
include/uapi/linux/audit.h
··· 187 187 #define AUDIT_MAX_KEY_LEN 256 188 188 #define AUDIT_BITMASK_SIZE 64 189 189 #define AUDIT_WORD(nr) ((__u32)((nr)/32)) 190 - #define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32)) 190 + #define AUDIT_BIT(nr) (1U << ((nr) - AUDIT_WORD(nr)*32)) 191 191 192 192 #define AUDIT_SYSCALL_CLASSES 16 193 193 #define AUDIT_CLASS_DIR_WRITE 0