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 03361EE498B for ; Fri, 18 Aug 2023 17:56:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6BDB494006E; Fri, 18 Aug 2023 13:56:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 66D05940012; Fri, 18 Aug 2023 13:56:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 534DA94006E; Fri, 18 Aug 2023 13:56:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 40F20940012 for ; Fri, 18 Aug 2023 13:56:48 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 136BCA0ABA for ; Fri, 18 Aug 2023 17:56:48 +0000 (UTC) X-FDA: 81137980896.17.433A2C4 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf17.hostedemail.com (Postfix) with ESMTP id 3FC0D40015 for ; Fri, 18 Aug 2023 17:56:46 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b="DgCN3Jd/"; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf17.hostedemail.com: domain of keescook@chromium.org designates 209.85.214.179 as permitted sender) smtp.mailfrom=keescook@chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692381406; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NnfOvircwmzonwWqUmHydK9lcy2/QxRfXy/Xv+icsas=; b=qadAUKjD7y7PWE7jKpOGViPMEDOskq/KXwd4ZqJxaQCtFAkUwKCKJM2HZFIyhJedwOLKF4 DwMLmekCeVsPSD+KlR7RZ3JlDCUPmGxVCvRcy0/G5Q0G+MYA7ebDMCCAZjHFIIM80ABCxA 9EEjIAsuA0cAsssmvgUGAjsY5SFMOrg= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b="DgCN3Jd/"; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf17.hostedemail.com: domain of keescook@chromium.org designates 209.85.214.179 as permitted sender) smtp.mailfrom=keescook@chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692381406; a=rsa-sha256; cv=none; b=NaC99/FWACmBkZ3R3UVCcxW/UMJsAE1495C/F6jRqY7qw/3Ueol/lDg2EF0FyB9eWZ67rF iTbJS+cywtdi9sWDTuZNmB/wwJ30Vb/0RwrKzZ8uxus7/um4Ah8tt1C7EJ3nCo3OGbVM9o fKa4gBqdDEtzcCWQRBBOSI7f6jaOHLM= Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1bdbbede5d4so9729085ad.2 for ; Fri, 18 Aug 2023 10:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692381405; x=1692986205; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=NnfOvircwmzonwWqUmHydK9lcy2/QxRfXy/Xv+icsas=; b=DgCN3Jd/PxcsNcRlYxx4BzLrSBJrYtbbHYGvLalhOU8EtwK50AtTN3Aofh7pD8iLSi HcHpnOuaBYQATuaOtl4xiJe9P5KGJhumh2RYH45lnMGkkZDSuAqo8c7BUFBcgtrq+p2X l+QYCE4swvI2Jf2sgq6MqMup5zRm6AFkVusjA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692381405; x=1692986205; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NnfOvircwmzonwWqUmHydK9lcy2/QxRfXy/Xv+icsas=; b=ixMMehy4/sKGWlegmalyeSvEp1a+gdrxV4thDOz0O+3FBanOe5c1KDC3YOmx0hIWI5 rcgmMOqZYWq6V6Yu910r1zYbYaUJBMivLX/UKRRUr6vyrgXeKrLNkeCebwuBwR/GbLVM aVQu4rlyKSt8f7nM+bWEXSKDtNEyQXYH2ugcCNMVcfxVht6/oJAmEkKOKW82JXPYmIEq r0VIGIzVuSV8CVUu3rCfNLhwI9kHu4RWmMAj5QUhCa7ZHyc1sQ8IQ7Hj4A5RtH2AECTD 8Svxsg0CSGnDWe/wCmnbUq8CcGiT61jNrCCT5ND22EWKvqDyOWJ8cVQMZq21LbDm35L3 p1Hg== X-Gm-Message-State: AOJu0YylbtQunopXAvma5b8ifGJPsMNExPnh5B6OrdVkvP/OsDJ7Ykq0 Pn1qwePFjl33Qu8WJhIiIeBZ4A== X-Google-Smtp-Source: AGHT+IGg4gZs48PTflMiuJSOSkNRPIt40O7HOlI6qEPHZkp6HPo5TXRZIf4MGveF+BSpktQ3KpawCQ== X-Received: by 2002:a17:902:d4d1:b0:1b8:b285:ec96 with SMTP id o17-20020a170902d4d100b001b8b285ec96mr3835658plg.23.1692381405137; Fri, 18 Aug 2023 10:56:45 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id 10-20020a170902c14a00b001b8953365aesm2049883plj.22.2023.08.18.10.56.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 10:56:44 -0700 (PDT) Date: Fri, 18 Aug 2023 10:56:44 -0700 From: Kees Cook To: Matthew Wilcox Cc: "Eric W. Biederman" , syzbot , anton@tuxera.com, brauner@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-ntfs-dev@lists.sourceforge.net, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk Subject: Re: [syzbot] [ntfs?] WARNING in do_open_execat Message-ID: <202308181056.381D7C347@keescook> References: <000000000000c74d44060334d476@google.com> <87o7j471v8.fsf@email.froward.int.ebiederm.org> <202308181030.0DA3FD14@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 3FC0D40015 X-Stat-Signature: xera46o39fcoz91mf8yxu6ayt5kdxbs3 X-HE-Tag: 1692381406-60213 X-HE-Meta: U2FsdGVkX18O2I4IvKqJ63zw/PatX8kKAC6l9jJt8svxJvAFtdJrHqfirzF+UCBWc7EjmdKYIQPfAaXpXuCNRhvDSGJ/3f+WGpUdvGJj8S7WWvY8wIE1Ke2N0yLyh45tE0tfkCnE5D0hkVfykod55jtHlsmbMkI+mak8TyAlAQV99E6rZARTD5LhVQexdKIvXrfWTQI1c1ARN2Cuwh1kg7jrvlPuXlfqJGjLjTKgUfcs7gScTSLwjnXEpgdeOCdjvz3+ttGZyAsdFFm2UI+isrk+392rEE9L5Hy+4svCmusFh82DKkyKahLn90MtjRzWVpa/bikrN0nMOAxmq7NrrLr9P2LCJjN87AC6NXkOYt7SJTOsWnAjoUHXu+d+7ZDV1SzLHZDfF50yK/p1XZ9qpetGumQkQtw1mAPSyHScJMrbt0zzmaQnI8F3GruKH0nKt+iW4llq0vKbFuAHFWg+u2hPly35Nd/fCzXikJ3c5BvALB5VjWifyWc5SDPMPOcIHvcQgoxHxe318adFE+6opIsB/oVgxVlvo+rrUOhybZwxgee1VWo1N/R85MTpd3SfTKfSjOEx9L13wqWHeSMLbppEtCmtW6vMuKOn4xyqU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LE1hVPUY3Nv99lqd+yOLig+TclR+vxeWh5s7lcNQF7fRj6n66smOZpy66HAq4qtQ1WPGmCJ5zCj03LvwYiqplsu28ol9ikQLMYpUaDZB75zZSJSE3MetsZPXjEbqs+wiOAQ201IHZFTIq4iFGCPG7OaUWbYbc/SmqiGw0GQglNZILFsXfg97MxSagFRQtmTCe+MkEcO0hJCdhKOePcqC+jaOcWRjwFM2Vb+Y5D/uEWH49NO2iPRaB5E0R3tktAx4EHJLgvUQWd/zbWdj8dxToWJuYUdTYe8hQ== 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 Fri, Aug 18, 2023 at 06:43:11PM +0100, Matthew Wilcox wrote: > On Fri, Aug 18, 2023 at 10:33:26AM -0700, Kees Cook wrote: > > On Fri, Aug 18, 2023 at 11:26:51AM -0500, Eric W. Biederman wrote: > > > syzbot writes: > > > > > > > Hello, > > > > > > > > syzbot found the following issue on: > > > > > > Not an issue. > > > Nothing to do with ntfs. > > > > > > The code is working as designed and intended. > > > > > > syzbot generated a malformed exec and the kernel made it > > > well formed and warned about it. > > > > > > Human beings who run syzbot please mark this as not an issue in your > > > system. The directions don't have a way to say that the code is working > > > as expected and designed. > > > > WARN and BUG should not be reachable from userspace, so if this can be > > tripped we should take a closer look and likely fix it... > > > > > > HEAD commit: 16931859a650 Merge tag 'nfsd-6.5-4' of git://git.kernel.or.. > > > > git tree: upstream > > > > console+strace: https://syzkaller.appspot.com/x/log.txt?x=13e2673da80000 > > > > kernel config: https://syzkaller.appspot.com/x/.config?x=aa796b6080b04102 > > > > dashboard link: https://syzkaller.appspot.com/bug?extid=6ec38f7a8db3b3fb1002 > > > > compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 > > > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17cdbc65a80000 > > > > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1262d8cfa80000 > > > > > > > > Downloadable assets: > > > > disk image: https://storage.googleapis.com/syzbot-assets/eecc010800b4/disk-16931859.raw.xz > > > > vmlinux: https://storage.googleapis.com/syzbot-assets/f45ae06377a7/vmlinux-16931859.xz > > > > kernel image: https://storage.googleapis.com/syzbot-assets/68891896edba/bzImage-16931859.xz > > > > mounted in repro: https://storage.googleapis.com/syzbot-assets/4b6ab78b223a/mount_0.gz > > > > > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > > > Reported-by: syzbot+6ec38f7a8db3b3fb1002@syzkaller.appspotmail.com > > > > > > > > ntfs: volume version 3.1. > > > > process 'syz-executor300' launched './file1' with NULL argv: empty string added > > > > ------------[ cut here ]------------ > > > > WARNING: CPU: 0 PID: 5020 at fs/exec.c:933 do_open_execat+0x18f/0x3f0 fs/exec.c:933 > > > > This is a double-check I left in place, since it shouldn't have been reachable: > > > > /* > > * may_open() has already checked for this, so it should be > > * impossible to trip now. But we need to be extra cautious > > * and check again at the very end too. > > */ > > err = -EACCES; > > if (WARN_ON_ONCE(!S_ISREG(file_inode(file)->i_mode) || > > path_noexec(&file->f_path))) > > goto exit; > > > > So yes, let's figure this out... > > When trying to figure it out, remember that ntfs corrupts random memory, !! Oh. Well, then yeah, that's not great. :( -Kees > so all reports from syzbot that have "ntfs" in them should be discarded. > I tried to tell them that all this work they're doing testing ntfs3 is > pointless, but they won't listen. -- Kees Cook