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 3D936C2BA4C for ; Wed, 26 Jan 2022 06:33:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A6B156B0074; Wed, 26 Jan 2022 01:33:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A1BDB6B0075; Wed, 26 Jan 2022 01:33:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E27F6B0078; Wed, 26 Jan 2022 01:33:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7EF026B0074 for ; Wed, 26 Jan 2022 01:33:35 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 33AFE95260 for ; Wed, 26 Jan 2022 06:33:35 +0000 (UTC) X-FDA: 79071471990.19.90B9344 Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) by imf19.hostedemail.com (Postfix) with ESMTP id 3E9591A0003 for ; Wed, 26 Jan 2022 06:33:34 +0000 (UTC) Received: by mail-yb1-f181.google.com with SMTP id v186so68581881ybg.1 for ; Tue, 25 Jan 2022 22:33:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ChJmRDJEm5pXcjV3RhCmm6g5TfXTFkO1Rcc6sHnIoj4=; b=GhWYMsUW3Qbr9HHuE1hilXCPJIChi71Nm2odYfcUOh34TGObPJ6KOcMJ+S/hQuxHV5 F+W+7Msf0GoOhpLBKO05zSE8oWLEp3XTqstMnSDTh7ucRYF+L1RJw58oS5Gby58MOtUC LssQfspxrjVVfjjBD5VDWKj7ajonyXUMjFEvFojFx1ET3d3yo6SmYlpibRrbhmc7vYsx U0uhAruxNq+sOCzJo6bqt6YqZvyK8ZtKm/m7cvPM6YQIqXgf9emV8BAVuU9E1tiP4ez5 ILuGa68x6JrWOh8QCeDL2ZNdtxqOD0w4kWaT2xtK7MJ4l2Uv8UT+Fbn8eq9ks8PZMgdy AwXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ChJmRDJEm5pXcjV3RhCmm6g5TfXTFkO1Rcc6sHnIoj4=; b=v2mV22A5YESHimmgv2gAZNjWgDIP/KIXOYQ1+PlO6GqybHL/VxZOgoO7RumjYgG0jQ LIdfB3un3+b7yYo9Cz75Z8uCgle6le7SrM6xQ+ccnQjG2/d4I1XuroU5DkGFO8r4o9P8 wv5LyPxWIMrM5zFYAPG+H3CJsi8uIBZHKIHnK0dH7QGqv8z0mE/VdmY0OQqa1iAhKcHn V9xofCpC+H/KXEjm5T/5bzrp14C9jidi/dZdudVTtnmKV4CKeMU0pucYM3V74JmI2cQN jigmtxHOs6BPb1RW1KzO5vtVXzQDPPpJnWe5nxrknDzgCMDVdjEyichxKyUB85q8ekZE E7tQ== X-Gm-Message-State: AOAM532rMUeR9PD4S+tilmcOVjnJrWa01OcuoZKqsltlUYBjZJIKxGUm 4kV66+LpIlAy9dTUZ0zXk6Xt3dxdjq5J+UbSouE= X-Google-Smtp-Source: ABdhPJyVOElZioeXwIvY64lBpQdHS4C6bPEoMaUFuCbrg+JVWJA/pH6s/0VZ7VCo2DXoBCw92rWh/r2oABcZTMP35VE= X-Received: by 2002:a05:6902:1107:: with SMTP id o7mr30485838ybu.270.1643178813246; Tue, 25 Jan 2022 22:33:33 -0800 (PST) MIME-Version: 1.0 References: <20220124003342.1457437-1-ztong0001@gmail.com> <202201241937.i9KSsyAj-lkp@intel.com> <20220124151611.30db4381d910c853fc0c9728@linux-foundation.org> In-Reply-To: From: Tong Zhang Date: Tue, 25 Jan 2022 22:33:22 -0800 Message-ID: Subject: Re: [PATCH v1] binfmt_misc: fix crash when load/unload module To: Murphy Zhou Cc: 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 Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: of13xpe6kqf8rds6jbsdhmnayuek498x X-Rspam-User: nil Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=GhWYMsUW; spf=pass (imf19.hostedemail.com: domain of ztong0001@gmail.com designates 209.85.219.181 as permitted sender) smtp.mailfrom=ztong0001@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 3E9591A0003 X-HE-Tag: 1643178814-300130 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000064, 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 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 ###############################################################