From patchwork Mon Jun 13 20:14:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 12880098 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1B99C433EF for ; Mon, 13 Jun 2022 20:18:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B94518D01D7; Mon, 13 Jun 2022 16:18:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B1D1D8D01CC; Mon, 13 Jun 2022 16:18:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E32E8D01D7; Mon, 13 Jun 2022 16:18:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8E6828D01CC for ; Mon, 13 Jun 2022 16:18:43 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 62E9720CC9 for ; Mon, 13 Jun 2022 20:18:43 +0000 (UTC) X-FDA: 79574325726.15.9881D22 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf08.hostedemail.com (Postfix) with ESMTP id DCCD2160094 for ; Mon, 13 Jun 2022 20:18:42 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1655151521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Iixdi0aUzLucxsbCg6IG+LbS3JzcqWGK/WM+ZRzVqS4=; b=ojnNMVl0weA+1rfdDibEWQiEzf3u9AY6W77/wSQjT9KKfbHNrxLmCsJ0sZKkW8eSCG0dBh +5YrObbqYTyKuVuT1F9XZeFHAhh5e4ObssVEFR3QS+xZkhK0CdzjtTkbI85bkE2UWrMY6E WI2qCIZzoT7d6a6rI1j4nr/qLjTsYE4= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Peter Collingbourne , Evgenii Stepanov , Florian Mayer , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH 23/32] kasan: use kasan_addr_to_slab in print_address_description Date: Mon, 13 Jun 2022 22:14:14 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655151523; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Iixdi0aUzLucxsbCg6IG+LbS3JzcqWGK/WM+ZRzVqS4=; b=X9zqUpxmgSuKYgk+iJZMwznHnM4H/fUmtLpmYcrIYQ7s9dRhRC6dThFGS2oGXkeOstTBYt 7tFFP14Xipo+YZPdklbpX26DS5ZRNkwsL7Z1fgBJFcPC6PJpG7gQhwyd+QVMo6fB9la6E6 EYkurHlEksbN5dAHnXIEFPaZBN0iCIs= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ojnNMVl0; spf=pass (imf08.hostedemail.com: domain of andrey.konovalov@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655151523; a=rsa-sha256; cv=none; b=bmVC8Y3hFzTpTamEhYbkn3ImwdQN0NJUgvLfpS+RShLzetc8Z818JaBvYCw0CgmBkvdD3L 7Ot1mvsz12eg7BXINixVEdZdjnt9F2svnhEHSqb+d5fOnjcSIZYQBxZhnfdFiJmTyvx62e Ehx0zs8Yl4rro2lKQo0/EmdvZibCe3k= X-Stat-Signature: mwt4j1zdz6q86dijhes7sxfer7cbcbxx X-Rspamd-Queue-Id: DCCD2160094 X-Rspamd-Server: rspam11 X-Rspam-User: Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ojnNMVl0; spf=pass (imf08.hostedemail.com: domain of andrey.konovalov@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-HE-Tag: 1655151522-376330 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Andrey Konovalov Use the kasan_addr_to_slab() helper in print_address_description() instead of separately invoking PageSlab() and page_slab(). Signed-off-by: Andrey Konovalov --- mm/kasan/report.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 879f949dc395..1dd6fc8a678f 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -291,12 +291,12 @@ static inline bool init_task_stack_addr(const void *addr) static void print_address_description(void *addr, u8 tag) { struct page *page = kasan_addr_to_page(addr); + struct slab *slab = kasan_addr_to_slab(addr); dump_stack_lvl(KERN_ERR); pr_err("\n"); - if (page && PageSlab(page)) { - struct slab *slab = page_slab(page); + if (slab) { struct kmem_cache *cache = slab->slab_cache; void *object = nearest_obj(cache, slab, addr);