Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4769pxb; Mon, 31 Jan 2022 03:52:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8w4blku0qyyt6t5YrwrFkydEKb7LN6KVwfTADbg1kJ0x7dfJdBrycNTpTbQFirnjG4wrA X-Received: by 2002:a63:243:: with SMTP id 64mr16597706pgc.117.1643629955171; Mon, 31 Jan 2022 03:52:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643629955; cv=none; d=google.com; s=arc-20160816; b=Wr9jgZXvT+2W+W263f+Pu5hK40LmnpYiVVAn6bOuAnK9/L67UicauMGHRYZJnEc4uu ukGZlqrJVhBL9614q9tY34achr+uT6RCnxdIlBxiAhcfheJdE1eGXnXLmdvtMSw67u08 rUXwuEJtg4VZRMNy5Qo1d1xCqqQFbUjBYRTHSLZhvorscFofretoKIESuRiVO+Qjb3Jj bRZViDuTJ3ECSI/5l+I19rMskSnvG2cqJwbjJvpPWKc41HIPBJ0Pkk/V2UR/IcSgbzJL t9kUviYHuRsKNVWshaeI5wVoR8xMYuvzVJljpFoDQqlLXmxEgkOs5GNG7AHeYmLKeMlq 8JEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/pPDd+attnJsl63O2HKUbF+O/A8INXps1SnOP74pJYY=; b=YDNOLp5U9sE3tppt21rasFM2+jVKPQ/1FGl2cOtv3RzkFF4sFQVf5GsF00h3pA8Qqx O/Rz8UgEsW46J8DHsKt/j+l9qbtxtOZHfT2kTiZinIl+3R50hYC6vIBzok9zwmWnai6g 7N3laEBQkXgn6s2o8sQ3l50jgm0hC8l/PniaUbpAuCjNu0+SrObnnWPREcDe1JWEe7n7 9IVeAuHltvjPAfCtwmV428eUH/TMJ9KE/bcT3vzGd3wYjE7ZgDlWN3JNZnjs0vbFHgNB F6KwfyJBSEpc5QT33lEikoDC4wVa3ksfyNOIa68brGzabygERbwwsAPUz2jrsGHO0ylI pI9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="ZmMi/m8m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si16527871pgt.845.2022.01.31.03.52.23; Mon, 31 Jan 2022 03:52:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="ZmMi/m8m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344582AbiA2AZw (ORCPT + 99 others); Fri, 28 Jan 2022 19:25:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236828AbiA2AZv (ORCPT ); Fri, 28 Jan 2022 19:25:51 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5701CC061714; Fri, 28 Jan 2022 16:25:51 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id u11so7604980plh.13; Fri, 28 Jan 2022 16:25:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/pPDd+attnJsl63O2HKUbF+O/A8INXps1SnOP74pJYY=; b=ZmMi/m8mJU70T7Kv/C8oVf4m938D9oPY/i7w9HyEzZkX8ZQfLSDnpE465uNVFvLURo ELT2NuHM0MTPAW8GnUsQs++zggWqi4hdHYNbs0V7AI0WZNGufmb1W/5ByBln2lgdyMvf okoCuC10ZC/71OjePfylGC7ZDr5bId3WyBoOD6EOFfSZeZJpwptCqM31ranhTQyhKteY puWSQv7ULMBhJc5W+qpaOeEV4Ys8AVAe0OPlR/FNZY7M69fmq6fT8Bxan0k5vO5B7Ens Du5JmaOtNR4ivaexI8ja30CQjn2tycvyxuQVgpINjsegiOFatUZawO0VAulStkIHeVQ3 yOuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/pPDd+attnJsl63O2HKUbF+O/A8INXps1SnOP74pJYY=; b=yh5Vg3a3/VPFwf8BK0uGgQQQs9JfzlyiosHB7fU9lEBIutLZ/QqJrRUk+6FSwi9uqp /iHjqDfu3p0klUJlaJGuFUR+/u4atWFgC+1k8Gnoxsz7PadVhyW/oD2RZOmYkULUkZeb Z8C08HZqtKMcwkXX2ljaTYXNXlt3I6zDODaFL6OspFuaof+GvGZVaiTq06vdb8CDPxh4 82daMhQpoxnhqadM/57qlYbT++GvhYlESZPhAA1YDHCn7bp436pKvdkah0baWC+A2DPJ zTGgQF1OVTXMDyzNyq9kcmEU8yYHW2orU7NNLDzcqH68//PcglaM5SnWdbkFAjQRxot5 Y4WQ== X-Gm-Message-State: AOAM533CxJyXUCl3RjxPj459RItg6bs6O6fumJy3RscOYe8U2WNoDzy8 jN9p/J8Q1CIO1nPv/2ChcY8= X-Received: by 2002:a17:90b:1b52:: with SMTP id nv18mr12833133pjb.20.1643415950815; Fri, 28 Jan 2022 16:25:50 -0800 (PST) Received: from xzhoux.usersys.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id nn2sm3455850pjb.35.2022.01.28.16.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 16:25:50 -0800 (PST) Date: Sat, 29 Jan 2022 08:25:43 +0800 From: Murphy Zhou To: Tong Zhang Cc: Murphy Zhou , Andrew Morton , kernel test robot , Alexander Viro , Eric Biederman , Kees Cook , Luis Chamberlain , Linux-Fsdevel , Linux Kernel Mailing List , llvm@lists.linux.dev, kbuild-all@lists.01.org, Linux Memory Management List Subject: Re: [PATCH v1] binfmt_misc: fix crash when load/unload module Message-ID: <20220129002543.hjintsmbjtprwugw@xzhoux.usersys.redhat.com> References: <20220124003342.1457437-1-ztong0001@gmail.com> <202201241937.i9KSsyAj-lkp@intel.com> <20220124151611.30db4381d910c853fc0c9728@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 25, 2022 at 10:33:22PM -0800, Tong Zhang wrote: > On Tue, Jan 25, 2022 at 9:23 PM Tong Zhang wrote: > > > > On Tue, Jan 25, 2022 at 9:04 PM Murphy Zhou wrote: > > > > > > Still panic with this patch on Linux-next tree: > > > > > > [ 1128.275515] LTP: starting binfmt_misc02 (binfmt_misc02.sh) > > > [ 1128.303975] CPU: 1 PID: 107182 Comm: modprobe Kdump: loaded > > > Tainted: G W 5.17.0-rc1-next-20220125+ #1 > > > [ 1128.305264] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 > > > [ 1128.305992] Call Trace: > > > [ 1128.306376] > > > [ 1128.306682] dump_stack_lvl+0x34/0x44 > > > [ 1128.307211] __register_sysctl_table+0x2c7/0x4a0 > > > [ 1128.307846] ? load_module+0xb37/0xbb0 > > > [ 1128.308339] ? 0xffffffffc01b6000 > > > [ 1128.308762] init_misc_binfmt+0x32/0x1000 [binfmt_misc] > > > [ 1128.309402] do_one_initcall+0x44/0x200 > > > [ 1128.309937] ? kmem_cache_alloc_trace+0x163/0x2c0 > > > [ 1128.310535] do_init_module+0x5c/0x260 > > > [ 1128.311045] __do_sys_finit_module+0xb4/0x120 > > > [ 1128.311603] do_syscall_64+0x3b/0x90 > > > [ 1128.312088] entry_SYSCALL_64_after_hwframe+0x44/0xae > > > [ 1128.312755] RIP: 0033:0x7f929ab85fbd > > > > > > Testing patch on Linus tree. > > > > Hi Murphy, > > Did you apply this patch? > > Link: https://lkml.kernel.org/r/20220124181812.1869535-2-ztong0001@gmail.com > > I tested it on top of the current master branch and it works on my > > setup using the reproducer I mentioned. > > Could you share your test script? > > Thanks, > > - Tong > > I can find binfmt_misc02.sh on github, and running the following > command shows: failed 0. > > ./runltp -s binfmt_misc > Running tests....... > <<>> > tag=binfmt_misc01 stime=1643178454 > cmdline="binfmt_misc01.sh" > contacts="" > analysis=exit > <<>> > [ 90.908282] LTP: starting binfmt_misc01 (binfmt_misc01.sh) > binfmt_misc01 1 TINFO: timeout per run is 0h 5m 0s > binfmt_misc01 1 TPASS: Failed to register a binary type > binfmt_misc01 2 TPASS: Failed to register a binary type > binfmt_misc01 3 TPASS: Failed to register a binary type > binfmt_misc01 4 TPASS: Failed to register a binary type > binfmt_misc01 5 TPASS: Failed to register a binary type > binfmt_misc01 6 TPASS: Failed to register a binary type > binfmt_misc01 7 TPASS: Failed to register a binary type > binfmt_misc01 8 TPASS: Failed to register a binary type > binfmt_misc01 9 TPASS: Failed to register a binary type > > Summary: > passed 9 > failed 0 > broken 0 > skipped 0 > warnings 0 > <<>> > initiation_status="ok" > duration=0 termination_type=exited termination_id=0 corefile=no > cutime=2 cstime=17 > <<>> > <<>> > tag=binfmt_misc02 stime=1643178454 > cmdline="binfmt_misc02.sh" > contacts="" > analysis=exit > <<>> > [ 91.133399] LTP: starting binfmt_misc02 (binfmt_misc02.sh) > incrementing stop > binfmt_misc02 1 TINFO: timeout per run is 0h 5m 0s > binfmt_misc02 1 TPASS: Recognise and unrecognise a binary type as expected > binfmt_misc02 2 TPASS: Recognise and unrecognise a binary type as expected > binfmt_misc02 3 TPASS: Recognise and unrecognise a binary type as expected > binfmt_misc02 4 TPASS: Recognise and unrecognise a binary type as expected > binfmt_misc02 5 TPASS: Fail to recognise a binary type > binfmt_misc02 6 TPASS: Fail to recognise a binary type > > Summary: > passed 6 > failed 0 > broken 0 > skipped 0 > warnings 0 > <<>> > initiation_status="ok" > duration=0 termination_type=exited termination_id=0 corefile=no > cutime=3 cstime=25 > <<>> > INFO: ltp-pan reported all tests PASS > LTP Version: 20220121-9-g010e4f783 > > ############################################################### > > Done executing testcases. > LTP Version: 20220121-9-g010e4f783 > ############################################################### Ya, looks like it's working. No panic on next-20220128 tree. Thanks, -- Murphy