Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6567C433EF for ; Tue, 11 Jan 2022 19:43:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238527AbiAKTm7 (ORCPT ); Tue, 11 Jan 2022 14:42:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238194AbiAKTmu (ORCPT ); Tue, 11 Jan 2022 14:42:50 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55390C061757 for ; Tue, 11 Jan 2022 11:42:50 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id d3so235515lfv.13 for ; Tue, 11 Jan 2022 11:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=72nCaH0D5cVWOpCSRc18GR2eFwD5HF2lWhLZ438H8+E=; b=IbI2Ue6xwevdXzForB3sPC7JLpGCLW4aJaiaqGPQM519ZpN4Iw53D7dK6TEvItwJQM lU0w7yPNWbufVbo7aTy0WNF/06ot4HROv5RcW7EH+B/47POEIinAhzsJIzijm2pqH0rA 32W/JrQJcTgkaHK2M1qJ6iERelYscbkX2JYhs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=72nCaH0D5cVWOpCSRc18GR2eFwD5HF2lWhLZ438H8+E=; b=k89HacVmx8Zs7Irg617LtsMGaK14Zgj9PxBU/4T1gwlm3aKDV7vkefcbPf76FUI41A Y3vq011ZBTJVbHgjZetsVxte+gPA5rL0NiYQ/sazm4mfG2I8rEZjIP2JPNXQng2zEaBd uLZ4JVOJ6XBxNg8eQM101WI/bxYSIJ30NQnVI8deE7bSHY8D3z+PFkiiyCagXL1Jyd/5 iHVFuo1YHecoJsPBVez4KjrkwilngQfh5Xkir/1Kts9/qdudW7/DZ4OjWrUcSfwVEz0z LeAqgKMm1LDQkfIHODyS19VLfoo2lVrQpfXvW646OD11ilQowAC0Pia18MhOOw85nnuc 3vlg== X-Gm-Message-State: AOAM53112VdLo+QjtiqZbZIlBqPy9GtJg97JWq9Y2LS9HDXJyKxOzPeV QZed/xxNpKGXGZemEwtHgfLGJ3jnBJNpDpnf4F4= X-Google-Smtp-Source: ABdhPJyt7ZWDy2BU1KOUXuvdKS18d9of2DSrHVNbd4lRasByDo9c5FT0NR3oNVPsKXza3k4RVVVtIg== X-Received: by 2002:a19:f803:: with SMTP id a3mr4257242lff.95.1641930168539; Tue, 11 Jan 2022 11:42:48 -0800 (PST) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com. [209.85.167.41]) by smtp.gmail.com with ESMTPSA id r4sm142927lfn.103.2022.01.11.11.42.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Jan 2022 11:42:48 -0800 (PST) Received: by mail-lf1-f41.google.com with SMTP id br17so360773lfb.6 for ; Tue, 11 Jan 2022 11:42:48 -0800 (PST) X-Received: by 2002:adf:c74e:: with SMTP id b14mr5117431wrh.97.1641929709117; Tue, 11 Jan 2022 11:35:09 -0800 (PST) MIME-Version: 1.0 References: <20220111071212.1210124-1-surenb@google.com> In-Reply-To: From: Linus Torvalds Date: Tue, 11 Jan 2022 11:34:53 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/1] psi: Fix uaf issue when psi trigger is destroyed while being polled To: Suren Baghdasaryan Cc: Eric Biggers , Johannes Weiner , Tejun Heo , Zefan Li , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Jonathan Corbet , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Cgroups , stable , Android Kernel Team , syzbot Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 11, 2022 at 11:27 AM Suren Baghdasaryan wrote: > > Thanks for the explanation! > So, it sounds like the best (semantically correct) option I have here > is smp_store_release() to set the pointer, and then smp_load_acquire() > to read it. Is my understanding correct? Yeah, that's the clearest one from a memory ordering standpoint, and is generally also cheap. Linus