From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D1FB2FAF for ; Fri, 20 Aug 2021 15:56:31 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id mq3so7568367pjb.5 for ; Fri, 20 Aug 2021 08:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=C3a7vVBUf0KW7MXt4FnTeXqGlzkeA3TVHAyOaxNZlwQ=; b=mWy+dsfzuC4WR7e/bELnLc1DBewBd+6uqLCiUlPpSL/hR3JFjiFZGkc64dOnkcT9C9 qDMRqhN9IlO5CQXHcgzIx3Y2JRqX6MsEMYyUkp08whfolpRdd2uxh73eqsjx32WZPMfY SPWC7Ec8QNUjnKmK0pksWV2GR2YpxIveB+TMk= 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; bh=C3a7vVBUf0KW7MXt4FnTeXqGlzkeA3TVHAyOaxNZlwQ=; b=jnwTxcZopbliBNJ1yO39f5oUnG3QPdW0Hj6203GYk2mTS+ExjOjcs5cuI8POtvCQ7p 0g6qoA1hQZYUG6RrflVnWRUOATNTd5yHoLpCcEo1LdqmctNIAx6rBX+66g0eCP8ZvJX4 stk0bSMPIhFlR8clo9MQPU1w61WXS4UiuBGf4Mi7wLArL2KadKfURkedQtdvdmlbv26d wXL9v5pexT5a/5pIhY+16BFU0i7juy3E4b5vbzFizTtjCtvIWDNQMnhjT+pcsKzfR3UV Ee6dN1UPZtFjyrp/nEekVemukc6wpI6jjvsqWfZVqgfx0psKzhDcOSsJlfvwYmucdKLx lqCw== X-Gm-Message-State: AOAM532VcXvGjQgTkrAiiAayBKjjihlKV/nkTh10GeCWAQLdFe++zoIc WfXUH2xOXWUeJgSJllie03+gHw== X-Google-Smtp-Source: ABdhPJyhg05jtv2sdt7XrLbWPk8JBbrR41kaovvHCcwZtOZ4P7Cf6Qg2VrCTEpx9+rp1igwyJ9xLVA== X-Received: by 2002:a17:902:f704:b029:11a:cdee:490 with SMTP id h4-20020a170902f704b029011acdee0490mr17049722plo.37.1629474990741; Fri, 20 Aug 2021 08:56:30 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 21sm7304926pfh.103.2021.08.20.08.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Aug 2021 08:56:30 -0700 (PDT) Date: Fri, 20 Aug 2021 08:56:29 -0700 From: Kees Cook To: Jason Gunthorpe Cc: linux-kernel@vger.kernel.org, Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, "Gustavo A. R. Silva" , Greg Kroah-Hartman , Andrew Morton , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-staging@lists.linux.dev, linux-block@vger.kernel.org, linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, Rasmus Villemoes , linux-hardening@vger.kernel.org Subject: Re: [PATCH v2 56/63] RDMA/mlx5: Use struct_group() to zero struct mlx5_ib_mr Message-ID: <202108200856.E0E8711CB@keescook> References: <20210818060533.3569517-1-keescook@chromium.org> <20210818060533.3569517-57-keescook@chromium.org> <20210819122716.GP543798@ziepe.ca> <202108190916.7CC455DA@keescook> <20210819164757.GS543798@ziepe.ca> <202108191106.1956C05A@keescook> <20210820123400.GW543798@ziepe.ca> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210820123400.GW543798@ziepe.ca> On Fri, Aug 20, 2021 at 09:34:00AM -0300, Jason Gunthorpe wrote: > On Thu, Aug 19, 2021 at 11:14:37AM -0700, Kees Cook wrote: > > > Which do you mean? When doing the conversions I tended to opt for > > struct_group() since it provides more robust "intentionality". Strictly > > speaking, the new memset helpers are doing field-spanning writes, but the > > "clear to the end" pattern was so common it made sense to add the helpers, > > as they're a bit less disruptive. It's totally up to you! :) > > Well, of the patches you cc'd to me only this one used the struct > group.. Understood. I've adjusted this for v3. Thanks! -- Kees Cook