Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2820449ybk; Mon, 18 May 2020 08:41:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8ll3VYM5MNQOn9ZskZtpRT9IFPyOsRaUAUCn3Ub9yK6WUFnKIGHaiHFYU1/DJBUCStTva X-Received: by 2002:a17:906:bb07:: with SMTP id jz7mr14870305ejb.317.1589816486121; Mon, 18 May 2020 08:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589816486; cv=none; d=google.com; s=arc-20160816; b=IONolpZDdVCSa1ugqM6gDfImi6HaDroZy+VSqZRlcIPtKNbM+Z3/ysCu3i80zCL9YQ Swza4Xrc5hvZkk6Eix62lFR4LmoYVvnZA2czFGnPNeP7UK8TWVr5lBXBpLxB1jeNG8Fn xGGbgn5BltKgkhaTzxHNooG4kGvMqQ59Z3kaBmBXL6X3TF2iCb7bTdmmk86wNeAL5E2e SYb4QtO0q2HRDpzLcKQvc2g3L67/TNowxqXPat3kdYtnEuxfapOIWdxAvFBfE3pr+Tuc YsGJURvMN5ZozCm9zxpUNbRmrZLSpSbRi943TGZsmOVzb1UYmKhha7mK8CtdVdUrdZjv Kg1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=HzhSYttZh84iJxgNDUF9WyW9QxOVVdvYiRIlsUwTMek=; b=DqVCCfxFejJ4/NSzGmc/HNZyZXYCLe/JGgLnyKX2Z6Jgm7oQsgCtKFzV7KJYmKYuff Gre1PKnc/AifXXI4yBazSe9kT2JlkO6WAz55VQFHMxx/xLkSHnKcazOzPs8apgUWV/S+ XA72d4tbq3WEnwzAbPu4y0qsjdlSnxHT2rNpXt+6cagwvAn/3D4p27LMLpAwMYlHhP0v y0nQClFZbvQJ97UffhYmZ/xdL28sKMlYoSCj13WtAn+Ndtdg8g3fOJ1x8pKHMeZ5/cOS uOkuOirOZWnYfwy/IRvRO83Irj3rexGrfaqF6g32OIKMYTDGxivHKqEa7NytcTLAsjQy 7GzA== ARC-Authentication-Results: i=1; mx.google.com; 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 l6si6308167edr.243.2020.05.18.08.41.01; Mon, 18 May 2020 08:41:26 -0700 (PDT) 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; 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 S1728301AbgERPhe (ORCPT + 99 others); Mon, 18 May 2020 11:37:34 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:57636 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726958AbgERPhe (ORCPT ); Mon, 18 May 2020 11:37:34 -0400 Received: from fsav404.sakura.ne.jp (fsav404.sakura.ne.jp [133.242.250.103]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 04IFaqlj007747; Tue, 19 May 2020 00:36:52 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav404.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav404.sakura.ne.jp); Tue, 19 May 2020 00:36:52 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav404.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 04IFacsP007670 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 19 May 2020 00:36:51 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH v3] proc: proc_pid_ns takes super_block as an argument To: Alexey Gladkov , "Eric W. Biederman" Cc: LKML , syzbot , jmorris@namei.org, linux-next@vger.kernel.org, linux-security-module@vger.kernel.org, serge@hallyn.com, sfr@canb.auug.org.au, syzkaller-bugs@googlegroups.com, linux-fsdevel References: <87lfltcbc4.fsf@x220.int.ebiederm.org> <20200518150818.2929164-1-gladkov.alexey@gmail.com> From: Tetsuo Handa Message-ID: Date: Tue, 19 May 2020 00:36:34 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200518150818.2929164-1-gladkov.alexey@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I would shorten like below: syzbot found that touch /proc/testfile causes NULL pointer dereference at tomoyo_get_local_path() because inode of the dentry is NULL. Before c59f415a7cb6, Tomoyo received pid_ns from proc's s_fs_info directly. Since proc_pid_ns() can only work with inode, using it in the tomoyo_get_local_path() was wrong. To avoid creating more functions for getting proc_ns, change the argument type of the proc_pid_ns() function. Then, Tomoyo can use the existing super_block to get pid_ns.