From nobody Thu Feb 29 20:08:03 2024 X-Original-To: bugs@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 4Tm2Ml2MRHz5Cq6C for ; Thu, 29 Feb 2024 20:08:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tm2Mk6HLtz4dmQ for ; Thu, 29 Feb 2024 20:08:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709237282; a=rsa-sha256; cv=none; b=ezkmrydQZ8U3hVTJaprWQOA1Keh4Zlbx+DTJ6SHT4f0klpEMYNAuZxLN0NntSmZdylhrMU hw7M7I7jJFpB4PeKLndeJemT4eYZzkcElnt/yWl5wTAQZMhzliQbaDU0STU2733hl1NUyx yKhu5CQ7u2h6HAERcv+eHL6UwpPeipVsi5618bJXH6OBpplRzTqsHqJ1VV3fln/eLpFY71 PhoIpPMzZhivUJ0TBq7BMmTQNp7jSs387hzCRl/oESdWzcY2XtJdo6Yqk6jxR28hfth9eZ bedIgdgK1wrr5SFLaZoUP0ccXsQUWTRbFnlI29bzsBGUq0XeDrCzezQzUd1+jw== 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=1709237282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PW3OpgEdTBkf3kZ9+q958RTxhZoI7yyv65guZeuSfL4=; b=H+u8PRwk8yJh4uwGdLwuYsSQrWUz88dylcHM2HKItPpRdwdEW75twjDpKGcSf0ay18gAlJ nnIoKjqOLVlaAxjcJayPQU+IZ7MahjKdXIn66LWxQE1XPcSItEYJGXG5g7ZpT/eJPUrMWW m3QNyZ41e3Gnui8eUjzDHFCfph2bCi4fZPAlFmXrAKEp06dNdd+ibIE7rSNTd9xqJApjRW u46hFPKEsHx9oJFWQcatVl3LuAMZVK4MCl5rShW/OC4bwqEgGLSW6RIUKz/Di9gBa7WtZ3 oQ212cGeLP6zMobtKocyAU5XZl4RP7Ysom8PyNdCSfF7bdug6ULnB2wIF40VTA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tm2Mk5tvmzwlL for ; Thu, 29 Feb 2024 20:08:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 41TK82dU005579 for ; Thu, 29 Feb 2024 20:08:02 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 41TK82Cx005578 for bugs@FreeBSD.org; Thu, 29 Feb 2024 20:08:02 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 277382] Wrong (or at least strange) stack growth for amd64 pthread stacks Date: Thu, 29 Feb 2024 20:08:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 14.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pjfloyd@wanadoo.fr X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277382 --- Comment #4 from Paul Floyd --- The mmap and mprotect are done in libth thr_stack.c 265 /* Map the stack and guard page together, and split gu= ard 266 page from allocated space: */ 267 if ((stackaddr =3D mmap(stackaddr, stacksize + guardsi= ze, 268 _rtld_get_stack_prot(), MAP_STACK, 269 -1, 0)) !=3D MAP_FAILED && 270 (guardsize =3D=3D 0 || 271 mprotect(stackaddr, guardsize, PROT_NONE) =3D=3D = 0)) { 272 stackaddr +=3D guardsize; >From what I see that can the default can be overridden with _thr_attr_setguardsize but otherwise it is set to getpagesize(). Maybe libthr should check security.bsd.stack_guard_page and if it is 1 or m= ore not add the extra guard page. --=20 You are receiving this mail because: You are the assignee for the bug.=