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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3F1DC433EF for ; Sun, 8 Sep 2019 22:20:59 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 4EEDB21479 for ; Sun, 8 Sep 2019 22:20:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4EEDB21479 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-16877-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 32258 invoked by uid 550); 8 Sep 2019 22:20:53 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 32226 invoked from network); 8 Sep 2019 22:20:52 -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: Al Viro 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();