stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Regression: Fwd: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid
@ 2022-10-11 16:52 Dimitri John Ledkov
  2022-10-11 16:58 ` Conor Dooley
  2022-11-04 12:02 ` Regression: Fwd: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid #forregzbot Thorsten Leemhuis
  0 siblings, 2 replies; 4+ messages in thread
From: Dimitri John Ledkov @ 2022-10-11 16:52 UTC (permalink / raw)
  To: regressions, stable; +Cc: Eva Kotova, linux-riscv, coelacanthus, kernel-team


[-- Attachment #1.1: Type: text/plain, Size: 2480 bytes --]

#regzbot ^introduced 2139619bcad7ac44cc8f6f749089120594056613

Over at https://lore.kernel.org/linux-riscv/Yz80ewHKTPI5Rvuz@spud/T/#ebde47064434d4ca4807b4abb8eb39898c48a8de2 it is reported that 2139619bcad7ac44cc8f6f749089120594056613 regresses userspace (openjdk) on riscv64.

This commit has already been released in v6.0 kernel upstream, but has also been included in the stable patch series all the way back to v4.19.y

There is a proposed fix for this at https://lore.kernel.org/linux-riscv/20220915193702.2201018-1-abrestic@rivosinc.com/ which has not yet been merged upstream or in stable series.

Please review and merge above proposed fix, or please revert 2139619bcad7ac44cc8f6f749089120594056613 to stop the regression spreading to all the distributions.

In Ubuntu this regression will be tracked as https://bugs.launchpad.net/bugs/+bug/1992484

-------- Forwarded Message --------
Subject: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid
Date: Thu, 6 Oct 2022 22:20:02 +0300
From: Eva Kotova <nyandarknessgirl@gmail.com>
Reply-To: PH7PR14MB559464DBDD310E755F5B21E8CEDC9@PH7PR14MB5594.namprd14.prod.outlook.com
To: coelacanthus@outlook.com
CC: c141028@gmail.com, dramforever@live.com, linux-riscv@lists.infradead.org, palmer@dabbelt.com, xc-tan@outlook.com

On Tue, 31 May 2022 00:56:52 PDT (-0700), coelacanthus@outlook.com wrote:
> As mentioned in Table 4.5 in RISC-V spec Volume 2 Section 4.3, write
> but not read is "Reserved for future use.". For now, they are not valid.
> In the current code, -wx is marked as invalid, but -w- is not marked
> as invalid.

This patch breaks OpenJDK/Java on RISC-V, as it tries to create a w-only
protective page:

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 4096 bytes for failed to
allocate memory for PaX check.
# An error report file with more information is saved as:
# /root/hs_err_pid107.log

I bisected to this commit since on Linux 5.19+ java no longer works.
Perhaps some fallback should be implemented, to prevent userspace
breakage. It is currently documented, that at least on i386 PROT_WRITE
mappings imply PROT_READ (See man mmap(2) NOTES), this would be a good
place to start.

Best regards,
Eva

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Regression: Fwd: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid
  2022-10-11 16:52 Regression: Fwd: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid Dimitri John Ledkov
@ 2022-10-11 16:58 ` Conor Dooley
  2022-10-11 17:18   ` Dimitri John Ledkov
  2022-11-04 12:02 ` Regression: Fwd: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid #forregzbot Thorsten Leemhuis
  1 sibling, 1 reply; 4+ messages in thread
From: Conor Dooley @ 2022-10-11 16:58 UTC (permalink / raw)
  To: Dimitri John Ledkov
  Cc: regressions, stable, Eva Kotova, linux-riscv, coelacanthus, kernel-team

On Tue, Oct 11, 2022 at 05:52:13PM +0100, Dimitri John Ledkov wrote:
> #regzbot ^introduced 2139619bcad7ac44cc8f6f749089120594056613
> 
> Over at https://lore.kernel.org/linux-riscv/Yz80ewHKTPI5Rvuz@spud/T/#ebde47064434d4ca4807b4abb8eb39898c48a8de2
> it is reported that 2139619bcad7ac44cc8f6f749089120594056613
> regresses userspace (openjdk) on riscv64.
> 
> This commit has already been released in v6.0 kernel upstream,
> but has also been included in the stable patch series all the
> way back to v4.19.y
> 
> There is a proposed fix for this at
> https://lore.kernel.org/linux-riscv/20220915193702.2201018-1-abrestic@rivosinc.com/
> which has not yet been merged upstream or in stable series.
> 
> Please review and merge above proposed fix, or please revert
> 2139619bcad7ac44cc8f6f749089120594056613 to stop the regression
> spreading to all the distributions.

Out of curiosity, and given the CC list lacks a CC of the maintainer,
who are you actually asking to review and/or merge this?

I'll go bump the fix itself.

Thanks,
Conor.

> 
> In Ubuntu this regression will be tracked as https://bugs.launchpad.net/bugs/+bug/1992484
> 
> -------- Forwarded Message --------
> Subject: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid
> Date: Thu, 6 Oct 2022 22:20:02 +0300
> From: Eva Kotova <nyandarknessgirl@gmail.com>
> Reply-To: PH7PR14MB559464DBDD310E755F5B21E8CEDC9@PH7PR14MB5594.namprd14.prod.outlook.com
> To: coelacanthus@outlook.com
> CC: c141028@gmail.com, dramforever@live.com, linux-riscv@lists.infradead.org, palmer@dabbelt.com, xc-tan@outlook.com
> 
> On Tue, 31 May 2022 00:56:52 PDT (-0700), coelacanthus@outlook.com wrote:
> > As mentioned in Table 4.5 in RISC-V spec Volume 2 Section 4.3, write
> > but not read is "Reserved for future use.". For now, they are not valid.
> > In the current code, -wx is marked as invalid, but -w- is not marked
> > as invalid.
> 
> This patch breaks OpenJDK/Java on RISC-V, as it tries to create a w-only
> protective page:
> 
> #
> # There is insufficient memory for the Java Runtime Environment to continue.
> # Native memory allocation (mmap) failed to map 4096 bytes for failed to
> allocate memory for PaX check.
> # An error report file with more information is saved as:
> # /root/hs_err_pid107.log
> 
> I bisected to this commit since on Linux 5.19+ java no longer works.
> Perhaps some fallback should be implemented, to prevent userspace
> breakage. It is currently documented, that at least on i386 PROT_WRITE
> mappings imply PROT_READ (See man mmap(2) NOTES), this would be a good
> place to start.
> 
> Best regards,
> Eva
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
> 




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Regression: Fwd: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid
  2022-10-11 16:58 ` Conor Dooley
@ 2022-10-11 17:18   ` Dimitri John Ledkov
  0 siblings, 0 replies; 4+ messages in thread
From: Dimitri John Ledkov @ 2022-10-11 17:18 UTC (permalink / raw)
  To: Conor Dooley
  Cc: regressions, stable, Eva Kotova, linux-riscv, coelacanthus, kernel-team

On Tue, 11 Oct 2022 at 17:58, Conor Dooley <conor@kernel.org> wrote:
>
> On Tue, Oct 11, 2022 at 05:52:13PM +0100, Dimitri John Ledkov wrote:
> > #regzbot ^introduced 2139619bcad7ac44cc8f6f749089120594056613
> >
> > Over at https://lore.kernel.org/linux-riscv/Yz80ewHKTPI5Rvuz@spud/T/#ebde47064434d4ca4807b4abb8eb39898c48a8de2
> > it is reported that 2139619bcad7ac44cc8f6f749089120594056613
> > regresses userspace (openjdk) on riscv64.
> >
> > This commit has already been released in v6.0 kernel upstream,
> > but has also been included in the stable patch series all the
> > way back to v4.19.y
> >
> > There is a proposed fix for this at
> > https://lore.kernel.org/linux-riscv/20220915193702.2201018-1-abrestic@rivosinc.com/
> > which has not yet been merged upstream or in stable series.
> >
> > Please review and merge above proposed fix, or please revert
> > 2139619bcad7ac44cc8f6f749089120594056613 to stop the regression
> > spreading to all the distributions.
>
> Out of curiosity, and given the CC list lacks a CC of the maintainer,
> who are you actually asking to review and/or merge this?
>

Good point, this is my first time escalating a regression which is now
in all the stable trees. I guess I should have CC'ed all the M: from
RISC-V in the Maintainers file. Not just the riscv list.

> I'll go bump the fix itself.

Thanks.

>
> Thanks,
> Conor.
>
> >
> > In Ubuntu this regression will be tracked as https://bugs.launchpad.net/bugs/+bug/1992484
> >
> > -------- Forwarded Message --------
> > Subject: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid
> > Date: Thu, 6 Oct 2022 22:20:02 +0300
> > From: Eva Kotova <nyandarknessgirl@gmail.com>
> > Reply-To: PH7PR14MB559464DBDD310E755F5B21E8CEDC9@PH7PR14MB5594.namprd14.prod.outlook.com
> > To: coelacanthus@outlook.com
> > CC: c141028@gmail.com, dramforever@live.com, linux-riscv@lists.infradead.org, palmer@dabbelt.com, xc-tan@outlook.com
> >
> > On Tue, 31 May 2022 00:56:52 PDT (-0700), coelacanthus@outlook.com wrote:
> > > As mentioned in Table 4.5 in RISC-V spec Volume 2 Section 4.3, write
> > > but not read is "Reserved for future use.". For now, they are not valid.
> > > In the current code, -wx is marked as invalid, but -w- is not marked
> > > as invalid.
> >
> > This patch breaks OpenJDK/Java on RISC-V, as it tries to create a w-only
> > protective page:
> >
> > #
> > # There is insufficient memory for the Java Runtime Environment to continue.
> > # Native memory allocation (mmap) failed to map 4096 bytes for failed to
> > allocate memory for PaX check.
> > # An error report file with more information is saved as:
> > # /root/hs_err_pid107.log
> >
> > I bisected to this commit since on Linux 5.19+ java no longer works.
> > Perhaps some fallback should be implemented, to prevent userspace
> > breakage. It is currently documented, that at least on i386 PROT_WRITE
> > mappings imply PROT_READ (See man mmap(2) NOTES), this would be a good
> > place to start.
> >
> > Best regards,
> > Eva
> >
> > _______________________________________________
> > linux-riscv mailing list
> > linux-riscv@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-riscv
> >
>
>
>


-- 
okurrr,

Dimitri

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Regression: Fwd: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid #forregzbot
  2022-10-11 16:52 Regression: Fwd: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid Dimitri John Ledkov
  2022-10-11 16:58 ` Conor Dooley
@ 2022-11-04 12:02 ` Thorsten Leemhuis
  1 sibling, 0 replies; 4+ messages in thread
From: Thorsten Leemhuis @ 2022-11-04 12:02 UTC (permalink / raw)
  To: regressions; +Cc: linux-riscv, stable

[Note: this mail is primarily send for documentation purposes and/or for
regzbot, my Linux kernel regression tracking bot. That's why I removed
most or all folks from the list of recipients, but left any that looked
like a mailing lists. These mails usually contain '#forregzbot' in the
subject, to make them easy to spot and filter out.]

On 11.10.22 18:52, Dimitri John Ledkov wrote:
> #regzbot ^introduced 2139619bcad7ac44cc8f6f749089120594056613

#regzbot fixed-by: 9e2e6042a7ec

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-04 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-11 16:52 Regression: Fwd: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid Dimitri John Ledkov
2022-10-11 16:58 ` Conor Dooley
2022-10-11 17:18   ` Dimitri John Ledkov
2022-11-04 12:02 ` Regression: Fwd: Re: [PATCH] riscv: mmap with PROT_WRITE but no PROT_READ is invalid #forregzbot Thorsten Leemhuis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).