From nobody Sat Mar 15 13:33:00 2025 X-Original-To: freebsd-current@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 4ZFMcY5Zy3z5qnmS for ; Sat, 15 Mar 2025 13:33:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZFMcY4BtTz3lqs; Sat, 15 Mar 2025 13:33:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1742045581; 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=Pbf+4+Hs2V5gcbhSUw3gKAaYIFGZ/1txNBhrsQZ9+9I=; b=es7QZRhxLwzWkT9DjPWSy/+7i0DGor53nB1TjLGYt1bBMrDPlNRnrKckF2Y4uK2/qhqm/s fQVhtwztdfTsEsp3X04TM0bCXQcJCvBuu990Tm438uuDWcdizwbpjuoqsz9d4sJADzjB98 uiKSwWv3surdrEWTk6iLunsHPyLuBzLoOmIAGJP96nR7gkjSdASjA0eJ/j1ddmnhnqpT+a WSKZhDNoBwUgyDzdkzgqrqxII15fECtOyKRmQdXqUTm6wkweIOMjUjnKwv/I+ornSAlrSx DqPE71Rch8SbqyrFdb+mEkXdd3ijiQK9B3U+W/tO7dbnpuGGg10PG8R9vZuNHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1742045581; a=rsa-sha256; cv=none; b=yCGIZBd9hAtChqmWTba2aTwKiRlM8xiPRCCRlLANFsFTtPwXynR2+dcnJzT9BsnXcoo29C 3i+2EeYZpgcomgefwIuZug1qm9iIpvYV9LUMh1OcJn87OykjamC3gxwfoQ7y3/tlGCKAZt 4vjGgR77QjFK/2x5HA/D0DQC6r+RW+16EIRBCoEn1O/t2krz7JT5PtW9oKyuOG9gJojUB2 P9Zq7CUL4JKqKukZEbQBWjdvRSUsHBQ8j7N+Uh0S5RvPhAKgHSa1gF1jTHEOgeyk5U155f +tqiMJKVgWn1GyAwWfY1TayMSGXyGyIMw6/idYm9jLRnWxQcO6vd7nzPRoSCXA== 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=1742045581; 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=Pbf+4+Hs2V5gcbhSUw3gKAaYIFGZ/1txNBhrsQZ9+9I=; b=QLsxnLiOvmfgxW+NZ4zLFNwEu2nqzrGf87OgsNclUlNVVqH6rZPgWf9BnrPADnRNhRq2h9 ulRK9egQUCzpcmhRHqorXTfRWIRyUwaiBWwiLMcGk2SQw+MTW8mkIa7Nt6gpuNGXx0cTkF lKzhxvNfMkqydyuT5gPFW3aZZfnaAzedXCWnK1LqftOmEz/uXbstZ5KNBCd7oz7w3iUNpW MqRtb8Q5mKZxAVvHNvjELpK7NzMblv9h9YM6vb/0yEUwd0SHYFFojNC919VDiErCkXsDJq WjR9tiGnqzgCgOK2Ovoe7jq9grHSpxPUIYIliaDdo9Aa1kvE4CfXsz5W6Up8WA== Received: from [10.9.4.95] (unknown [209.182.120.176]) (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: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4ZFMcY20S6zp2h; Sat, 15 Mar 2025 13:33:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Sat, 15 Mar 2025 08:33:00 -0500 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: -fstack-clash-protection triggers something in setfstab() To: freebsd-current@freebsd.org References: <5ebbe12dc6cb4e3fc00f0a07c03856e4@Leidinger.net> <2400b4d10d4804eef784768d050f6953@Leidinger.net> Content-Language: en-US Cc: Michael Gmelin From: Kyle Evans In-Reply-To: <2400b4d10d4804eef784768d050f6953@Leidinger.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit [+grembo@ for iocage] On 3/15/25 06:26, Alexander Leidinger wrote: > Am 2025-02-26 16:20, schrieb Alexander Leidinger: >> Hi, >> >> the working system is from 2025-01-25-141603, the non working system >> is from 2025-02-21-115311. >> >> I'm not sure what the issue is exactly. I have traced down the change >> of behavior to >> ---snip--- >> if not LIBC.setfstab(fstab_file_path.encode()): >> ---snip--- >> >> In the working case LIBC.setfstab returns true (so with the not it >> doesn't take this branch), and in the non-working case it returns >> false (so with the not it takes this branch). >> >> Is someone aware of a change in this area? Searching for it (https:// >> cgit.freebsd.org/src/log/?qt=grep&q=setfstab) only brings the initial >> commit. > > Interestingly my own commit triggers this issue. > > I bisected and commit 1c2ae9233b0ed4f6b92c59c0e4026f6ddc073e4a is > causing this. This is the first ref which triggers the issue that iocage > can not mount filesystems anymore. And the failing call in iocage seems > to be the python LIBC.setfstab() call. And this only triggers, when the > basesystem is compiled with the stack clash protection. I do not see any > obvious issue in our setfstab code. Anyone with an idea? > setfstab() implementation seems more or less fine, but it's hard to tell what's going on with iocage there. setfstab(3) doesn't actually have a return value in any version of FreeBSD, so I guess it's picking up some sort of garbage as the return value. Looking at the context, you can only tell if the open failed with the subsequent getfsent()/setfsent(); that branch should probably just be removed entirely, and the initial getfsent() might be worth error-checking for potential error or premature EOF. Thanks, Kyle Evans