Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4993493rdb; Fri, 15 Sep 2023 21:11:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVC7/4mCrVjgxEmkEwm+dJMyDsryPOe2UftOu1gllXF6JlPAQbauwtSFTHavTHJeoRtbd8 X-Received: by 2002:a05:6a21:338e:b0:14e:2208:d62f with SMTP id yy14-20020a056a21338e00b0014e2208d62fmr5406186pzb.22.1694837476244; Fri, 15 Sep 2023 21:11:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694837476; cv=none; d=google.com; s=arc-20160816; b=NwpT1187wafPjacdqmxt6V+l1Pj2Qa9751JGpT+B1BBW+AMdKtsdtgsMgnGYWZlRsu k4T0dwBLIP5Eo80Kcc/tBka6J2NtVE1WpkFaz5gM0CTZM3j3VrhF7pyv37GHzGV11mU5 iX5wpyEFvQ86kzy5OUeqJP+NRdq1ZY7A8Cdi9fr8c+Xm9phTD5jL3U20wBRwhEJYlydi ldExcLSeH4R8rywcddvK+kh32qeoSkUDT3ikQc/NqyXA7t5fmPSenDtH8e2lo7hW72Hb Pmgmk0jr2g2gmcQLE6cKNMQGTy0ODEn0PvKMh8rVqL3WC9+cZRk4O+LMnw5hhfHVO9z6 S5wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=HvSLgTTIgHIGD+l7tl19R4elC30zzIy17VfAeigIAQE=; fh=eLBvtPgIPGXrKWkSllAgQrmoJJNmy3KaT4bQ94uM2hU=; b=jr2Y9G5VNw1fSLSakYFhsHxTFIJyxNf4PNu3Yy5bt+MSHdsJS30kj6bBSfJe6bhHWs BfEXlMuZ2n0QMh72WP3lSPPvb7XUbJuZMyx87oNNs7Xutp4KE/9SGvdIJXZRn6Z79+5K 39yC9WMIrIDT68mLDJNb+GMuVZV4MMPmH2UAe4f+n3BTTFG33HZUeufhYiNNLPztXXZn BcpOizBD6pe2rz3lL+zyMfCjn5W82N4hjwhGEAGDTNkEYu7BMhUAAxrrv2ooyrLXehaT rtf2NT2vJ30UM0RR9f0Lo966oOjwoihSRw3X5y6QNA0IL0wGa9DLOf4uwgPO8Lo1UpJQ +iqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=O+vCxHPn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id 82-20020a630155000000b00574134c9acdsi4322373pgb.647.2023.09.15.21.11.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 21:11:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=O+vCxHPn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0FD0B8184E2E; Fri, 15 Sep 2023 16:43:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237489AbjIOXnJ (ORCPT + 99 others); Fri, 15 Sep 2023 19:43:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237958AbjIOXmf (ORCPT ); Fri, 15 Sep 2023 19:42:35 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B6B12105 for ; Fri, 15 Sep 2023 16:42:31 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-26f4bc74131so1953594a91.1 for ; Fri, 15 Sep 2023 16:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694821350; x=1695426150; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=HvSLgTTIgHIGD+l7tl19R4elC30zzIy17VfAeigIAQE=; b=O+vCxHPnFbw4lwwd/iT7keN8p8lJMYK8QK9z6u8vYIxH+D8qyOdZlI8Nc6xXhA1Nw+ mmDlK5jDy++a3/XIkvEQqH1NpBX7xwbPiaJV3YdNfPXWUaZ4UyycyL/Fv2wrJ8vhhA4c rAj2FYfWYUzwE083ZpkTDIlCdc/taLfgFOfvKqgiAoZqh5aAikz9d1MSZmbfTZIpGIT8 KrqjI1q4H2plIIdCDmaOl990f+jaHDIIjCtcgRl9pErkGc4NKA10dKlX74dcR5MQ4ktD 4oFb+yhQscMx+/BXnKPplF9SR6TDjlcbvC8fkomrWM3J89A6jnjnvMSKF3/9/lTPiU9u caOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694821350; x=1695426150; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HvSLgTTIgHIGD+l7tl19R4elC30zzIy17VfAeigIAQE=; b=FfPn1CqC2ipqQvT/PTQfQv8T/NQqoQMllViUmg/PvBe54yeyy7Bwc2ILEFf80f+dHB q8AdDPzhBulo6SvTONzD7TIx8ZiiwnlAJM37I2nib5KL9qndyZy2rng522BQrJu5zVNs QjogFS6w7FqzqjccHcccK1IFBSPgxTDUgEVRxLNz1jkNxLcI4hOpSsQcLssqqtmNw/ZC CmQDlJyx6L/rcNUVQCzOhoz3UYTezPH0nuRp00Wb/oxiy09fKP76tnuS0m7fWjGc0Eo/ 0q6H3ibXkj0+SrMANgwb0YKhDKd+goqZtMkz8lKWcz1RB1H9yvTUzqtC1jWAhh0bPQiU ARzA== X-Gm-Message-State: AOJu0YwMNVGysy98n4ljSPYUSZrbtCDoFoQsaArau2IrcXlUY48oxt0x INtsm9l0b2yduacrccNoaeUhxNALYFCYa4EQ+xU= X-Received: by 2002:a17:90b:34a:b0:274:8951:b5ed with SMTP id fh10-20020a17090b034a00b002748951b5edmr3968062pjb.20.1694821350468; Fri, 15 Sep 2023 16:42:30 -0700 (PDT) MIME-Version: 1.0 References: <2a161c99c47a45f8e9f7a21a732c60f0cd674a66.1694625260.git.andreyknvl@google.com> In-Reply-To: From: Andrey Konovalov Date: Sat, 16 Sep 2023 01:42:19 +0200 Message-ID: Subject: Re: [PATCH v2 14/19] lib/stackdepot, kasan: add flags to __stack_depot_save and rename To: Marco Elver Cc: andrey.konovalov@linux.dev, Alexander Potapenko , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Oscar Salvador , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 15 Sep 2023 16:43:45 -0700 (PDT) On Fri, Sep 15, 2023 at 10:32=E2=80=AFPM Marco Elver wro= te: > > +depot_stack_handle_t stack_depot_save_flags(unsigned long *entries, > > + unsigned int nr_entries, > > + gfp_t alloc_flags, > > + depot_flags_t depot_flags) > > { > > struct list_head *bucket; > > struct stack_record *found =3D NULL; > > depot_stack_handle_t handle =3D 0; > > struct page *page =3D NULL; > > void *prealloc =3D NULL; > > + bool can_alloc =3D depot_flags & STACK_DEPOT_FLAG_CAN_ALLOC; > > bool need_alloc =3D false; > > unsigned long flags; > > u32 hash; > > > > + if (depot_flags & ~STACK_DEPOT_FLAGS_MASK) > > + return 0; > > + > > Shouldn't this be a WARN due to invalid flags? Good idea! Will fix. Thanks!