Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4255903ybe; Mon, 9 Sep 2019 06:43:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxedGK13d+6zzRilUO5FUC3NlsuanaOBnDJFnHZq9a8cJ06yIrzAw3QUOUA9KGwj9ELyAwV X-Received: by 2002:a50:d084:: with SMTP id v4mr24987915edd.48.1568036594500; Mon, 09 Sep 2019 06:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568036594; cv=none; d=google.com; s=arc-20160816; b=Kg/fLmn+kY6A8fr6aRc0Kv8AxeA6XeqdW0VeYkEsBbvrKcHPIV+z9x8zZNocU+WvIM es4Vd+45aw8r1eSw62x8CsPxq6lE4Ux98Q8oStvHisamOAI5h6NlxcaWANd7Jh3zoadT 28+0L7M4FQ9NA0NxGFJM56PC0hV8zY2M2lKvlvEW36aRFkFPgw0glT9kveKMmETlwlhr mC0xEcRUQdUwhHVdhg75KH7olWX0pSlnYrBDH8qYkVZgIDc7i1OQK+0jfgM9ZLK2Jm4C /kcDtOWf3Vvea1/cZOS7/eQ+KcmAYF765Aa1a9xIg4yB4R6PgNyeKsZ4fDhm0VZ0dcT7 KQ8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=TLv8OBkohTZ7G2wNy8DIK3dxpxRRLLAbS1fH620iBbY=; b=Hf4yakMrktWr89R+Eif2jyWP4yKAAHtpT3eNULeWllA7RK9sty6ONts+pGCD0W08Mk fytRGU9QwyqCtfJhhhyoeuv/azdBT+I8jevMYXqDdxpAr/Qo4sgCxGsveK9TPBrEHTiR Nl1EXp5cSO4Srnp7iD5E11Q4V5c2caJZM+mPgQ6RX1i8oZpQJNTm95hrjM9jVWcCe05R cmDlCtxkw5UGjQUUKXJOuk5l1QG6IlI/X9bHP7fm5Y2fIn6FPgPCkvZgdvmR0WEFthBN uj5pQEXB7DHScRImqa6R/oUSghQcaiORxzM9ZzjFXd5RWzyyjKeeuXTlSualmzxjNBzP /jLQ== ARC-Authentication-Results: i=1; mx.google.com; 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 g7si7279489ejd.194.2019.09.09.06.42.50; Mon, 09 Sep 2019 06:43:14 -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; 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 S1731087AbfIHWUI (ORCPT + 99 others); Sun, 8 Sep 2019 18:20:08 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:46456 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726626AbfIHWUI (ORCPT ); Sun, 8 Sep 2019 18:20:08 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1i75XG-00036h-AF; Sun, 08 Sep 2019 22:19:54 +0000 Date: Sun, 8 Sep 2019 23:19:54 +0100 From: Al Viro To: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= Cc: Alexei Starovoitov , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , linux-kernel@vger.kernel.org, Alexei Starovoitov , Andrew Morton , Andy Lutomirski , Arnaldo Carvalho de Melo , Casey Schaufler , Daniel Borkmann , David Drysdale , "David S . Miller" , "Eric W . Biederman" , James Morris , Jann Horn , John Johansen , Jonathan Corbet , Kees Cook , Michael Kerrisk , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Shuah Khan , Stephen Smalley , Tejun Heo , Tetsuo Handa , Thomas Graf , Tycho Andersen , Will Drewry , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH bpf-next v10 06/10] bpf,landlock: Add a new map type: inode Message-ID: <20190908221954.GD1131@ZenIV.linux.org.uk> References: <20190721213116.23476-1-mic@digikod.net> <20190721213116.23476-7-mic@digikod.net> <20190727014048.3czy3n2hi6hfdy3m@ast-mbp.dhcp.thefacebook.com> <894922a2-1150-366c-3f08-c8b759da0742@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <894922a2-1150-366c-3f08-c8b759da0742@digikod.net> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 09, 2019 at 12:09:57AM +0200, Micka?l Sala?n wrote: > >>> + rcu_read_lock(); > >>> + ptr = htab_map_lookup_elem(map, &inode); > >>> + iput(inode); Wait a sec. You are doing _what_ under rcu_read_lock()? > >>> + if (IS_ERR(ptr)) { > >>> + ret = PTR_ERR(ptr); > >>> + } else if (!ptr) { > >>> + ret = -ENOENT; > >>> + } else { > >>> + ret = 0; > >>> + copy_map_value(map, value, ptr); > >>> + } > >>> + rcu_read_unlock();