Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp554743ybz; Fri, 24 Apr 2020 05:20:29 -0700 (PDT) X-Google-Smtp-Source: APiQypImuA6wONdFSOvBCmDCDtL/ACFOYk6mIn355pS7ZEM2QxEwefb/vSMHISHzWtBrme13z6Rt X-Received: by 2002:a05:6402:1d93:: with SMTP id dk19mr6599861edb.170.1587730829151; Fri, 24 Apr 2020 05:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587730829; cv=none; d=google.com; s=arc-20160816; b=f9by+CdvXUexVkgOdDz2SySja9sqz9LrHau5a/i56N83InlOQEpZ82uORYlLaHG1fj XJtyINm0flcPJKh9GV2zpfqjCyptdre0jeTspS3gEDn/qDdnwR33tWSfYQhcI5VAcNjR aVweEGtNH49sqjl9FyMnzuZIJ5uATPoSyKcxbCl1vy6HRXinpxk91VOJXfjyHNv4wXg9 cTjipMPyJJ/QJIn1qlYVgqaxqWELTDR/dhlYTyHyyqARHQTFv3HAxx/+bz5X8zwHv5r0 JrprPDkOTkugpARWXStswWgWR0a8RUPTW6ouBqtradpHQ9Tfxa5BBbI8saaKrHpI2XJn 5jVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=stQMKcxru1ycab0nNkNI6do88V3oBob0HPMSzdDCfe8=; b=LXCOO600IgJUsTKeQofuuhVaBl3a+MSL1LvYt4isZNXjs1cKn0phQRfzcnB9ZSnPyv RxVc80Ffg6LS+PZA7jIllog4NjkkMbKyF8QKHoIhLQuDUMPSwuFe04P9LSt/H1OA8/9B xSc8bKsgGtJEU+IpPFjV+QwksQMt/kZ1pyatsKtw9Si3Vujy666osunb82Q6hSFQEwjd 0nR3zPzQ3bEbX4BlXV5iLKSN2vFPrDC+sIyVWWUKG+DjlvbtEVZIK1kAnmM0fEqoM7yV hwTEX7dcouY7Ye8MN+6vDl5H7c8ysTicj8LgbfDMgpQdmr9qgAwCCivWJEwQTZ6az5qk yJJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=EDZuIF9m; 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 n17si3074200ejd.437.2020.04.24.05.20.01; Fri, 24 Apr 2020 05:20:29 -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; dkim=pass header.i=@ziepe.ca header.s=google header.b=EDZuIF9m; 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 S1726975AbgDXMP4 (ORCPT + 99 others); Fri, 24 Apr 2020 08:15:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726849AbgDXMP4 (ORCPT ); Fri, 24 Apr 2020 08:15:56 -0400 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23E19C09B046 for ; Fri, 24 Apr 2020 05:15:56 -0700 (PDT) Received: by mail-qt1-x842.google.com with SMTP id z90so7617818qtd.10 for ; Fri, 24 Apr 2020 05:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=stQMKcxru1ycab0nNkNI6do88V3oBob0HPMSzdDCfe8=; b=EDZuIF9mh4MO3uMagwfvQxVrPyFcFcQQ/YqjHSU0E/7kpK67/O0VrMTQoYFLr8Xdny ceiP3ShAFGqLCCymImyTS/u6CK+6safGqktYl2wczdx4ePh0V3TgYzN1JsDVl6udIRsq xyQF4sH+c7HTjpikgxlXaO09iVMuC2RjskPYlDJvaw/qiHWiG4RNmEkxF94TvEQHgFGo xpvogtMZJbKVekUBYomI0XHS58lhKGIuW27flx9u3bacRsygXmUNas6R2YrNbOEN5vMO PtCu8zKPCWi6bsyPoOJXB0n7faMV4msQWUy1wqQdNqEUyYfLcY1i6S7/tTCbpXSgPsaU Q6Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=stQMKcxru1ycab0nNkNI6do88V3oBob0HPMSzdDCfe8=; b=m+nXYqhm5TDO1QdKIryGGqR8HuOPM9I28hiRRknSraPELd/19ySl9AVRCkNiw9tEKF x1auMKrGvvFNMG+w27gnr7jrbaKVWep/P4y3lNHCmjI1EwEKDiW5jVh5afrxcHWjgALX D2ujnDEfWXW2+4DanktX5RcERBlNjFBtGwFsXAu00FUNswGTsvNE9RMnP1iQd7deMyfJ /togNKAmiOmqzFGw7/sCxy5PJ+NJIzi993oKofobip8MQyh/s089YctJjh04/b76brN+ +x0gUx2OZHbm/gRG/X4ko0F4yvjo0PefSTwupiDYbYTYn1txIQ/hKhJ2PSC82W1tnaUl R5BA== X-Gm-Message-State: AGi0PuY8nnO0zZCIWEFZSflKh4my4Tq0Q5/J2r5oxW2V+a/bgY/eF5lD Qu7MvNEnxBh8+pAzDwaL0ugpvQ== X-Received: by 2002:aed:3ff4:: with SMTP id w49mr9175729qth.61.1587730555234; Fri, 24 Apr 2020 05:15:55 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id p80sm3577469qka.134.2020.04.24.05.15.54 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Apr 2020 05:15:54 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1jRxFJ-0004zP-Fh; Fri, 24 Apr 2020 09:15:53 -0300 Date: Fri, 24 Apr 2020 09:15:53 -0300 From: Jason Gunthorpe To: Nathan Chancellor Cc: "Gustavo A. R. Silva" , Linus Torvalds , Kees Cook , Greg KH , Linux Kernel Mailing List , linux-rdma@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: remaining flexible-array conversions Message-ID: <20200424121553.GE26002@ziepe.ca> References: <6342c465-e34b-3e18-cc31-1d989926aebd@embeddedor.com> <20200424034704.GA12320@ubuntu-s3-xlarge-x86> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200424034704.GA12320@ubuntu-s3-xlarge-x86> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 23, 2020 at 08:47:04PM -0700, Nathan Chancellor wrote: > Hi Gustavo, > > On Wed, Apr 22, 2020 at 01:26:02PM -0500, Gustavo A. R. Silva wrote: > > Hi Linus, > > > > Just wanted to ask you if you would agree on pulling the remaining > > flexible-array conversions all at once, after they bake for a couple > > of weeks in linux-next[1] > > > > This is not a disruptive change and there are no code generation > > differences. So, I think it would make better use of everyone's time > > if you pull this treewide patch[2] from my tree (after sending you a > > proper pull-request, of course) sometime in the next couple of weeks. > > > > Notice that the treewide patch I mention here has been successfully > > built (on top of v5.7-rc1) for multiple architectures (arm, arm64, > > sparc, powerpc, ia64, s390, i386, nios2, c6x, xtensa, openrisc, mips, > > parisc, x86_64, riscv, sh, sparc64) and 82 different configurations > > with the help of the 0-day CI guys[3]. > > > > What do you think? > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d496496793ff69c4a6b1262a0001eb5cd0a56544 > > [2] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?h=for-next/kspp&id=d783301058f3d3605f9ad34f0192692ef572d663 > > [3] https://github.com/GustavoARSilva/linux-hardening/blob/master/cii/kernel-ci/kspp-fam0-20200420.md > > > > Thanks > > That patch in -next appears to introduce some warnings with clang when > CONFIG_UAPI_HEADER_TEST is enabled (allyesconfig/allmodconfig exposed it > for us with KernelCI [1]): Indeed, I've tried these conversions before and run into problems like this, and more. Particularly in userspace these structs also get embedded in other structs and the warnings explode. Please drop changes to ib_user_verbs.h from your series > ./usr/include/rdma/ib_user_verbs.h:436:34: warning: field 'base' with > variable sized type 'struct ib_uverbs_create_cq_resp' not at the end of > a struct or class is a GNU extension > [-Wgnu-variable-sized-type-not-at-end] > struct ib_uverbs_create_cq_resp base; > ^ > ./usr/include/rdma/ib_user_verbs.h:647:34: warning: field 'base' with > variable sized type 'struct ib_uverbs_create_qp_resp' not at the end of > a struct or class is a GNU extension > [-Wgnu-variable-sized-type-not-at-end] > struct ib_uverbs_create_qp_resp base; > ^ > ./usr/include/rdma/ib_user_verbs.h:743:29: warning: field 'base' with > variable sized type 'struct ib_uverbs_modify_qp' not at the end of a > struct or class is a GNU extension > [-Wgnu-variable-sized-type-not-at-end] > struct ib_uverbs_modify_qp base; > ^ > 3 warnings generated. > > I presume this is part of the point of the conversion since you mention > a compiler warning when the flexible member is not at the end of a > struct. How should they be fixed? That should probably happen before the > patch gets merged. The flexible member IS at the end of the struct and is often intended to cover the memory in the enclosing struct. I think clang is being overzealous with its warnings here. Jason