Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5412639ybe; Tue, 10 Sep 2019 03:20:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwt/PbDBhMnkfxHAqYXwyLCH7KuF6ds2fKNigKOj9UVLoYADffrfPqv1RPuBATjscHy8oPK X-Received: by 2002:aa7:dc55:: with SMTP id g21mr29218091edu.295.1568110835586; Tue, 10 Sep 2019 03:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568110835; cv=none; d=google.com; s=arc-20160816; b=KxzOxjo7Dbc4ofjKLGZq4RDvJFvIU4kjHRNQ+POGetK717Xz97DFtQExFa8egBOuAQ Q9Z8Ho7o4QW1FrDXf3WXh90e3Grz4pOzs0nVeye39bo7JeA4YbwQC9c3c4TeTq6cjssT Le4uGwWWQGI5+/x9A8wRo8B6cffG95Jo2+D/yjglA2Fe86MgcK1FU7CqKX2ZrJT8/eSM vtX2i6g2tRhKi9Ny0JdHYcKHX626daLxiO0RCrLfCdDy3x6p3HHTeJwVhTFl/GqbIb3o Z1hs+6XXgHm6lP49wUrYXmXVO2g20I7MEAXKx0CAUwTQPPOlHsAzkiO6PzL2dmEzztgf MNtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:subject:cc:to:from :date:content-transfer-encoding:mime-version:dkim-signature :dkim-signature; bh=bVArJnfOVFRbbyv4jwUfAvGEuamVQW0TC9V/nzCBTgk=; b=gc5gR4L3lg/C7aX04PPhKu1iLBScoweW4TONWlINmyNNRinVuyAFv+QDTKXnsjI89J MbkMwqNGrrE9LWRVRgqjHo6O8UYJHEZIpkgFDltmQUJW0qiBgtMhDJvwjT9wP654OqW3 B1fCyPiDvZcRriP87ZBX3Q/7cxMEPPbtN3OAucaYKbQUeKbKvwc+Z/L4nCC91/XvBn8U HA3urhM0CATpO6bAqigcmBs/RYw6FvhTqYoqlmLkyWCq9T7lENGcekMhp/+TnJ3C+h4Y 4IVbXXmv9OFxNLKFTDWilYBnNPiKJP/uhrM6NEA7YEiiIYB2L4IPw7N08rDeBVGOvgW2 6HXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="HL/9htVW"; dkim=pass header.i=@codeaurora.org header.s=default header.b=H1nCZQ0g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z33si9848353edz.314.2019.09.10.03.20.11; Tue, 10 Sep 2019 03:20:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="HL/9htVW"; dkim=pass header.i=@codeaurora.org header.s=default header.b=H1nCZQ0g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730702AbfIIWrT (ORCPT + 99 others); Mon, 9 Sep 2019 18:47:19 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:37846 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728918AbfIIWrT (ORCPT ); Mon, 9 Sep 2019 18:47:19 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3DF4360303; Mon, 9 Sep 2019 22:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1568069238; bh=Y/IuLwHZa6E6V0WRz+uYsMdEVK899wiCU7hIZzCVVmg=; h=Date:From:To:Cc:Subject:From; b=HL/9htVWFkKjSV91mUDuHX0XKv0jblsNAbiBfDbZbi5I4j5WX/+wjkI1Hp4jqDrkk YLatxn4yQigfEnxuzLUDmG5kZKWfEUzdPNLAJ/z1pAAk10uYYPEDAQJkW25PhLHnQt zxc3Im4lfuJd43AyQHmxwThf44JgjMex+pQtKYWQ= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 634BE601D4; Mon, 9 Sep 2019 22:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1568069237; bh=Y/IuLwHZa6E6V0WRz+uYsMdEVK899wiCU7hIZzCVVmg=; h=Date:From:To:Cc:Subject:From; b=H1nCZQ0gsMeDkNuHDtvNloVBw1wimd/3P+3OX73u0ZQTRUDX+wjBOAoFSn4THkjiI XVAej3kngr+iWV26AdBoGx5SLL1klWaj78X/7d3nPeGn23VZGl8xVXbwF6Y7FWsbfO JJvPiLhrnoyqONed+VIQnrpmG1IxXiCxoRyqOQwc= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 09 Sep 2019 15:47:17 -0700 From: rishabhb@codeaurora.org To: miklos@szeredi.hu, linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: tsoni@codeaurora.org, psodagud@codeaurora.org, jshriram@codeaurora.org Subject: Bug at kernel/cred.c +432 Message-ID: <083b3f61efeca1d73839ac96e396748e@codeaurora.org> X-Sender: rishabhb@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Miklos In 4.19 kernel when we write to a file that doesn't exist we see the following stack: [ 377.382745] ovl_create_or_link+0xac/0x710 [ 377.382745] ovl_create_object+0xb8/0x110 [ 377.382745] ovl_create+0x34/0x40 [ 377.382745] path_openat+0xd44/0x15a8 [ 377.382745] do_filp_open+0x80/0x128 [ 377.382745] do_sys_open+0x140/0x250 [ 377.382745] __arm64_sys_openat+0x2c/0x38 If the override_cred flag = off, the ovl_override_cred and ovl_revert_cred just returns NULL. But there is another override_cred in between these two functions; put_cred(override_creds(override_cred)); put_cred(override_cred); This will override the credentials permanently as there is no corresponding revert_cred associated. So whenever we do commit_creds for this task, we see a BUG_ON at kernel/cred.c +443. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/cred.c#n443 Should this override_cred be changed to ovl_override_cred to maintain consistency and avoid this BUG_ON? Thanks, Rishabh