Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2248418rdb; Mon, 9 Oct 2023 19:24:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUghhR9v4wXIr7FHO7VJomzF5VXAwnCiseL6+AD5WnptoaX0xFd+K+x9pYJ/wWndjBVayM X-Received: by 2002:a25:a545:0:b0:d89:4357:a9fd with SMTP id h63-20020a25a545000000b00d894357a9fdmr15084046ybi.18.1696904641861; Mon, 09 Oct 2023 19:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696904641; cv=none; d=google.com; s=arc-20160816; b=Vys6VyOCQDMn0G5nAeVxjXF0ydkepGQ5CLWHyFIVh16M/6ibkPFAmoDVbEIaJz6OGa IWW5VdtEkqIA3vSMPGpwExuTb5lXxVKC4uwNUriaY//gyFg6JgzfJXTJnaupWV1sgBUb UmolC06KMM8YdnOfiy/dbNORcGcoGE6pwEXRk2FyLt+7WAc+voy3pn13K6s9RkttFBYF UPpSwjVBrQvPTEFVxAM6ogiO2y4lEvjdXcaswmPzTEmvFrbiGNa/WnuuQl5qan+pn+if xs9g5ZNAbY0YYokceEkMxjQKBBNAY74dLE6ZcSydvS8xC0lpj6Qfta1avSmwsMCDRkdR 74nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=vDDZpwwma7Avl3c22y5CxXhDLr3FrhQCVpBoVTpT7Is=; fh=RV5SxqZzKAd63/IiUMaOiN1UCLwM89ukod9hiC99XGA=; b=GYKtikbxnbb3qSfc3ZzAQTH2DOAl8FvWMC7pXXZ+aDzGc8slKfI/SndReCMU9aEbeJ PU9lgLQixxPWJj9N1NuG107R7bj6x8o3oB5gtkyM1t7vYDwz5ONtjLhCQcqQcG7+1X9/ 134TpbmM5rsaq55eo+FOaALypIcvceZjoJh/v78ujwfu5+C0PN2Oe4R17Dia7p6K60wq PdDmV6JHeDccFOPlUcT9ECNBhlKBNJvFBGkd3oWPPIUNpJexTktlLzB/uDQ1NYF7gzA4 nnM1z5RfwwfuPIs6P+P1v93ugVKyf7eRppbVPTJ1Sc3u7LY8qg5a5hp0bJuWtIVDX1aP N6nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=cLZzej6i; dkim=pass header.i=@codewreck.org header.s=2 header.b=Wo2S7iv9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id u11-20020a6540cb000000b005440b9f013csi5280406pgp.899.2023.10.09.19.24.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 19:24:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=cLZzej6i; dkim=pass header.i=@codewreck.org header.s=2 header.b=Wo2S7iv9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 2E7A280293E2; Mon, 9 Oct 2023 19:23:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441886AbjJJCXg (ORCPT + 99 others); Mon, 9 Oct 2023 22:23:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441877AbjJJCXf (ORCPT ); Mon, 9 Oct 2023 22:23:35 -0400 Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E70BDA; Mon, 9 Oct 2023 19:23:32 -0700 (PDT) Received: by nautica.notk.org (Postfix, from userid 108) id 31D10C01D; Tue, 10 Oct 2023 04:23:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1696904608; bh=vDDZpwwma7Avl3c22y5CxXhDLr3FrhQCVpBoVTpT7Is=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cLZzej6iwRpfw/yDnbY1P1nWxiXfJ9Deryd9mZkGAgBhKJizV7SZdWvnz7ltlXo2k AbXVzq712zwJ2NQat3uECJmclHScHyYObiXEdYxWO3KCRNi3aXISuP0z8V9JVAm/ml 04gGbPyOVM9ukcinXvdO7X3VM+3ZEaWtosp0G8Xj84kzNDuyMUKNc9V4uKD8L+rFw2 Ai8l0mz81aoWlHZ5X2qpjNNEzRc19cEnMEV4OvB/iHnHwjuy0oTstUC1HKda3olIFx 2Lla+WA6j7ciAzApdT4hVUQhGoX9AqPdD/snBcXEQ+6kqTQi7zVIPflpi0km8g8d62 Qjkys3SYx3IQA== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email X-Spam-Level: X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from gaia (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id 6D504C009; Tue, 10 Oct 2023 04:23:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1696904607; bh=vDDZpwwma7Avl3c22y5CxXhDLr3FrhQCVpBoVTpT7Is=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Wo2S7iv9h8oygPJ3rzyYbNjLs/YiTnhz28dN0FQ4cvWcmxrEKYzhwvvWqSShV/Zqj DFcKBwysqunq25EHaT+LqRVFy76WY3j4Mvf5gHzCPfP9C/cNJH2ua9amjdBr8zUEeE Uh9LJvl576hU1aVOa/PY7GzchJwaPToZjaPAmg3Lt7Vv2bTM99PyOpObUiHO5ghK6F QZ9QVeGt+ZYzC7DW9mbUb4fXt1pJRBfry+i8ic6VuegDn5UGdMYh6WhDOdfjf2vgVe szc1JxsbuhyxydgnHYcHimIao0z3PBEtr7MXArOTQpr51NrqT4tk6rzoxQkRgG4RCu 08muuPd8HJxBg== Received: from localhost (gaia [local]) by gaia (OpenSMTPD) with ESMTPA id 80c398e3; Tue, 10 Oct 2023 02:23:22 +0000 (UTC) Date: Tue, 10 Oct 2023 11:23:06 +0900 From: asmadeus@codewreck.org To: Christian Schoenebeck Cc: ericvh@kernel.org, lucho@ionkov.net, Su Hui , v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] fs/9p/xattr.c: avoid format-overflow warning Message-ID: References: <20231008060138.517057-1-suhui@nfschina.com> <13910281.Zj71IQSfG8@silver> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <13910281.Zj71IQSfG8@silver> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 09 Oct 2023 19:23:58 -0700 (PDT) X-Spam-Level: ** Christian Schoenebeck wrote on Mon, Oct 09, 2023 at 08:34:15PM +0200: > > +++ b/fs/9p/xattr.c > > @@ -139,7 +139,7 @@ int v9fs_fid_xattr_set(struct p9_fid *fid, const char *name, > > > > ssize_t v9fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) > > { > > - return v9fs_xattr_get(dentry, NULL, buffer, buffer_size); > > + return v9fs_xattr_get(dentry, "", buffer, buffer_size); > > } > > > > static int v9fs_xattr_handler_get(const struct xattr_handler *handler, > > > > Mmm, that's not the same is it? Have you tested this change? > > Currently this function causes a 'Txattrwalk' 9p message to be sent to 9p > server with its name[s] field being NULL, and the latter being the magical > hint to 9p server to not send an attribute, but rather the list of attributes. > > With your change I would assume that it would rather ask server for one > attribute called "". I have not tested myself, just worrying that it might > break behaviour. p9pdu_vwritef should output the same (just a 0 length) for both NULL and "" so I think it should be ok, but it definitely needs testing. I'll try to find time to check (getfattr -d should be enough) later this week and add it to the pile -- Dominique Martinet | Asmadeus