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] [day] [month] [year] [list]
Message-ID: <94b0548b-e48a-4bff-8611-116ed89baec3@web.de>
Date: Wed, 21 May 2025 17:13:00 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Anusha Srivatsa <asrivats@...hat.com>, dri-devel@...ts.freedesktop.org,
 David Airlie <airlied@...il.com>, Guido Günther
 <agx@...xcpu.org>, Icenowy Zheng <icenowy@...c.io>,
 Jagan Teki <jagan@...rulasolutions.com>, Jagan Teki <jagan@...eble.ai>,
 Javier Martinez Canillas <javierm@...hat.com>,
 Jessica Zhang <quic_jesszhan@...cinc.com>,
 Jianhua Lu <lujianhua000@...il.com>, Linus Walleij
 <linus.walleij@...aro.org>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Maxime Ripard <mripard@...nel.org>,
 Michael Trimarchi <michael@...rulasolutions.com>,
 Michael Walle <mwalle@...nel.org>, Neil Armstrong
 <neil.armstrong@...aro.org>, Ondřej Jirman <megi@....cz>,
 Simona Vetter <simona@...ll.ch>, Stefan Mavrodiev <stefan@...mex.com>,
 Thomas Zimmermann <tzimmermann@...e.de>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel@...i.sm
Subject: Re: [PATCH v3 00/30] drm/panel: Use refcounted allocation in place of
 devm_kzalloc() - Part2

…
> There are a lot of occurences of the panel allocation across the
> subsystem. Much thanks to Maxime for the semanic patch which actually
> gives a list of panels allocated unsafely.

I imagine that the shown SmPL code can be improved another bit
(like the following).


@find_add@
identifier add_f, b, c;
type T;
@@
 add_f(...)
 {
 ... when any
 T *c;
 ... when any
 drm_panel_add(&c->b);
 ... when any
 }

@find_allocation@
identifier alloc_f, cal;
position p;
type find_add.T;
@@
 alloc_f(...)
 {
 ... when any
 T *cal;
 ... when any
 cal =
(      kzalloc
|      devm_kzalloc
)(...)@p;
 ... when any
 }

@script:python@
add_f << find_add.add_f;
alloc_f << find_allocation.alloc_f;
alloc_p << find_allocation.p;
@@
coccilib.report.print_report(alloc_p[0],
                             "ERROR: Panel driver is unsafely allocated in %s and added in %s"
                             % (alloc_f, add_f))


Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ