Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2918071rwd; Fri, 26 May 2023 13:20:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7fHsW0pMwMkz0G9rL+2n3zMGrM7cCW+n22XJDSfPB8xo1OrryPxEdo62JauN3rr+6CWR20 X-Received: by 2002:a05:6a20:4428:b0:10c:4a13:a5c1 with SMTP id ce40-20020a056a20442800b0010c4a13a5c1mr672330pzb.17.1685132457643; Fri, 26 May 2023 13:20:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685132457; cv=none; d=google.com; s=arc-20160816; b=zGfrcOYbO2mx6ycJgzDE6SxIP5918VA14DJP0f9fHAEgaqanDLcaI9knPiTIlMDIEV ISncOp1wsuYSsjdiV5mxKZHw8TB4p3aBYI9GbC1Sh79cJjpK/5yuJN1912sZnvmAGlw0 yE2mVnQlKe5/mKvR3pIfjyP33FHrm35scd1Vh3pUF64dTrKH5nOc5fHLsHHAF6vygB48 yFQx2vuuesaF6emUuD3yE0VlGAlra4AUbxCQiq+Fz+aCczSAvlwo7bwIgWDm1H9uKgdv l/5/aNJIeoEyUt7y4QW/LxiysVZis61EObRfZslwyUpgE31+y1u3sQCQVWjMyHEEWEbs ZGEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=p6fH3gCn0jT75jJ4DwMGKrH1FMwNz/5zPatDmEw7sdU=; b=fxqW797rjKXn1jgG3JZglfxqLPJtkJBOLEGB+DjZMvD200aLALCGwNQSusoNwOH1aq PSCYae/YmkOnZHWZRns4qsnV7vIQcgp3nfPg7hst0l4C6ln432AB+lYjUNlHE41te9cF ztiUwMBP2OGL/1T+fjqAyBdCrmZG4aPDtxrLSEp6gx41/YL1cz/8I6sXsuBQ/TlqdxFD PR9YLO8XO7EMoQA7Lfsbpi9YJwfZDZW78oLd6ya+ZR/gziXr2bbuJyhp3Jn6q10Vy0CB MpEmnzENu3PJa8cAWeTlvL4pMk2ZxhXhKMZWuXpfgYzSOLyBVx6SZ9r3n3VQOrYFNStC rnUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v25-20020a637a19000000b00530b86d2f8dsi3510154pgc.37.2023.05.26.13.20.45; Fri, 26 May 2023 13:20:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237707AbjEZUPc (ORCPT + 99 others); Fri, 26 May 2023 16:15:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237094AbjEZUPQ (ORCPT ); Fri, 26 May 2023 16:15:16 -0400 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75346F3 for ; Fri, 26 May 2023 13:15:15 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R691e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=3;SR=0;TI=SMTPD_---0VjXYN6g_1685132112; Received: from e18g06460.et15sqa.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VjXYN6g_1685132112) by smtp.aliyun-inc.com; Sat, 27 May 2023 04:15:13 +0800 From: Gao Xiang To: linux-erofs@lists.ozlabs.org Cc: LKML , Gao Xiang Subject: [PATCH 6/6] erofs: use poison pointer to replace the hard-coded address Date: Sat, 27 May 2023 04:14:59 +0800 Message-Id: <20230526201459.128169-7-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.24.4 In-Reply-To: <20230526201459.128169-1-hsiangkao@linux.alibaba.com> References: <20230526201459.128169-1-hsiangkao@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 It's safer and cleaner to replace such hard-coded illegal pointer with poison pointers. Signed-off-by: Gao Xiang --- fs/erofs/zdata.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 2ea8e7f08372..83df1954b859 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -91,10 +91,8 @@ struct z_erofs_pcluster { struct z_erofs_bvec compressed_bvecs[]; }; -/* let's avoid the valid 32-bit kernel addresses */ - /* the end of a chain of pclusters */ -#define Z_EROFS_PCLUSTER_TAIL ((void *)0x5F0ECAFE) +#define Z_EROFS_PCLUSTER_TAIL ((void *) 0x700 + POISON_POINTER_DELTA) #define Z_EROFS_PCLUSTER_NIL (NULL) struct z_erofs_decompressqueue { -- 2.24.4