jdk
jdk copied to clipboard
8295264: Fix PaX check on RISC-V
On Linux RISC-V, PROT_WRITE doesn't imply PROT_READ [1]
The fix is to pass PROT_READ|PROT_WRITE. That matches all other calls to mmap in hotspot.
[1] https://lkml.org/lkml/2022/9/8/1066
Progress
- [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
Issue
- JDK-8295264: Fix PaX check on RISC-V
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10690/head:pull/10690
$ git checkout pull/10690
Update a local copy of the PR:
$ git checkout pull/10690
$ git pull https://git.openjdk.org/jdk pull/10690/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10690
View PR using the GUI difftool:
$ git pr show -t 10690
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10690.diff
:wave: Welcome back luhenry! A progress list of the required criteria for merging this PR into master
will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.
@luhenry The following label will be automatically applied to this pull request:
-
hotspot-runtime
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.
I see the LKML link mentions this: "Just remove the check altogether and let PROT_WRITE imply PROT_READ as is the case on other architectures.". Is this change still necessary then? Thanks.
I see the LKML link mentions this: "Just remove the check altogether and let PROT_WRITE imply PROT_READ as is the case on other architectures.". Is this change still necessary then? Thanks.
That would be necessary for any older version of Linux. Also, it allows it to match all other calls to ::mmap
in hotspot.
I see the LKML link mentions this: "Just remove the check altogether and let PROT_WRITE imply PROT_READ as is the case on other architectures.". Is this change still necessary then? Thanks.
That would be necessary for any older version of Linux. Also, it allows it to match all other calls to
::mmap
in hotspot.
That makes sence to me. Changes looks good to me.
@luhenry This change now passes all automated pre-integration checks.
ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.
After integration, the commit message for the final commit will be:
8295264: Fix PaX check on RISC-V
Reviewed-by: yadongwang, fyang
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.
At the time when this comment was updated there had been 40 new commits pushed to the master
branch:
- cf07eaeb9291da725181832b8bb1dc54957ba886: 8295020: javac emits incorrect code for for-each on an intersection type.
- b3bb3e6ed89f3abcaae584fcbe75688141e886cb: 8295325: tools/jlink/plugins/SaveJlinkArgfilesPluginTest.java fails on Linux ppc64le
- 9005af3b90fbd3607aeb83efe1c4a6ffa5d104f0: 8295110: RISC-V: Mark out relocations as incompressible
- 74a51ccc86525eb4b1eb2e5cb11e605ca9e9fc5d: 8292698: Improve performance of DataInputStream
- d3781ac8a38943d8a20304e770b01d5418ee33d0: 8295009: RISC-V: Interpreter intrinsify Thread.currentThread()
- e7d0ab227ff86bb65abf7fbeb135ce657454200b: 8295379: ProblemList java/lang/Float/Binary16Conversion.java in Xcomp mode on x64
- 404e8de1559adade31df98a83919841f080b5b89: 8294865: x86: Improve the code generation of MulVB and MulVL
- 2087424736f15a5a80a0492993a6cd74da87188a: 8295370: Update java.io.ObjectStreamField to use Class.descriptorString
- 8487c56f7ea224169d9d42efda9efb824266289f: 8295294: Misc cleanups in runtime/InvocationTests
- 0043d58c5d52c3b299a4b6dfcec34a7db5041aea: 8293531: C2: some vectorapi tests fail assert "Not monotonic" with flag -XX:TypeProfileLevel=222
- ... and 30 more: https://git.openjdk.org/jdk/compare/6ae7e4d4aad5712cf2fe6ab9f98dc424fa4170cb...master
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@RealFYang) but any other Committer may sponsor as well.
➡️ To flag this PR as ready for integration with the above commit message, type /integrate
in a new comment. (Afterwards, your sponsor types /sponsor
in a new comment to perform the integration).
/integrate
@luhenry Your change (at version 355fc63011ce11b654f22c520721a9212d2fe9d0) is now ready to be sponsored by a Committer.
/sponsor
Going to push as commit 4434cbb719db37880b48474ba342f300ed4828a8.
Since your change was applied there have been 62 commits pushed to the master
branch:
- a8c18ebc152842281b22534507b4a09612ea3498: 8295257: Remove implicit noreg temp register arguments in aarch64 MacroAssembler
- 6553065cab9ecb14390da8ec34e49aba940b213f: 8295273: Remove unused argument in [load/store]_sized_value on aarch64 and riscv
- b06f1b149c8f8a49d4e42c4b782a4b3a22aa79f6: 8294594: Fix cast-function-type warnings in signal handling code
- 71aa8210910dbafe30eccc772eaa7747f46be0cd: 8295176: some langtools test pollutes source tree
- bca7ab3c1109e6cff9b50ecdd3045cb0ae8f6953: 8295412: support latest VS2022 MSC_VER in abstract_vm_version.cpp
- c33ca0c5edd60454c58916cb588e5b2cfcc7b36a: 6229853: BasicTextAreaUI:create incompletely documents the possible returned View types
- 358ac07255cc640cbcb9b0df5302d97891a34087: 8294254: [macOS] javax/swing/plaf/aqua/CustomComboBoxFocusTest.java failure
- 490fcd0c2547cb4e564363f0cd121c777c3acc02: 8293833: Error mixing types with -XX:+UseCMoveUnconditionally -XX:+UseVectorCmov
- 529cc48f355523fd162470b416a5081869adcf0e: 8295396: RISC-V: Cleanup useless CompressibleRegions
- 692cdab2be7dfc6e12b127f8e2c97bc41536cb84: 8295016: Make the arraycopy_epilogue signature consistent with its usage
- ... and 52 more: https://git.openjdk.org/jdk/compare/6ae7e4d4aad5712cf2fe6ab9f98dc424fa4170cb...master
Your commit was automatically rebased without conflicts.
@RealFYang @luhenry Pushed as commit 4434cbb719db37880b48474ba342f300ed4828a8.
:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.
Hi @RealFYang @luhenry, do you think it is necessary to back-port this commit to jdk19u branch? Thanks!
Hi @RealFYang @luhenry, do you think it is necessary to back-port this commit to jdk19u branch? Thanks!
@XieJiSS : Are you using jdk19u and affected by this issue? AFAIK, this is also handled on the kernel's side.
AFAIK, this is also handled on the kernel's side.
Yes, but my current kernel version is still affected. Will try to compile the newest kernel to see whether that works.
It should be extremely safe to backport, and it explicits the default behavior to paper over a kernel bug. Let me request backport in JBS.
/backport jdk19u-dev
@luhenry The target repository jdk19u-dev
is not a valid target for backports.
List of valid target repositories: openjdk/jdk, openjdk/jdk11u, openjdk/jdk11u-dev, openjdk/jdk12u, openjdk/jdk13u, openjdk/jdk13u-dev, openjdk/jdk14u, openjdk/jdk15u, openjdk/jdk15u-dev, openjdk/jdk16u, openjdk/jdk17u, openjdk/jdk17u-dev, openjdk/jdk18u, openjdk/jdk19, openjdk/jdk19u, openjdk/jdk7u, openjdk/jdk8u, openjdk/jdk8u-dev, openjdk/shenandoah-jdk8u, openjdk/shenandoah-jdk8u-dev.
Supplying the organization/group prefix is optional.
/backport openjdk/jdk19u
@luhenry the backport was successfully created on the branch luhenry-backport-4434cbb7 in my personal fork of openjdk/jdk19u. To create a pull request with this backport targeting openjdk/jdk19u:master, just click the following link:
:arrow_right: Create pull request
The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:
Hi all,
This pull request contains a backport of commit 4434cbb7 from the openjdk/jdk repository.
The commit being backported was authored by Ludovic Henry on 18 Oct 2022 and was reviewed by Yadong Wang and Fei Yang.
Thanks!
If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk19u:
$ git fetch https://github.com/openjdk-bots/jdk19u luhenry-backport-4434cbb7:luhenry-backport-4434cbb7
$ git checkout luhenry-backport-4434cbb7
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk19u luhenry-backport-4434cbb7