Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2353350rdb; Tue, 10 Oct 2023 00:59:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHv8CPCRCk/zMF3KnfK21EWG3CWvM1AG/VuAsui23gCniykSbpMaaQ8cUDYRAs6+bc3MwJq X-Received: by 2002:a17:902:bb84:b0:1c6:2161:b171 with SMTP id m4-20020a170902bb8400b001c62161b171mr13797561pls.4.1696924796936; Tue, 10 Oct 2023 00:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696924796; cv=none; d=google.com; s=arc-20160816; b=n3/fERYtB4P3ya1JN3kDKW/HfO1/6lhC5bCQ+rvmhQ3MIX0oAN3tot27AwCimyB2lD z+bIk8ByAf4zxjyRa62r81nhfVB4BX/ZV+PJgps/SNHFeSoih7Ob9Xj5QUbwzvtT1VSD ugOfiOoM8kV0b6AcgykBzXgImmYxdyRQvFVvCTpF83+OCToOwHwbNzcssa7SYff+JJ1i EjKqcaCwazFV+iFt60sEscQKl8XhvVzgVv/WjeaPi0VZqMuSzrL51SfpL1jmE+/fderL yZksCnCIft9hKoT6ZEoTpzd8fx2VlJPv5c258hrHL54JYC12R2gBm9Bk1D2mnLQ3Rzpr 5Zhw== 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 :dkim-signature; bh=vZ/Iuu84hep1RjBDXaiCtQLKdDGxvE+knWVOSwSOFmg=; fh=VWG0VS1IVDtxUn1ns18SerYB1RNU2b8mcgyywEGNMbc=; b=F/iAVXYj1tELPK7L1KCYMHfDy+PEBDZXQpeDt0HhWNc9ADznAkvii+QmbXEdJIUxNF eMx2Km7ALmILpRB45GkWmlzJ75qrlxtAhtWe8ZJLq/AVQkcE2v1amZyHD5lC4snmmcpM VgMYUQnPyek3SL/1xBhCnPTtwW8XGbj3pXq6RTygzMqMkVfvlMgL1JL8xa+T4QtQBVM8 ZQ4jt7DRZcXOaxuwELolKTclc+797BT8UNI2A3R2dTrG+HE0ikyLHpHjh7be1rW7T/52 06yxtdjaWG0fhLHbvVK6bkoPYItbbNx+ZX2X3jLnS3KjwXZLNxOJzWRE3u/9lWa/C509 yT7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crudebyte.com header.s=kylie header.b=YzZE4smW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=crudebyte.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id kx8-20020a170902f94800b001c61bd7cee0si11066345plb.211.2023.10.10.00.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 00:59:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@crudebyte.com header.s=kylie header.b=YzZE4smW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=crudebyte.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 72C4D82C2DB4; Tue, 10 Oct 2023 00:59:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442573AbjJJH7Y (ORCPT + 99 others); Tue, 10 Oct 2023 03:59:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442658AbjJJH7Y (ORCPT ); Tue, 10 Oct 2023 03:59:24 -0400 Received: from kylie.crudebyte.com (kylie.crudebyte.com [5.189.157.229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 535F2AC; Tue, 10 Oct 2023 00:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Content-Type:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Content-ID:Content-Description; bh=vZ/Iuu84hep1RjBDXaiCtQLKdDGxvE+knWVOSwSOFmg=; b=YzZE4smWZ+q1Mv7lXM23xEuJHM ZP7WoGJCARna5evriYPQuoydFF0clnT/ChUm0MTeGEUNK15U5UXFt8o+INlOw8DimXlAxraQv7Mzy 6uFAF1ts4lE6i46Rt6eOYHYtw6s7lhmv+tvyxFdZ+IaJe3IgBZqP6lzaHlBnQ7z6HPBiSN9g2y04x 6c1yIy6h2MFxa3qarhFqqXcyYHOWXcnsCG0P3Ztv3iNTK+jVdx2eWIj8xmiRq9t6FXTDWq6yq01wX kmrqCZpSZXxeDHFjHUo/l3RIdjvdupSYF0V6hZ39d6w4q1jGq0A/diV7mbm4EhU/F5YJQuIoZVTkJ YZnO8kZiyUfmiKR4Hl8XHbYx3oIvm+TDZIqDdfMYnPGx+0bybv+4FihZ2fxIjyaU9zgUg3f1hs9Td PbohF7ljIpr7/U6tdJY3wSV72clciralsqhHOzcggHjGBNEGKTiRcweeUnRJvhThvOgbeyFqKZEGB cLLbrrOdjR5MGW9L3Yd+BlJ7aEL0kGjZl7L4JF74qsh/aGHL41rsYW0VZNKyjW39fEc7MEaI+KklP tKA5a8O2lwqqoRLBWhHXEbD3NHWYQWhMle4gqLJh3Me5Yu0rb76vU4aMKOTuAiTvP5PuqU4rIn0Xv OlhzQo8VRUFFTnoDV/t0p0Tx+ZBUDK10hMeH+T5vo=; From: Christian Schoenebeck To: asmadeus@codewreck.org 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 Date: Tue, 10 Oct 2023 09:59:11 +0200 Message-ID: <1795281.aKYqWbn8Tv@silver> In-Reply-To: References: <20231008060138.517057-1-suhui@nfschina.com> <13910281.Zj71IQSfG8@silver> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Tue, 10 Oct 2023 00:59:51 -0700 (PDT) X-Spam-Level: ** On Tuesday, October 10, 2023 4:23:06 AM CEST asmadeus@codewreck.org wrote: > 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 Yeah, I think you are right Dominique, it should end up the same as both cases result in a string length of 0. /Christian