linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Naman Jain <namjain@linux.microsoft.com>
To: Hongbo Li <lihongbo22@huawei.com>,
	kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org,
	decui@microsoft.com
Cc: linux-hyperv@vger.kernel.org
Subject: Re: [PATCH -next] hv: vmbus: Constify struct kobj_type and struct attribute_group
Date: Wed, 4 Sep 2024 16:40:04 +0530	[thread overview]
Message-ID: <fec0bb67-7fc3-4f67-818e-a0439a9822a9@linux.microsoft.com> (raw)
In-Reply-To: <c4fb0fb3-a787-4946-952d-841599509341@huawei.com>



On 9/4/2024 3:48 PM, Hongbo Li wrote:
> 
> 
> On 2024/9/4 18:09, Naman Jain wrote:
>>
>>
>> On 9/4/2024 6:45 AM, Hongbo Li wrote:
>>> The `struct attribute_group` and `struct kobj_type` are not
>>> modified, and they are only used in the helpers which take a
>>> const type parameter.
>>>
>>> Constifying these structure and moving them to a read-only section,
>>> and this can increase over all security.
>>>
>>> ```
>>> [Before]
>>>     text   data    bss    dec    hex    filename
>>>    20568   4699     48  25315   62e3    drivers/hv/vmbus_drv.o
>>>
>>> [After]
>>>     text   data    bss    dec    hex    filename
>>>    20696   4571     48  25315   62e3    drivers/hv/vmbus_drv.o
>>> ```
>>>

...

>>
>> Small thing, I hope you included before and after logs in commit msg to
>> show that some of the data section moved to text as you made these
>> variables constant. If not, please move these after ---.
>>
> You mean remove the '```' or move the whole part after --- ?

Never mind. IMO, mentioning these stats was really optional since we are 
not saving any memory here. This could have been moved to the section 
after --- so that it does not get captured in git log. However there's 
no harm in keeping it where it is. So your call.


Regards,
Naman

> 
> Thanks,
> Hongbo
> 
>>
>> Reviewed-by: Naman Jain <namjain@linux.microsoft.com>
>>
>> Regards,
>> Naman


  reply	other threads:[~2024-09-04 11:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04  1:15 [PATCH -next] hv: vmbus: Constify struct kobj_type and struct attribute_group Hongbo Li
2024-09-04 10:09 ` Naman Jain
2024-09-04 10:18   ` Hongbo Li
2024-09-04 11:10     ` Naman Jain [this message]
2024-09-05  1:14       ` Hongbo Li
2024-09-05  7:33 ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fec0bb67-7fc3-4f67-818e-a0439a9822a9@linux.microsoft.com \
    --to=namjain@linux.microsoft.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=lihongbo22@huawei.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).