Path: csiph.com!aioe.org!bofh.it!news.nic.it!robomod From: Stafford Horne Newsgroups: linux.kernel Subject: [BUG] OpenRISC exec init fails, bisected to 0886551 ("initramfs: finish fput() before accessing any binary from initramfs") Date: Thu, 04 May 2017 09:20:02 +0200 Message-ID: X-Original-To: lokeshvutla@ti.com, LKML Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=4O83xAh25fmo6a7nTbBN7wePmz+dt0S4FbdE7Igyugs=; b=mayvdDOTDhg5MchOys3UMijJeG/d63YazxgOoRaPwi/hHrygoiiKid8cypd7qj+FeP u+JkliVVcZ11GLC22juS3MmIkXi+dBAWNmF0hxYkxnTTzlBEWFNwEivwOS2EM9c44UFQ jFiCnhv51u6uvB0RnZuYEOP9DkDDOaf+W6Snl/wIk43ERl86JxwdB9ZXsBNXC/7PVN60 cJMqDEcSaVhxTQcycLcPg2rvw7G3B7nhM/yfwihmr8K0b6SrMrUGY+e5tJQmwBb4TZTe 4xhDJkVEvrraEd4QsiFYTD2WzPkpoHMZ9jIV9tG2qztVwEn68ZghFgaL5rdMgrn2rIWR CccA== X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=4O83xAh25fmo6a7nTbBN7wePmz+dt0S4FbdE7Igyugs=; b=KjXgCQ4f26rCh14MdKV/en6RbjRwOgpFSb8OxVDfEGV5PXTBgkyeOlxjUzBvF2HO/K 5m0F6nheXISiUUQAovGKceOGVzZV/L9A8yamdmNtMR2fhyW1UWqMs5P+Gfxld+n8lkRw MeZ02MvB7+JkSmofoSe/Wpr3uVQhVHWooM+c5M52Q7zJGQZcvvmzUiiseEUiEPeyDkUl +ywZrgebK+8+iHBdid3x+KzKUEa2y80JYnVrl9J5pfHxkxYBUC3gp5xISRH2vQffAGfB KDLWkRLR1Ut5JN24nYYXl+XTRTvBSASfnA7k0MMfuvZpXokR/9GOd/dBDMShSZuDE7z3 Y8Uw== X-Gm-Message-State: AN3rC/5SGwzZ1H2sAhkYEO6e5nFmf2uCUWiDLwDjhb2PE64KMKzAH758 2oWnPj6NKme2qQ== X-Received: by 10.84.197.3 with SMTP id m3mr55281646pld.3.1493881880771; Thu, 04 May 2017 00:11:20 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.8.0 (2017-02-23) Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 49 Organization: linux.* mail to news gateway X-Original-Cc: Murali Karicheri , Al Viro X-Original-Date: Thu, 4 May 2017 16:11:18 +0900 X-Original-Message-ID: <20170504071118.GA17317@lianli.shorne-pla.net> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1635446 Hello, While booting the v4.11 kernel I found the below issue. The summary of the issue mentions Commit 4a9d4b024a31 ("switch fput to task_work_add") implements a schedule_work() for completing fput(), but did not guarantee calling __fput() after unpacking initramfs. Because of this, there is a possibility that during boot a driver can see ETXTBSY when it tries to load a binary from initramfs as fput() is still pending on that binary. It seems this patch (0886551) introduces that issue though? I am looking into it, but any suggestions would be helpful. BOOT LOG Compiled-in FDT at c03b9100 Linux version 4.10.0-10351-g0886551 (shorne@lianli.shorne-pla.net) (gcc version 5.4.0 (GCC) ) #223 Thu May 4 16:01:02 JST 2017 CPU: OpenRISC-0 (revision 0) @20 MHz ... Freeing unused kernel memory: 2856K This architecture does not have kernel memory protection. Failed to execute /init (error -26) Starting init: /sbin/init exists but couldn't execute it (error -26) Starting init: /bin/sh exists but couldn't execute it (error -26) Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. ---[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. TO REPRODUCE The failure is intermittent. Using some tools: - initramfs: https://github.com/stffrdhrn/or1k-utils - compiler: https://github.com/openrisc/or1k-gcc/releases (or1k-linux-5.4.0-20170218.tar.xz) - qemu: version 2.9 Make and run using: make ARCH=openrisc defconfig make -j5 ARCH=openrisc CROSS_COMPILE=or1k-linux- \ CONFIG_INITRAMFS_SOURCE="../openrisc/or1k-utils/initramfs ../openrisc/or1k-utils/initramfs.devnodes" qemu-system-or1k -cpu or1200 -M or1k-sim -kernel vmlinux -serial stdio \ -nographic -monitor none -Stafford