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=-3.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 8391EC2D0E4 for ; Tue, 17 Nov 2020 13:28:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EAC0524199 for ; Tue, 17 Nov 2020 13:28:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="avsUk8Pw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="ZJJ5+s5q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAC0524199 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=93p3SY8V8zKBlnNwF0bnQ7hjQPK8I62FzmfhikUn+fM=; b=avsUk8PwdTVAgA5DCbLpUi61r Ivk3UqbBVeLl7RIyZzR19jm8bp2QHdyYUhfz5btAzY1VUBDRp7ImucCdqMNezh5faOwThPw5LNXEw +k8y450wcxLlmLuVkmPpwolSNnhSw53VlG/hyMB9dUvhDdco0FTXrjzNXZ2QYigqjkCxCEGM7I/O9 /mXq0f/P2p59F+JSkLm4yKBNacBFJ/0NcaGnYd9XkobOT+fc02fCYiUhqRjulZ5y+RJMFSIFeqxrf WYkGueo693IzIe3slF9+1ETqYHgL7VVMEQzWsnWdq2/NOWxdkah9JCmNM1vMCrH/CN6F7NQxA/xK/ OSbYR5IMQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kf11E-0002oi-9O; Tue, 17 Nov 2020 13:27:36 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kf11B-0002ns-JK for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2020 13:27:34 +0000 Received: by mail-qt1-x841.google.com with SMTP id 7so15536377qtp.1 for ; Tue, 17 Nov 2020 05:27:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Rm4APUToOIfygYhEOvJkSoAG2E8GzKBKMf6ZHBmKcsc=; b=ZJJ5+s5qN0ujEsOF3+4bu+lufZWanMYs1P6zadjBcMXyRvrgvOu0pVs/uoOy0Vw204 6d1TfDyNgBPb5yiyiV0rLVV759WnvcfzPwDyGlpkf7/G4r+jpDkA40HhWEeGro0Xoh0F MxIbsu1YuzQieZDXe0GQQKxiQxyYFwuxjY0L6IhfR8xDqBXbU2ycmsd6i9df34DMKync KBZEd0T3xDXcz/W6P6oYwF00R4FOWD9VGvTxYn/KyCCnmTKJ90xPDMmrL0XEGh0Qt72A QSwsdtkJMnaK3Nz8EMnz6fGRk+oHOdzU5jkyqrg1VyywOTMl5SFzviEWasHWjwAGWw06 FR3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rm4APUToOIfygYhEOvJkSoAG2E8GzKBKMf6ZHBmKcsc=; b=ZNYbdVbuod/F7qg0qtpRrvtOXfTKHg4gJtIv0XngHXOq9VI4GRPsYAV9btU28bT9QO oi56Fdzm33uq1WVcsTsMNWJoKJ55jANchDE7Io9qiBAvod9VJ1muU9ULLHV9+MesfixO BkAxfqLVaphz9CuPXQYVZU4KpIDhbiEFIBhGpQjl/yrjdLEcD0pI7jUAJ7t7kGuE9kw9 94H603bfwsLb3u4e583NSkpVIJ9m5snCD/ZXFtLGjJoFYuj9C9VPj0eLA+/LUr6M+lO7 lihLcHWirIGUYQwHhspls+gLyk4igRE0sk2gmeFUBnF8cixJbcX4yHtllHndGiZfkfi0 pE/g== X-Gm-Message-State: AOAM532uiRCbVjEhhtVpN+CrjT2gi8TkcCvS3hcT1cgVtUF/bQW0BaQX gNFoxr1K7Czr8495D4tshENPZvCOlYG1ikayr61FTg== X-Google-Smtp-Source: ABdhPJzQ+4pShJ4NbuQHV4/uK/kOWEjlTGe13lNKPNMSSmikIEerUWrXEKvVSvlXJJxtw8fUxaDzmCSSbx56frbUhAY= X-Received: by 2002:aed:2b47:: with SMTP id p65mr18425153qtd.337.1605619651889; Tue, 17 Nov 2020 05:27:31 -0800 (PST) MIME-Version: 1.0 References: <52518837b34d607abbf30855b3ac4cb1a9486946.1605305978.git.andreyknvl@google.com> In-Reply-To: From: Dmitry Vyukov Date: Tue, 17 Nov 2020 14:27:20 +0100 Message-ID: Subject: Re: [PATCH mm v3 17/19] kasan: clean up metadata allocation and usage To: Marco Elver X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201117_082733_674423_773B09CF X-CRM114-Status: GOOD ( 14.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Branislav Rankov , Andrey Konovalov , Kevin Brodsky , Will Deacon , LKML , kasan-dev , Linux-MM , Alexander Potapenko , Linux ARM , Catalin Marinas , Andrey Ryabinin , Andrew Morton , Vincenzo Frascino , Evgenii Stepanov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 17, 2020 at 2:18 PM Marco Elver wrote: > > On Tue, 17 Nov 2020 at 14:12, Dmitry Vyukov wrote: > > > > + */ > > > *(u8 *)kasan_mem_to_shadow(object) = KASAN_KMALLOC_FREE; > > > + > > > ___cache_free(cache, object, _THIS_IP_); > > > > > > if (IS_ENABLED(CONFIG_SLAB)) > > > @@ -168,6 +173,9 @@ void quarantine_put(struct kmem_cache *cache, void *object) > > > struct qlist_head temp = QLIST_INIT; > > > struct kasan_free_meta *meta = kasan_get_free_meta(cache, object); > > > > > > + if (!meta) > > > + return; > > > > Humm... is this possible? If yes, we would be leaking the object here... > > Perhaps BUG_ON with a comment instead. > > If this is possible in prod-mode KASAN, a WARN_ON() that returns would be safer. We only compile quarantine.c for CONFIG_KASAN_GENERIC. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel