lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250327170848.GDZ-WGIM553HJ61xj6@fat_crate.local>
Date: Thu, 27 Mar 2025 18:08:48 +0100
From: Borislav Petkov <bp@...en8.de>
To: shiju.jose@...wei.com
Cc: linux-cxl@...r.kernel.org, dan.j.williams@...el.com, dave@...olabs.net,
	jonathan.cameron@...wei.com, dave.jiang@...el.com,
	alison.schofield@...el.com, vishal.l.verma@...el.com,
	ira.weiny@...el.com, david@...hat.com, Vilas.Sridharan@....com,
	linux-edac@...r.kernel.org, linux-acpi@...r.kernel.org,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	tony.luck@...el.com, rafael@...nel.org, lenb@...nel.org,
	mchehab@...nel.org, leo.duran@....com, Yazen.Ghannam@....com,
	rientjes@...gle.com, jiaqiyan@...gle.com, Jon.Grimm@....com,
	dave.hansen@...ux.intel.com, naoya.horiguchi@....com,
	james.morse@....com, jthoughton@...gle.com, somasundaram.a@....com,
	erdemaktas@...gle.com, pgonda@...gle.com, duenwen@...gle.com,
	gthelen@...gle.com, wschwartz@...erecomputing.com,
	dferguson@...erecomputing.com, wbs@...amperecomputing.com,
	nifan.cxl@...il.com, tanxiaofei@...wei.com,
	prime.zeng@...ilicon.com, roberto.sassu@...wei.com,
	kangkang.shen@...urewei.com, wanghuiqiang@...wei.com,
	linuxarm@...wei.com
Subject: Re: [PATCH v2 7/8] cxl/memfeature: Add CXL memory device soft PPR
 control feature

On Thu, Mar 27, 2025 at 06:01:56PM +0100, Borislav Petkov wrote:
> On Thu, Mar 20, 2025 at 06:04:44PM +0000, shiju.jose@...wei.com wrote:
> > diff --git a/drivers/edac/mem_repair.c b/drivers/edac/mem_repair.c
> > index 3b1a845457b0..bf7e01a8b4dd 100755
> > --- a/drivers/edac/mem_repair.c
> > +++ b/drivers/edac/mem_repair.c
> > @@ -45,6 +45,11 @@ struct edac_mem_repair_context {
> >  	struct attribute_group group;
> >  };
> >  
> > +const char * const edac_repair_type[] = {
> > +	[EDAC_PPR] = "ppr",
> > +};
> > +EXPORT_SYMBOL_GPL(edac_repair_type);
> 
> Why is this thing exported instead of adding a getter function and having all
> its users pass in proper defines as arguments?
> 
> And "EDAC_PPR" is not a proper define - it doesn't tell me what it is.
> 
> It should be more likely a
> 
> EDAC_REPAIR_PPR,
> EDAC_REPAIR_ROW_SPARING,
> EDAC_REPAIR_BANK_SPARING,
> 
> and so on.

Looking at this more:

+static int cxl_ppr_get_repair_type(struct device *dev, void *drv_data,
+				   const char **repair_type)
+{
+	*repair_type = edac_repair_type[EDAC_PPR];
+
+	return 0;
+}

Can this be any more silly?

An ops member which copies a string pointer into some argument. What for?

If those strings are for userspace, why don't you simply return *numbers* and
let userspace convert them into strings?

Oh boy.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ