Skip to contentSkip to conversation

netlink: Don't shift with UB on nlk->ngroups

PATCH David Miller 2 participants 2 messages Jul 30, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer Applied
#1 lore raw
In reply to a message not in the archive

From: Dmitry Safonov <[email protected]>
Date: Mon, 30 Jul 2018 18:32:36 +0100

Quoted 6 lines

On i386 nlk->ngroups might be 32 or 0. Which leads to UB, resulting in hang during boot.
Check for 0 ngroups and use (unsigned long long) as a type to shift.

Fixes commit 7acf9d4237c46894e0fa0492dd96314a41742e84 ("netlink: Do not

subscribe to non-existent groups").

Please, in the future, format your Fixes: tag correctly. No need to say the work "commit", please do not chop up the line no matter how long it is, and please provide 12 digits of SHA1_ID value, rather than the whole thing.

Quoted 2 lines

Applied, thank you.

#2 lore raw
Quoted 9 lines · David Miller

From: Dmitry Safonov <[email protected]>
Date: Mon, 30 Jul 2018 18:32:36 +0100

Quoted 1 line

On i386 nlk->ngroups might be 32 or 0. Which leads to UB, resulting

in

Quoted 2 lines

hang during boot.
Check for 0 ngroups and use (unsigned long long) as a type to

shift.

Quoted 1 line
Quoted 8 lines
Quoted 1 line
Fixes commit 7acf9d4237c46894e0fa0492dd96314a41742e84 ("netlink:

Do not

Quoted 1 line

subscribe to non-existent groups").

Please, in the future, format your Fixes: tag correctly. No need to say the work "commit", please do not chop up the line no matter how long it is, and please provide 12 digits of SHA1_ID value, rather than the whole thing.

Oh, yeah, I have this in .gitconfig:
[core]

        abbrev = 12

But I was formatting this not on my laptop and have managed to mislook. Sorry about "commit" and the breakage.

Quoted 4 lines
Quoted 2 lines

Applied, thank you.

Thank you.