Message ID | ZJNnynWOoTp6uTwF@work |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4675285vqr; Wed, 21 Jun 2023 15:07:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ65Mg+2DnNa9wmk6sO9I//8lfWgJMZ+IaKH53Fl+HPbJaIIlcB+UGfZLLU6DPUFyZKiswB9 X-Received: by 2002:a17:903:238c:b0:1b5:4690:e8d0 with SMTP id v12-20020a170903238c00b001b54690e8d0mr15789303plh.22.1687385227297; Wed, 21 Jun 2023 15:07:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687385227; cv=none; d=google.com; s=arc-20160816; b=Px+hH0DL0lIFnBCiHmQQCMsgW+ZSYJl1E5ovCVWkORZoiZjVLaJA/tJ/N5JacEFJxB vq8lnLuad/E+YaahY3j71ovOB81UDJ6qg7Bj7LWv8QS7jmZ8fDd+MdguOSjNgDUFvUPq EM6XqqGUP2MVPpz+WJyKvehT6Wvw7BwLuSoelLFQSZ6JLpiPmetDDqj0RKhyKb/OSnXJ c7Xnr/qDRrz5so8rOemnfYDfcaCam/vqCCFGCOrB9SGvfTL0BPd54Gkh8aC4F8XlUzEX QO4z1d3wl21dDQS3VoVrP77mDEekezcQKq01V/KhdHNpaLNpZvx81o1HrAQxa2Gln2Tr xLBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=noT2KZrWCv8kF7oF3+gTdSxtCnr1qoxp8WxJ5f3meB4=; b=YDEfZ0NwvUjfd9mq2FVlFy1MkmFDsYrenhtIQZ/LKa2BNeZf+V5RHs3M3nfNQ7n5yJ Rx2Xl5adTcKtVsDNZAAvCWMOp5Z7Gk2AfifrQn/eXS7FREvTPCUEpab18gT/Xs1PyxrL fLOAKRvQGBTzqYX9tHTkS2UiL24w3i/yzT/Z2kur/sQ3s8Qcr/mWJ5SewK3gpNsF6zh7 eb1shS2lA/WKxzAVxOWvdmY+Wh3dIsMA3GLpG6mWXq0FwHpobZKtspFLF26oNeBR+sN/ s9W/jBVYGbmhdG6lLqp5imdApfQGxrFff2l+U0b7bubIGyfdcM3rMv7Anip409n+GW2z m+Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mc6VeZNl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n17-20020a170902d2d100b001b55229ea8csi5723756plc.399.2023.06.21.15.06.54; Wed, 21 Jun 2023 15:07:07 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mc6VeZNl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229920AbjFUVLu (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Wed, 21 Jun 2023 17:11:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbjFUVLt (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 21 Jun 2023 17:11:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88B901989; Wed, 21 Jun 2023 14:11:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1A5B2616C4; Wed, 21 Jun 2023 21:11:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1798C433C0; Wed, 21 Jun 2023 21:11:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687381906; bh=O26sECzjqHFzFfFoCV8qOAnuIGD+u12DbfflB2M+dGE=; h=Date:From:To:Cc:Subject:From; b=Mc6VeZNlzLFFKvWLt4SfV26pH0WCzMz1WckpSDLzbdaYX8GMutcxYHze+5by4XLK2 yHfMQLFbu2pmeEwBynpL3BEJ3tetRlPnPvJPXEKi/IRe9DkmxAZQygwAYHnlpCw/Rc XkEPmn+8RSuPpM6MKhI/JnuECIkGZiA8exsp9iZ8IFF0vIsd6Cb6XANXO+HEjXGN+R xkGt+asExn3p8hUshKNVBlmPQC3ubDd1ikaJfL9f1Xttgaqdh2SdpNRrncS4yZDHO8 xwzkLPXl/ITfPY3/tMsiQ+nvvAYzcHK8d4nk8TY1AciXccOuXNzHYL+dSEneX0CwGL fQBR36Y8C8Qcg== Date: Wed, 21 Jun 2023 15:12:42 -0600 From: "Gustavo A. R. Silva" <gustavoars@kernel.org> To: Namjae Jeon <linkinjeon@kernel.org>, Steve French <sfrench@samba.org>, Sergey Senozhatsky <senozhatsky@chromium.org>, Tom Talpey <tom@talpey.com> Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" <gustavoars@kernel.org>, linux-hardening@vger.kernel.org Subject: [PATCH][next] smb: Replace one-element array with flexible-array member Message-ID: <ZJNnynWOoTp6uTwF@work> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769349721752031603?= X-GMAIL-MSGID: =?utf-8?q?1769351652591576880?= |
Series |
[next] smb: Replace one-element array with flexible-array member
|
|
Commit Message
Gustavo A. R. Silva
June 21, 2023, 9:12 p.m. UTC
One-element arrays are deprecated, and we are replacing them with flexible
array members instead. So, replace one-element array with flexible-array
member in struct smb_negotiate_req.
This results in no differences in binary output.
Link: https://github.com/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/317
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
fs/smb/server/smb_common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
2023-06-22 6:12 GMT+09:00, Gustavo A. R. Silva <gustavoars@kernel.org>: > One-element arrays are deprecated, and we are replacing them with flexible > array members instead. So, replace one-element array with flexible-array > member in struct smb_negotiate_req. > > This results in no differences in binary output. > > Link: https://github.com/KSPP/linux/issues/79 > Link: https://github.com/KSPP/linux/issues/317 > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Thanks!
On (23/06/21 15:12), Gustavo A. R. Silva wrote: > One-element arrays are deprecated, and we are replacing them with flexible > array members instead. So, replace one-element array with flexible-array > member in struct smb_negotiate_req. > > This results in no differences in binary output. > > Link: https://github.com/KSPP/linux/issues/79 > Link: https://github.com/KSPP/linux/issues/317 > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
2023-06-22 6:12 GMT+09:00, Gustavo A. R. Silva <gustavoars@kernel.org>: > One-element arrays are deprecated, and we are replacing them with flexible > array members instead. So, replace one-element array with flexible-array > member in struct smb_negotiate_req. > > This results in no differences in binary output. > > Link: https://github.com/KSPP/linux/issues/79 > Link: https://github.com/KSPP/linux/issues/317 > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Applied it with reviewed/acked-by tags to #ksmbd-for-next-next. Thanks.
diff --git a/fs/smb/server/smb_common.h b/fs/smb/server/smb_common.h index 6b0d5f1fe85c..aeca0f46068f 100644 --- a/fs/smb/server/smb_common.h +++ b/fs/smb/server/smb_common.h @@ -200,7 +200,7 @@ struct smb_hdr { struct smb_negotiate_req { struct smb_hdr hdr; /* wct = 0 */ __le16 ByteCount; - unsigned char DialectsArray[1]; + unsigned char DialectsArray[]; } __packed; struct smb_negotiate_rsp {