Bug 3537

Summary: OpenSSH build failed
Product: Portable OpenSSH Reporter: John <xylene2016>
Component: sshdAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: major CC: djm, dtucker
Priority: P5    
Version: -current   
Hardware: amd64   
OS: Linux   
Bug Depends on:    
Bug Blocks: 3533    
Attachments:
Description Flags
the output
none
Check if each arg to madvise is defined before attempting to use them
djm: ok+
still failed
none
compatibility for mmap flags
djm: ok? (dtucker)
This patch worked. none

Description John 2023-02-09 23:31:20 AEDT
Created attachment 3659 [details]
the output

Fail to build OpenSSH since this commit 195313dfe10a23c82e9d56d5fdd2f59beee1bdcf (harden Linux seccomp sandbox)

OS: RHEL 7 / CentOS 7

Please check the attachment.
Comment 1 Darren Tucker 2023-02-09 23:48:09 AEDT
Are MADV_FREE or MADV_WIPEONFORK declared in any header or are they just not present on this platform?
Comment 2 Darren Tucker 2023-02-09 23:50:26 AEDT
Created attachment 3660 [details]
Check if each arg to madvise is defined before attempting to use them

If they're not defined then please try this patch.
Comment 3 John 2023-02-10 01:27:14 AEDT
(In reply to Darren Tucker from comment #1)
> Are MADV_FREE or MADV_WIPEONFORK declared in any header or are they
> just not present on this platform?

I found MADV_FREE and MADV_WIPEONFORK in /usr/include/asm-generic/mman.h , which included by /usr/include/asm/mman.h .
And these 2 files are provided by kernel-headers-5.15.92-1.el7.x86_64 .
Comment 4 John 2023-02-10 01:37:59 AEDT
Created attachment 3661 [details]
still failed
Comment 5 John 2023-02-10 01:39:33 AEDT
I have tried the patch, still failed.
Comment 6 Damien Miller 2023-02-10 09:56:50 AEDT
Comment on attachment 3660 [details]
Check if each arg to madvise is defined before attempting to use them

We might need to do something similar for the futex flags if people are building on older linux too
Comment 7 Damien Miller 2023-02-10 10:35:37 AEDT
Created attachment 3662 [details]
compatibility for mmap flags

Please try this patch in addition to Darren's
Comment 8 John 2023-02-10 23:27:54 AEDT
Created attachment 3668 [details]
This patch worked.
Comment 9 Darren Tucker 2023-02-11 12:36:08 AEDT
Thanks for the report and confirming the fix.  Patch applied and will be in the 9.3p1 release.
Comment 10 Damien Miller 2023-03-17 13:38:34 AEDT
OpenSSH 9.3 has been released. Close resolved bugs