From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D1F1C433EF for ; Tue, 14 Dec 2021 17:08:57 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-558-utA5SNsAOjiDHnIlpBKM0Q-1; Tue, 14 Dec 2021 12:08:53 -0500 X-MC-Unique: utA5SNsAOjiDHnIlpBKM0Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A144210168C3; Tue, 14 Dec 2021 17:08:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A5B74A0F65; Tue, 14 Dec 2021 17:08:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B4DBB18077BC; Tue, 14 Dec 2021 17:08:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BEH8kqC022839 for ; Tue, 14 Dec 2021 12:08:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 69A5953B5; Tue, 14 Dec 2021 17:08:46 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6460253B3 for ; Tue, 14 Dec 2021 17:08:43 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 395921C1CD4D for ; Tue, 14 Dec 2021 17:08:43 +0000 (UTC) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-556-QorXzdz8OeewhXHF0j1hAA-1; Tue, 14 Dec 2021 12:08:41 -0500 X-MC-Unique: QorXzdz8OeewhXHF0j1hAA-1 Received: by mail-pf1-f174.google.com with SMTP id o4so18340650pfp.13 for ; Tue, 14 Dec 2021 09:08:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PNMBPkOZLTOjGHzj7TrbFcH7DnoXgRnqiGbYIqbL1q4=; b=mgP6zcjpsWJ6BTPwABPrfITRWXqCKq6aqWcKHUvQSer99cqWbBs8RPqlm2XJ0z2a1A 28Z6gwQ2G5UE/ifSd7tjRL5ddnttmvRqdH8luopB/gH8uv0mxhLFQBM7XtiUjY1fEaXk O3KHb2ZIvlGt5WaW9X400MjEVDHNCtMO4dxKNVuQ+KTP1DvSjRtfCqo7P99KdK5hMLtE TihmmMLDm1sQ6rmDpKwBOOdMPxMp4NRIye1w6x9X9RqygrXtmJI5V1jKcrSUmsaOo+vn sQyKsU7Od1j4ME1Pqm00f60b6D5MjgKN727MYktXAMABuF1aesp+yZw57MfY/9pM3GYS aidw== X-Gm-Message-State: AOAM532dR8OZbUzkw3v6tXezgStEWEf61DWmFZTDDJt5ONaqCttLBC7B a2M3OyUnC1tOoAcGO12fSVq6aQ== X-Google-Smtp-Source: ABdhPJwqjW4UK7mVPGEv5vhhpnk4m9IYAQDxyH+VhHu5Np86nXt828Bh4x/umWIjuN85a32RUYKnwA== X-Received: by 2002:a65:654f:: with SMTP id a15mr4564083pgw.195.1639501720555; Tue, 14 Dec 2021 09:08:40 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b19sm412774pfv.63.2021.12.14.09.08.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Dec 2021 09:08:40 -0800 (PST) Date: Tue, 14 Dec 2021 09:08:39 -0800 From: Kees Cook To: Xiu Jianfeng Subject: Re: [PATCH -next] audit: use struct_size() helper in kmalloc() Message-ID: <202112140908.80D89AC9@keescook> References: <20211214114854.133328-1-xiujianfeng@huawei.com> MIME-Version: 1.0 In-Reply-To: <20211214114854.133328-1-xiujianfeng@huawei.com> X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: linux-audit@redhat.com Cc: linux-kernel@vger.kernel.org, eparis@redhat.com, wangweiyang2@huawei.com, linux-audit@redhat.com, linux-hardening@vger.kernel.org X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Tue, Dec 14, 2021 at 07:48:54PM +0800, Xiu Jianfeng wrote: > Make use of struct_size() helper instead of an open-coded calucation. > > Link: https://github.com/KSPP/linux/issues/160 > Signed-off-by: Xiu Jianfeng Reviewed-by: Kees Cook -- Kees Cook -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit