log_check / tainted_check failed in ubuntu_boot because of warnings (Found insecure W+X mapping at address) found on F/G/H-riscv

Bug #1905728 reported by Po-Hsu Lin
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
New
Undecided
Unassigned
linux (Ubuntu)
Fix Committed
Undecided
Unassigned
Groovy
Won't Fix
Undecided
Unassigned
Hirsute
Won't Fix
Undecided
Unassigned
Impish
Fix Committed
Undecided
Unassigned
linux-riscv (Ubuntu)
Fix Committed
Undecided
Unassigned
Groovy
Won't Fix
Medium
Thadeu Lima de Souza Cascardo
Hirsute
Won't Fix
Undecided
Unassigned
Impish
Fix Committed
Undecided
Unassigned

Bug Description

Issue found on 5.8.0-10-generic riscv

Message reported on boot.

[ 13.483103] ------------[ cut here ]------------
[ 13.483711] riscv/mm: Found insecure W+X mapping at address (____ptrval____)/0xffffffdff8000000
[ 13.484542] WARNING: CPU: 5 PID: 1 at arch/riscv/mm/ptdump.c:200 note_page+0x24c/0x252
[ 13.485175] Modules linked in:
[ 13.485606] CPU: 5 PID: 1 Comm: swapper/0 Not tainted 5.8.0-10-generic #12-Ubuntu
[ 13.486091] epc: ffffffe000208f18 ra : ffffffe000208f18 sp : ffffffe1f5bfbb30
[ 13.486471] gp : ffffffe001728ee0 tp : ffffffe1f5bf5080 t0 : ffffffe00173ed88
[ 13.486850] t1 : ffffffe00173ed20 t2 : 00000001fecbe000 s0 : ffffffe1f5bfbb80
[ 13.487250] s1 : ffffffe1f5bfbe10 a0 : 0000000000000053 a1 : 0000000000000020
[ 13.487633] a2 : ffffffe1f5bfb870 a3 : 0000000000000000 a4 : ffffffe0016200f8
[ 13.488040] a5 : ffffffe0016200f8 a6 : 00000000000000b5 a7 : ffffffe0006f2806
[ 13.488421] s2 : ffffffdff8001000 s3 : 0000000000000000 s4 : 0000000000000004
[ 13.488800] s5 : 0000000000000000 s6 : 0000000000000000 s7 : ffffffe1f5bfbd20
[ 13.489322] s8 : ffffffdff8001000 s9 : ffffffe00172a148 s10: ffffffdff8002000
[ 13.489738] s11: ffffffe000c16e20 t3 : 000000000003cec0 t4 : 000000000003cec0
[ 13.490119] t5 : 0000000000000000 t6 : ffffffe001739462
[ 13.490406] status: 0000000000000120 badaddr: 0000000000000000 cause: 0000000000000003
[ 13.490849] ---[ end trace 607c551edff1ef12 ]---

Please find attachment for the boot dmesg log.

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
tags: added: groovy
tags: added: 5.8
description: updated
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1905728

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: Found insecure W+X mapping at address on Groovy RISCV

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Francis Ginther (fginther) wrote :

Still seeing this with the 5.8.0-17-generic riscv kernel on groovy. See attached dmesg.

Changed in linux (Ubuntu):
status: Expired → Confirmed
Revision history for this message
Francis Ginther (fginther) wrote :
Revision history for this message
Thadeu Lima de Souza Cascardo (cascardo) wrote :

This is not a regression and has been this way since the dawn of 5.8 riscv, as we have CONFIG_STRICT_KERNEL_RWX set.

When investigating, I see many fixes that involve the linker script, so I assume this is due to some sections, like init sections carrying both text and data, which could cause this.

I tried picking a lot of commits, and needed to either do extensive backports or carry a lot of commits, and still without success, hitting a linker problem that would require carrying even more fixes.

So, contrary to what has been said about 5.8 bringing up STRICT_KERNEL_RWX to riscv, this is really not ready for prime time, and should be left for future versions.

TL;DR: We should just disable CONFIG_STRICT_KERNEL_RWX on linux-riscv 5.8.

Cascardo.

Changed in linux-riscv (Ubuntu Groovy):
assignee: nobody → Thadeu Lima de Souza Cascardo (cascardo)
importance: Undecided → Medium
status: New → Confirmed
Po-Hsu Lin (cypressyew)
summary: - Found insecure W+X mapping at address on Groovy RISCV
+ log_check / tainted_check failed in ubuntu_boot because of warnings
+ (Found insecure W+X mapping at address) found on G-riscv
tags: added: riscv ubuntu-boot
tags: added: sru-20210315
tags: added: sru-20210412
Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote : Re: log_check / tainted_check failed in ubuntu_boot because of warnings (Found insecure W+X mapping at address) found on G-riscv

Observed on G/RISC-V , cycle sru-20210510 .

tags: added: sru-20210510
Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote :

Observed on G/RISC-V , cycle sru-20210531 .

tags: added: sru-20210531
Po-Hsu Lin (cypressyew)
summary: log_check / tainted_check failed in ubuntu_boot because of warnings
- (Found insecure W+X mapping at address) found on G-riscv
+ (Found insecure W+X mapping at address) found on F/G/H-riscv
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

There is a thread here:
https://<email address hidden>/T/

Looks like this has landed:
https://github.com/torvalds/linux/commit/8a4102a0cf07cc76a18f373f6b49485258cc6af4#diff-2db30a5588193fbb572fc2b96f3b47ae2e7e83351c5122c368b2b6fa56f38cda

And here is another patch from Alex, another fix to 2bfc6cd
("riscv: Move kernel mapping outside of linear mapping") as well.
https://github.com/torvalds/linux/commit/e5c35fa0401971701dcd7675f471b664698244dd#diff-2db30a5588193fbb572fc2b96f3b47ae2e7e83351c5122c368b2b6fa56f38cda

Revision history for this message
Brian Murray (brian-murray) wrote :

The Groovy Gorilla has reached end of life, so this bug will not be fixed for that release

Changed in linux-riscv (Ubuntu Groovy):
status: Confirmed → Won't Fix
Changed in linux (Ubuntu Groovy):
status: New → Won't Fix
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

v5.13 in impish-proposed has this fixed on riscv.

it will not be backported to earlier series, hence marking hirsute as wontfix.

Changed in linux (Ubuntu Impish):
status: Confirmed → Fix Committed
Changed in linux (Ubuntu Hirsute):
status: New → Won't Fix
Changed in linux-riscv (Ubuntu Impish):
status: New → Fix Committed
Changed in linux-riscv (Ubuntu Hirsute):
status: New → Won't Fix
tags: added: sru-20210718
tags: added: hirsute
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.