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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 18 Jan 2024 08:18:22 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: "Keller, Jacob E" <jacob.e.keller@...el.com>
Cc: Julia Lawall <Julia.Lawall@...6.fr>, Kees Cook <keescook@...omium.org>,
	"Gustavo A . R . Silva" <gustavoars@...nel.org>,
	"cocci@...teme.lip6.fr" <cocci@...teme.lip6.fr>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Harshit Mogalapalli <harshit.m.mogalapalli@...il.com>
Subject: Re: [PATCH] coccinelle: semantic patch to check for potential
 struct_size calls

On Wed, Jan 17, 2024 at 09:54:19PM +0000, Keller, Jacob E wrote:
> > drivers/misc/vmw_vmci/vmci_datagram.c
> >    227                          dg_info = kmalloc(sizeof(*dg_info) +
> >    228                                      (size_t) dg->payload_size, GFP_ATOMIC);
> > 
> > The Cocci check is looking specifically for:
> > 
> > 	sizeof(*dg_info) + (sizeof(*dg_info->msg_payload) * dg->payload_size)
> > 
> 
> I think that's a slightly different formulation.
> 

I thought that that was what the check was looking for.  To me it seems
like an unusual way to write it, but it's not buggy and your Coccinelle
script did trigger a warning correctly...  But yeah, I was slightly
puzzled why it would be in this format.

regards,
dan carpenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ