Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp646533ybz; Wed, 29 Apr 2020 06:59:21 -0700 (PDT) X-Google-Smtp-Source: APiQypLR54bi8Idu7QF7nbm9h2thCymnEV+58Zmb2yPb7yp4pQG2Mlt6T3XxvUZj0tUSZzsF8Mgt X-Received: by 2002:a17:906:68d7:: with SMTP id y23mr2788317ejr.85.1588168760959; Wed, 29 Apr 2020 06:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588168760; cv=none; d=google.com; s=arc-20160816; b=vnlx/CiAOoZmhyKqbmI38fq+4sUiuvGcepc9ka7iF++5BqfKTYZaw0/GvBmlNHzc1k Rgl7Q/PLaToPURMHcaEliokew9jRu8AWXNDWAyUra35Ec5+5RiQTABuNnjS6pcxQe1Qg y1TcaGWTUQXF3HmslFMhW1tkfc0+dm+hC86Z0bNpqSnxzv28ww2HMTZ18sPyUtIyRCgc iTDE/Ae48+cAOWvPMIsvkbfYHcT/I1DOL90F+kid3iL6fTSS9RIuqVNw3Ti4CV+xVS/8 b/Uun447xTy61/s4fBVLIHZtj86iZJuEdRtauj53rMz48BlW/YJ2G4WzEX5Lb8LOQdzC kRNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=zxaVkGmIzNCD7S/waco7p06sl1vo0f84OW1yaoPDlxM=; b=xK5gUPZEAAw06cta0vl2nYGfmIfCM6XN7RNplg8DFmLvUZ70KwWyYk0ON6FG6FFRh1 8HZJuupz1amsZ7DUyB2UpR51n4wEdlbbEM2eCYFcKYy4w/KQYNap+d3CTVCcO4bXWK/z sJ8C8uk3j4s0nyi7KZ1zC5tbbMhlbrQ+iTyIh8QD/SGKs+ZEn9CjHoejd5OebmMtc/QR k4ZXL8moVqorkrxWC+8gZEtRO9KSO1P17ET/8R8RS5eI6kQYlxYW9XDPFRrFb1aredXR KohmiWHgZub2ch769UQ7ian6R+1kzPrL1nCDc0N4omXTN9xy2ahAjyKFsNOAhvC4IoCe nslA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FaJ5rhDV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si4105357ejb.359.2020.04.29.06.58.57; Wed, 29 Apr 2020 06:59:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FaJ5rhDV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727087AbgD2Nz1 (ORCPT + 99 others); Wed, 29 Apr 2020 09:55:27 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:59629 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726853AbgD2Nz1 (ORCPT ); Wed, 29 Apr 2020 09:55:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zxaVkGmIzNCD7S/waco7p06sl1vo0f84OW1yaoPDlxM=; b=FaJ5rhDVqRGdO1pmvpV6Z21OwCvBSRdh1tYs78PJm1RpI8QTaa0eRexCsy7xz5KR2wnsHT zDVfDA2kJI5WJ4q9W+Por7SRestQp2gjgRCpWESnFmPfk6J3kkoPNJeET6apAmLE5F72kE FYhoTC+p5zo+tGSXBdHbsVixGVnkrpg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-176-xIyadMCCPwynY6fRioCn8A-1; Wed, 29 Apr 2020 09:55:24 -0400 X-MC-Unique: xIyadMCCPwynY6fRioCn8A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC5AA1899520; Wed, 29 Apr 2020 13:55:22 +0000 (UTC) Received: from llong.remote.csb (ovpn-115-218.rdu2.redhat.com [10.10.115.218]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2EF2605CB; Wed, 29 Apr 2020 13:55:21 +0000 (UTC) Subject: Re: [PATCH v3] mm/slub: Fix incorrect interpretation of s->offset To: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Kees Cook Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Changbin Du , Matthew Wilcox , Markus Elfring References: <20200429135328.26976-1-longman@redhat.com> From: Waiman Long Organization: Red Hat Message-ID: <7530523e-749c-dac7-f6ab-f52dcb20ecb9@redhat.com> Date: Wed, 29 Apr 2020 09:55:21 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200429135328.26976-1-longman@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/29/20 9:53 AM, Waiman Long wrote: > In a couple of places in the slub memory allocator, the code uses > "s->offset" as a check to see if the free pointer is put right after the > object. That check is no longer true with commit 3202fa62fb43 ("slub: > relocate freelist pointer to middle of object"). > > As a result, echoing "1" into the validate sysfs file, e.g. of dentry, > may cause a bunch of "Freepointer corrupt" error reports like the > following to appear with the system in panic afterwards. > > [ 38.579769] ============================================================================= > [ 38.580845] BUG dentry(666:pmcd.service) (Tainted: G B): Freepointer corrupt > [ 38.581948] ----------------------------------------------------------------------------- > > To fix it, use the check "s->offset == s->inuse" in the new helper Sorry, forgot to change the commit log to ">=". Anyway, this is a serious bug that needs to be fixed before v5.7 is released. Cheers, Longman