Skip to contentSkip to conversation

stable request: mips strncpy is broken

DISCUSSION Florian Westphal 2 participants 3 messages Mar 4, 2021 Stable branch

lore
Share & tools
lore
#0 lore raw

Hello,

Please consider queueing

commit 3c0be5849259b729580c23549330973a2dd513a2
Author: Paul Burton <[email protected]>
MIPS: Drop 32-bit asm string functions

The commit is part of 5.5-rc1.

We got a bug report about following nftables rule not matching even if it should on Linux 5.4.y mips32:

meta iifname "br-vlan"

'iifname' uses strncpy(..., IFNAMSIZ) to copy dev->name to the register. The MIPS asm function doesn't zero-pad the remaining bytes, but that is needed for the compare op to work reliably.

The reporter confirmed that this removal fixes the issue, the generic C version behaves as expected.

The patch doesn't apply cleanly to 5.4, there is a minor conflict related to FORTIFY macro, but its easily resolved as all code is removed.

I did not try earlier 4.4.y releases but I susepct they should also get this patch applied.

I can send a 5.4.y backport if thats preferred.

Thanks.

maintainer
#1 lore raw
Quoted 22 lines · Florian Westphal

Hello,

Please consider queueing

commit 3c0be5849259b729580c23549330973a2dd513a2
Author: Paul Burton <[email protected]>
MIPS: Drop 32-bit asm string functions

The commit is part of 5.5-rc1.

We got a bug report about following nftables rule not matching even if it should on Linux 5.4.y mips32:

meta iifname "br-vlan"

'iifname' uses strncpy(..., IFNAMSIZ) to copy dev->name to the register. The MIPS asm function doesn't zero-pad the remaining bytes, but that is needed for the compare op to work reliably.

The reporter confirmed that this removal fixes the issue, the generic C version behaves as expected.

Quoted 8 lines

The patch doesn't apply cleanly to 5.4, there is a minor conflict related to FORTIFY macro, but its easily resolved as all code is removed.

I did not try earlier 4.4.y releases but I susepct they should also get this patch applied.

I can send a 5.4.y backport if thats preferred.

Please do, that way I know it is done correctly and has been tested.

And here I thought no one was actually using MIPS anymore :)

thanks,

greg k-h

#2 lore raw
Quoted 6 lines · Greg KH
Quoted 4 lines

I did not try earlier 4.4.y releases but I susepct they should also get this patch applied.

I can send a 5.4.y backport if thats preferred.

Please do, that way I know it is done correctly and has been tested.

Will do, but note that I can't test this.