[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xenpm: sanitize allocations in show_cpufreq_para_by_cpuid()


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 25 Mar 2025 13:12:22 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mvPC5b/ZXX5yhI5ir4m1yjdZju8YX9AEOvQGPoXNHeo=; b=juHl/0jfiv8f7Umz1eFL7EUAGnQLkiMUftNm9GOVuentkU/mA3WC5BggmDaQ/khM4rvFhktCLi2NSfSNK7ZbE9W+vHzjeWi03eBhg7BFs8elU8tskgaEP6eUB52Cmm/ptyrTkB2XDw03egCszaKap+Gj2b0gvMvQLpB/jbNCc0SD43Uh+njEveo//vow3n6+PlxTuYvykgsWve+3zGQFesKJNmvsHkmncbwv7IXB2RMzdJXtrmtgjGvStYqvg5hk3ntcTGjN1mhOHF5kBuXBsCvWqeY0deIQh+2rC8OajMoJ5Wz2s3zhLeQn168Kv90bVxijDW8JNh/07LEXhYbfVQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=T+3dPd6Yshdorx7EThQlEBsFJwDZHsL047NzrUuZF8QBu7fDmQ1qAd1N6M4jrkCA6Xbz8Y6heedzXEu8DjPQ+/H+kyz7WQS+SSTCmIGswLW0gl4qQcmrza/tMU2NlUsaHVGRbWPswvEcyLWIwRAe/V93/fCwCc5l5em0XSBBk621D3XBbPcUAW1TjIUyj08nM7hgroWhmRehpfv2e1If1CoNennXqCbC67oxYtWKVQ3A+jWLsbTMPGk63w+odAlJYiMD6TOhgSxdFdtoWEwb9dKeMCVC8C7uHHWHIyfEi2/rFG3FHbWT8KByd0elCGIxZsnfRIJkCGYhaj0cptFLVQ==
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jason Andryuk <jandryuk@xxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 25 Mar 2025 17:12:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-03-25 10:30, Jan Beulich wrote:
On 25.03.2025 15:20, Andrew Cooper wrote:
On 25/03/2025 12:51 pm, Jan Beulich wrote:
malloc(), when passed zero size, may return NULL (the behavior is
implementation defined).

More importantly, this is the Musl behaviour, so is how ~most of Gitlab
CI behaves.

  Extend the ->gov_num check to the other two
allocations as well.

I'm not sure what you mean by this.  Only one of these hunks has a
->gov_num check.

Not sure I see a better way of wording this: What I mean to say is that
the ->gov_num check that there is already is being replicated (with "gov"
replaced accordingly) to the other two places where similar allocations
happen. Maybe simply s/Extend/Mirror" would already help?

Yes, "Mirror" is better.

  Don't chance then actually using a NULL in
print_cpufreq_para().

Fixes: 75e06d089d48 ("xenpm: add cpu frequency control interface, through which user 
can")
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

The code change looks ok, so Acked-by: Andrew Cooper
<andrew.cooper3@xxxxxxxxxx> but I'd prefer a clarified commit message.

Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>

Thanks,
Jason



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.