From nobody Tue Feb 10 18:41:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1619501506; cv=none; d=zohomail.com; s=zohoarc; b=VPtZ7AQIPVVU15NE474g034sA4J6UkD+KOko0fKbpJ+UCLXc1tgDWPDRYNLoZ8w/HRXWLW03Mwa7Z5N5J08z/rcJiiUBVXIGOaa9HQkbCrpmgyAYpPFH7RUVG9LgQNrjtDaUMrARBRb/QiAFjpREAB3Sbk4ze+iJaZV7TYtNYI8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619501506; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=SIAK2TVW0PeP+mZ8AAKtvKpWSZZM0GIh6bgKaQl+rZ8=; b=a9ukrnKQm6aNhhE872w4Kckf577MBiLRx8BU/Y4xZ/SD/83CLR8AXBU3NC9LWUzXX4K4Uw4uEv6NULB/UtvR/2QGWVrJMhA/hSXawHvrr1NVCqUHcEhDPFyRkN+1X09dnoFvHWNXMB+OtQLZUNsMg761+13BQ2qZhhH9Br0XB3w= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1619501506024888.3864636454385; Mon, 26 Apr 2021 22:31:46 -0700 (PDT) Received: from localhost ([::1]:43212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbGK0-0003yO-KR for importer@patchew.org; Tue, 27 Apr 2021 01:31:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbGJ7-0003Vp-Lw for qemu-devel@nongnu.org; Tue, 27 Apr 2021 01:30:49 -0400 Received: from indium.canonical.com ([91.189.90.7]:50332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lbGJ4-0006IS-9C for qemu-devel@nongnu.org; Tue, 27 Apr 2021 01:30:49 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1lbGJ1-0005BN-R2 for ; Tue, 27 Apr 2021 05:30:43 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id C984D2E806D for ; Tue, 27 Apr 2021 05:30:43 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Tue, 27 Apr 2021 05:24:38 -0000 From: Wind Li <1926246@bugs.launchpad.net> To: qemu-devel@nongnu.org X-Launchpad-Notification-Type: bug X-Launchpad-Bug: product=qemu; status=New; importance=Undecided; assignee=None; X-Launchpad-Bug-Information-Type: Public X-Launchpad-Bug-Private: no X-Launchpad-Bug-Security-Vulnerability: no X-Launchpad-Bug-Commenters: nightwend X-Launchpad-Bug-Reporter: Wind Li (nightwend) X-Launchpad-Bug-Modifier: Wind Li (nightwend) Message-Id: <161950107824.17271.5936509317690090363.malonedeb@chaenomeles.canonical.com> Subject: [Bug 1926246] [NEW] chrome based apps can not be run under qemu user mode X-Launchpad-Message-Rationale: Subscriber (QEMU) @qemu-devel-ml X-Launchpad-Message-For: qemu-devel-ml Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="f9f562f07f129de414c16be22a405ff0964e0018"; Instance="production" X-Launchpad-Hash: 44027f2fa5f819e9c92111826c03ea7d9df1476e Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=91.189.90.7; envelope-from=bounces@canonical.com; helo=indium.canonical.com X-Spam_score_int: -65 X-Spam_score: -6.6 X-Spam_bar: ------ X-Spam_report: (-6.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bug 1926246 <1926246@bugs.launchpad.net> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Public bug reported: chrome uses /proc/self/exe to fork render process. Here a simple code to reproduce the issue. It's output parent then child bu= t failed with qemu: unknown option 'type=3Drenderer'. Maybe we can modify exec syscall to replace /proc/self/exe to the real path. //gcc -o self self.c=20 #include #include #include int main(int argc, char** argv) { if(argc=3D=3D1){ printf ("parent\n"); if ( fork() =3D=3D 0 ) { return execl("/proc/self/exe","/proc/self/exe", "--type=3Drenderer"= ,NULL); } } else { printf ("child\n"); } return 0; } similar reports: https://github.com/AppImage/AppImageKit/issues/965 =20 https://github.com/golang/go/issues/42080 =20 Workardound: compile chrome or your chrome based app with a patch to content/common/chil= d_process_host_impl.cc:GetChildPath, get the realpath of /proc/self/exe: =20 diff --git a/content/common/child_process_host_impl.cc b/content/common/chi= ld_process_host_impl.cc index bc78aba80ac8..9fab74d3bae8 100644 --- a/content/common/child_process_host_impl.cc +++ b/content/common/child_process_host_impl.cc @@ -60,8 +60,12 @@ base::FilePath ChildProcessHost::GetChildPath(int flags)= { #if defined(OS_LINUX) // Use /proc/self/exe rather than our known binary path so updates // can't swap out the binary from underneath us. - if (child_path.empty() && flags & CHILD_ALLOW_SELF) - child_path =3D base::FilePath(base::kProcSelfExe); + if (child_path.empty() && flags & CHILD_ALLOW_SELF) { + if (!ReadSymbolicLink(base::FilePath(base::kProcSelfExe), &child_path)= ) { + NOTREACHED() << "Unable to resolve " << base::kProcSelfExe << "."; + child_path =3D base::FilePath(base::kProcSelfExe); + } + } #endif // On most platforms, the child executable is the same as the current ** Affects: qemu Importance: Undecided Status: New --=20 You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1926246 Title: chrome based apps can not be run under qemu user mode Status in QEMU: New Bug description: chrome uses /proc/self/exe to fork render process. Here a simple code to reproduce the issue. It's output parent then child = but failed with qemu: unknown option 'type=3Drenderer'. Maybe we can modify exec syscall to replace /proc/self/exe to the real path. //gcc -o self self.c=20 #include #include #include int main(int argc, char** argv) { if(argc=3D=3D1){ printf ("parent\n"); if ( fork() =3D=3D 0 ) { return execl("/proc/self/exe","/proc/self/exe", "--type=3Drendere= r",NULL); } } else { printf ("child\n"); } return 0; } similar reports: https://github.com/AppImage/AppImageKit/issues/965 =20 https://github.com/golang/go/issues/42080 =20 Workardound: compile chrome or your chrome based app with a patch to content/common/ch= ild_process_host_impl.cc:GetChildPath, get the realpath of /proc/self/exe: =20 diff --git a/content/common/child_process_host_impl.cc b/content/common/c= hild_process_host_impl.cc index bc78aba80ac8..9fab74d3bae8 100644 --- a/content/common/child_process_host_impl.cc +++ b/content/common/child_process_host_impl.cc @@ -60,8 +60,12 @@ base::FilePath ChildProcessHost::GetChildPath(int flag= s) { #if defined(OS_LINUX) // Use /proc/self/exe rather than our known binary path so updates // can't swap out the binary from underneath us. - if (child_path.empty() && flags & CHILD_ALLOW_SELF) - child_path =3D base::FilePath(base::kProcSelfExe); + if (child_path.empty() && flags & CHILD_ALLOW_SELF) { + if (!ReadSymbolicLink(base::FilePath(base::kProcSelfExe), &child_pat= h)) { + NOTREACHED() << "Unable to resolve " << base::kProcSelfExe << "."; + child_path =3D base::FilePath(base::kProcSelfExe); + } + } #endif // On most platforms, the child executable is the same as the current To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1926246/+subscriptions