From nobody Sat May 30 13:45:45 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gSM1l18bVz6fy79; Sat, 30 May 2026 13:45:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gSM1k6qlDz3b9V; Sat, 30 May 2026 13:45:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780148747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hwE9kxgZN9cZsDq2KwlG6ujXyfwgRLSgwwbnPKA0Hrs=; b=WGDTLkts6xD4P7jF2x8HCu67PSUOXereyeN/K5oYccYKEjsNihI7THRXVZliDy7dTSUw2/ VRe2HD+Q3Hc8rEY5+R+E5FFuNU4UKKVbiXITnU+8GSl9Z8f5CmtmMhjD9KlXxRRSiO7pn8 6O55fG8gXERR3clhwDGxDPGVSshyyHAdG4J1MX4MB+6Yv4Snc0w6/aQwz6cS2FJdFOx3sW zSr7yzW7BPMAF4s5pKZibo3SHG7GpGVn4owDttNdopGkLRJvF5WbFlqTPnOxiuGi9tNVWJ FMKWCtzqInwcTZLoWHvlLi5cvMRD40VJJQc2Sn0HgKxDFOdBO/Y+8pHF7R19/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780148747; a=rsa-sha256; cv=none; b=YwiUV+DyUdksF743nBKq3iHMsWpLSVmw2JrF18O1JapddOU4/G5vO7o3PZWydT3CC1Z3LQ LL96UKX6SnZ/bGNn6e8YhaL+xFTLPwBX+rT8j5mtMJGH2mdIrZBtB59NOkXeX+1jVfPS9b cLwgtGYvPn8z9KijSRPVCDrGIEybdYKbj/7Y1jh6Ngm+509/SQI8vuz0FirANxSB5z1UfQ gYjUUaw2jyymux/4cYCq0WQbCnpk6zN9G7DEZX2wXZ0RAuGBTD0I/dl+xDQObOOJVd8dGJ 02t3yR8AMJOcgwMkc9ZhLc09byrjrTbHO5Q5/KFYCn6Q9Vzfk0XU0ROjEI2XvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780148747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hwE9kxgZN9cZsDq2KwlG6ujXyfwgRLSgwwbnPKA0Hrs=; b=iFB1bfQlxuEVSq+TyoS/VB3lgShEOJlWyvQfkdRH2MmMnWn74X6hx6fgx0AlqTxcPj+Er5 lmn/X2HyWYrl1MPmq0TIl++TAanP9moyq3YxXlCeCF+zNclhQxgPu7vZmYbDf0xL0A6Owd SqHroW8MQ9WsakBLg4EZZ3inE0ybaMsDqnPCFy0dTp4Eon//Jv0wNFUZFj4jU3Lwhqmj+R VMxdMypzs5Fi4FdEBteQ0VfP69ZDEyWKuVdpJ5C+uxeKakqX76fGzJ7b1a3ZrSey845eOa HoOGytHdSl7TuHRR8T+Tefq61NAfOUE2ur28FM1t/3KzJL3kWydx7pF9UdWBQA== Received: from [IPV6:2601:5c0:4202:5670:a80b:d4ea:2604:483] (unknown [IPv6:2601:5c0:4202:5670:a80b:d4ea:2604:483]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4gSM1k4ps9z2NC; Sat, 30 May 2026 13:45:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <6c63abe2-f8d0-4b64-a3b1-1ad9e1a0a100@FreeBSD.org> Date: Sat, 30 May 2026 09:45:45 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 804daf166406 - main - imgact_elf: read program headers if not contained in the first page Content-Language: en-US To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <6a18acc7.32ef9.6a0db43@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/29/26 10:39, Konstantin Belousov wrote: > On Fri, May 29, 2026 at 10:30:48AM -0400, John Baldwin wrote: >> On 5/28/26 16:59, Konstantin Belousov wrote: >>> The branch main has been updated by kib: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=804daf166406a1b0e22f93b9417b90ed7d3aa1ae >>> >>> commit 804daf166406a1b0e22f93b9417b90ed7d3aa1ae >>> Author: Konstantin Belousov >>> AuthorDate: 2026-05-28 09:06:33 +0000 >>> Commit: Konstantin Belousov >>> CommitDate: 2026-05-28 20:59:26 +0000 >>> >>> imgact_elf: read program headers if not contained in the first page >>> PR: 295629 >>> Reviewed by: markj >>> Tested by: Alex S >>> Sponsored by: The FreeBSD Foundation >>> MFC after: 1 week >>> Differential revision: https://reviews.freebsd.org/D57294 >> >> Oh well, I wish I had seen this earlier. I already had a version of this downstream in >> CheriBSD as we have a CHERI-specific case of many phdrs. I had a sysctl/tunable to control >> how many pages of phdrs were allowed which defaulted to something like 4 pages worth but >> could be more easily adjusted than the hardcoded constant here. I will see if I can upstream >> the sysctl at least. > > A sysctl should be a no-brainer, I can add it. I did not see much value > in it being tunable, the current 128 value should be enough for everything? In the changes we have downstream both in LLD and CheriBSD, we support decomposing executables and libraries into multiple compartments which results in separate .text, .data, etc. for each compartment. This results in an arbitrary number of PT_LOADs (as well as additional phdrs CHERI uses such as a PT_CHERI_PCC that is somewhat akin to PT_GNU_RELRO in that it describes properties of a region of address space). So we can indeed construct binaries with many phdrs. -- John Baldwin