From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3CB4C433FE for ; Sat, 29 Jan 2022 00:25:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2FCF46B0075; Fri, 28 Jan 2022 19:25:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2AC966B00DC; Fri, 28 Jan 2022 19:25:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 14D096B00DE; Fri, 28 Jan 2022 19:25:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id 0234D6B0075 for ; Fri, 28 Jan 2022 19:25:52 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7BD951802EFE4 for ; Sat, 29 Jan 2022 00:25:52 +0000 (UTC) X-FDA: 79081431744.15.69EF90E Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf25.hostedemail.com (Postfix) with ESMTP id F1D7CA0006 for ; Sat, 29 Jan 2022 00:25:51 +0000 (UTC) Received: by mail-pl1-f182.google.com with SMTP id s6so2104170plg.12 for ; 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=qBUWKdE1lC+0cSIwgi/AlWga+0gCJw40ihCFIERrfZlelMT6685wkkEkvcBZT8c0uZ CpUsOeogP8QEZBrinXoSGZXhRK4rjL46+fqB6fdrZTw1HTOlAi1VaKaF1GCrFIak6QZy ODKSFJKPPpJDW7R6CcnadI8j6HrHpf+VBg68LCwChz7epQtVUiU/YsvpgLDwWO4lTyFs YeQOtd4rp2bLeNW9DcCbo8u5RMJ+4JLfaUr/CZ5AcyDpWKfV7+p1zz0uSG4vVd3nng8P gmuaEevAfsn+ws3+TTPxK8HrABSyAZzxqo51uEzalpZf3Q3+VxmgV+ihZiCSzQRBanW3 3H5w== X-Gm-Message-State: AOAM533Ax28IZ+mSoYcZGG/9EsJ/AflJGk/1coFnt6DOldtovzkemYg/ UWQozFSxQl6W7u2wjxMoFX0= X-Google-Smtp-Source: ABdhPJxGUBwrXIsIvWjyBvE7iD7hhKKZofoG8jdKEZkaAkI6iN89JrcM0KVp7Fklh5htvME7X79KGw== 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: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: F1D7CA0006 X-Rspam-User: nil Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="ZmMi/m8m"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf25.hostedemail.com: domain of jencce.kernel@gmail.com designates 209.85.214.182 as permitted sender) smtp.mailfrom=jencce.kernel@gmail.com X-Stat-Signature: hhg18ssqjyp4d96njfmq8ctrmoz8uhei X-HE-Tag: 1643415951-632813 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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