Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp628665pxb; Thu, 5 Nov 2020 08:53:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxV6tE7+yu8eMrtMJwab+SwEIKS3mFUaDqno/ID83OFo6HRA9CmRnRjCZASw0BgUOdy7E7T X-Received: by 2002:a50:c88b:: with SMTP id d11mr3546667edh.121.1604595228523; Thu, 05 Nov 2020 08:53:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604595228; cv=none; d=google.com; s=arc-20160816; b=kSYPBIIa3+sCRtlQDF4LoS2NpAILWrPcffXvbGc7Ni4guiXVUwRu6eYbcUis0CApN/ yo+uE7sSXujFWqMHNZIr3veuhVVyknhzOMnt4K0SkafQuPMLZxslTQrL/aB7Wt60X8PG 6Ljarru+hHQqoWKCYaOD99Oc9R4d1kMfK0HtgB4wCgpzb4hkWo1e9oqer21zmR2SnuzL 9Z4CJew1wECgrPjrFf0o28BHfUdrYeplz6TlHjY/lpHCj9rG3mWYEhUDZcoqPuhyf5jA nCSSqxgIyHQcFoJ/8KvhPvUc9xfv/IIp6w8C889actICCRPpD32hF0JoIchrN82bI/cU Wo1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=Cz/0efJa6VyuLLQAH22EOsXRr8OamKv2SmfGi3I6JzI=; b=ilPVOFzamuW7eEapMC/fyF+q+38ETWfqSktK84fEvfJjmDvXHiD9ex/g2y71OakiXB WLpqaNE9HwgcwJPR47aztDqIE6CEnZaIQzZJOKOHr8LZdLI0Dn8UkwbUcwiW1Tq7ydv7 eMAaYHmNPjISGYe85twRehw3ueRhdtgRfmZm2XjnE5KMm2COiJ93RJ/jgO2C6KbN9kyj uSWbXlvJbuKKEq69TMntIJcUpSSyNcVZOm/gMIF7ojSMLkcTSEchXiRDuUQ+xmVy0Tab I8f4j5KxS/GWAuqsecl4v53hCXVoCw+EGbswy5dXGeIBpSDVxgxAqQ6lucle6LWaJZWZ SKGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=rCu45Ryx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zn8si1833589ejb.169.2020.11.05.08.53.24; Thu, 05 Nov 2020 08:53:48 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=rCu45Ryx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731311AbgKEQte (ORCPT + 99 others); Thu, 5 Nov 2020 11:49:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbgKEQtd (ORCPT ); Thu, 5 Nov 2020 11:49:33 -0500 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3038C0613CF for ; Thu, 5 Nov 2020 08:49:33 -0800 (PST) Received: by mail-io1-xd44.google.com with SMTP id u19so2475211ion.3 for ; Thu, 05 Nov 2020 08:49:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Cz/0efJa6VyuLLQAH22EOsXRr8OamKv2SmfGi3I6JzI=; b=rCu45Ryxn6gGc9X5LdmjA0u/Q4Jbg0vA1rMDCdnYyNztnYwci60mQfHs72C8DrvxoJ IJq9/KzXvNF9hVnpgVT3bCmEc5+Ucjo641doqEEix5u77VqQ6aIIkpaLu6IrWaw/QYFx MtoRILvCiMzLRoIVeBVNsZqBYR5OjPNGzI4d2kMlUv2GYIivCAfe+SaxtNURIE22UxCJ hu5GCF4injdEfIlx0OAwaOEqhJTkmIrmbtWTlDU+ACt6pIGzA/vl+5P3bQ5YoUghKZpa dUVMrFjQqy9do6u2YqrfCYvwD4UnpZUFOqjlYXsIkurQHHiK38sZxDNaMfkTqjS/qeuk bJsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Cz/0efJa6VyuLLQAH22EOsXRr8OamKv2SmfGi3I6JzI=; b=HP4gFwEoL8xx/BGp2oA6kLnsPd9Ff2Adkg/l5aUBKWkFH3AXupHgirO4a5qbsZqVqS SS9E9/BBnCdnHbNrTVGXEtqlTBcX776Tsrl3v8G7SVXSJF2/HoG/OElKWBT7Hcr+oYpL ycwfD/gnCBXWm8cL0u4q9O2O6QbQfhCEMkIsXLxKPIpQG7iYgiCXgsJV9RX5O2zTLWVe gNSetol1+kLYqiLj0u52JuD/FZRDsEOBNsKw05qxTUgVodFM2hu9KkgzJ+6o0T/KoUNK uN1jpSQovyDAIiwi0KkXd7qJbZRsVrT14RnXkm92PNU62B1plYjFCjRMyOlCGk+QTId4 Nlew== X-Gm-Message-State: AOAM531dZrx1ISLb5eJopoHzDSDww5LDrbE6heYoL/DI8tcV7tT/0oVl bNGzewjrmvSVu7mTaObYgE3UAg== X-Received: by 2002:a6b:3e83:: with SMTP id l125mr2369145ioa.151.1604594972962; Thu, 05 Nov 2020 08:49:32 -0800 (PST) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id o19sm1449425ilt.24.2020.11.05.08.49.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Nov 2020 08:49:32 -0800 (PST) Subject: Re: general protection fault in io_uring_show_cred To: syzbot , io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk References: <0000000000003afa6905b35e6386@google.com> From: Jens Axboe Message-ID: <1390bb94-a400-8e17-3c39-06c38277f091@kernel.dk> Date: Thu, 5 Nov 2020 09:49:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <0000000000003afa6905b35e6386@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/5/20 9:14 AM, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: 4ef8451b Merge tag 'perf-tools-for-v5.10-2020-11-03' of gi.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=12bf23a8500000 > kernel config: https://syzkaller.appspot.com/x/.config?x=61033507391c77ff > dashboard link: https://syzkaller.appspot.com/bug?extid=a6d494688cdb797bdfce > compiler: gcc (GCC) 10.1.0-syz 20200507 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11022732500000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13649314500000 > > The issue was bisected to: > > commit 1e6fa5216a0e59ef02e8b6b40d553238a3b81d49 > Author: Jens Axboe > Date: Thu Oct 15 14:46:24 2020 +0000 > > io_uring: COW io_identity on mismatch Gah, stupid braino in that patch. Below should fix it. diff --git a/fs/io_uring.c b/fs/io_uring.c index 3d489cf31926..29f1417690d5 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -8974,7 +8974,8 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit, #ifdef CONFIG_PROC_FS static int io_uring_show_cred(int id, void *p, void *data) { - const struct cred *cred = p; + struct io_identity *iod = p; + const struct cred *cred = iod->creds; struct seq_file *m = data; struct user_namespace *uns = seq_user_ns(m); struct group_info *gi; -- Jens Axboe