Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp267826pxa; Thu, 27 Aug 2020 01:30:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIMCMFq+BMPyCYKCq/iQRFTvWt2ivwjvunjcFRniywEsLfN8fcZMHrZjKTMKzAp8/CPfNb X-Received: by 2002:a17:906:1351:: with SMTP id x17mr18822510ejb.528.1598517049124; Thu, 27 Aug 2020 01:30:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598517049; cv=none; d=google.com; s=arc-20160816; b=GDBozay+fEKP67ZLBunxk9y9ILQezCZOwJP43dtUwUCvtseYCrHlBcJO+F+tlsSS8q AXkbAMSyqqw7tk22SFSxD04/InetGkw7DcAUMetTCGDYZrub34Wxh4Y9aUEpkn1MVfYR CVp8gNZn/SaIszmFYzF4dzdW6z2TiElAqpHRE73YYk3gY7xK9TTPTEB92LaRC898oKzU vMfLFcaF6HrLEFyNGQyQ/Z7pLI3rfwX10StJxsZSdtS/LGHYViP3zl4rbMWKD6McIL8G v7CKHqIllNCRplOm39UDwU7HLrLl9+evRhOvlMhvENay9P8uu1bK7+pwpdwxkgVx9c4l d9dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=M7lRwh4uXffpotrKUASEsAnoQUGTTMe+gvA09ZIghGw=; b=q7rIqOzYOFXcL2SkvItg7zNdnENS7MYTE6C6PaGaw7N8K0VTM7tdR+9SLznrxw2vQF ypSmTPc5oZeDarS3JBRVLPURRXoSi4kdomo5vwLVvfil2R4z6bSU0wwpPjvPjKhE8x1m Do48xXD6AvROdx9WkUFLUV+5bqnlNG60XvRLcM5S4IjaD/pUUeS6/HFX4w+7g5sg6XIr MvLQ+3H/xlXBsIRnPp2aM1wwgckGNBtLC7MsRH3or1S/Fn0wbie1/nANewQRDRJUXHzT zNmbUJJ16qjHkPZaK4aW6N24hKR6+sTZ4ICy6OcMoAXIabMUbdOCIH20GEmp8vTN6UsQ ovvQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e5si892393ejc.182.2020.08.27.01.30.26; Thu, 27 Aug 2020 01:30:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728129AbgH0I1r (ORCPT + 99 others); Thu, 27 Aug 2020 04:27:47 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:49986 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726826AbgH0I1q (ORCPT ); Thu, 27 Aug 2020 04:27:46 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id A50017913B2FB90F1E44; Thu, 27 Aug 2020 16:27:44 +0800 (CST) Received: from [127.0.0.1] (10.67.76.251) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Thu, 27 Aug 2020 16:27:35 +0800 Subject: Re: [PATCH RESEND] fs: Move @f_count to different cacheline with @f_mode To: Aleksa Sarai CC: Will Deacon , , , Mark Rutland , "Peter Zijlstra" , Alexander Viro , Boqun Feng , Yuqi Jin References: <1592987548-8653-1-git-send-email-zhangshaokun@hisilicon.com> <20200821160252.GC21517@willie-the-truck> <20200826082401.c6j5fwrbhl7vgmhj@yavin.dot.cyphar.com> From: Shaokun Zhang Message-ID: <803a5202-6240-b062-b1d9-2aed0e11ebad@hisilicon.com> Date: Thu, 27 Aug 2020 16:27:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200826082401.c6j5fwrbhl7vgmhj@yavin.dot.cyphar.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.76.251] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Aleksa, 在 2020/8/26 16:24, Aleksa Sarai 写道: > On 2020-08-26, Shaokun Zhang wrote: >> 在 2020/8/22 0:02, Will Deacon 写道: >>> - This thing is tagged with __randomize_layout, so it doesn't help anybody >>> using that crazy plugin >> >> This patch isolated the @f_count with @f_mode absolutely and we don't care the >> base address of the structure, or I may miss something what you said. > > __randomize_layout randomises the order of fields in a structure on each > kernel rebuild (to make attacks against sensitive kernel structures > theoretically harder because the offset of a field is per-build). It is My bad, I missed Will's comments for my poor understanding on it. > separate to ASLR or other base-related randomisation. However it depends > on having CONFIG_GCC_PLUGIN_RANDSTRUCT=y and I believe (at least for > distribution kernels) this isn't a widely-used configuration. Thanks for more explanations about it, in our test, this config is also disabled. If having CONFIG_GCC_PLUGIN_RANDSTRUCT=y, it seems this patch will lose its value. If it isn't widely-used for this config, hopefully we can do something on the scene. Thanks, Shaokun >