mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Question on verify_area() and friends wrt
@ 2003-05-25 11:46 Paulo Andre'
  2003-05-25 12:07 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Paulo Andre' @ 2003-05-25 11:46 UTC (permalink / raw)
  To: kernel-janitor-discuss; +Cc: linux-kernel

Hi,

I've been taking care of auditing some return values for instances of
unchecked copy_*_user calls and I've come across one case that's
marked as a bug at kbugs.org which however doesn't seem like one to me.
The piece of code I'm referring can be found in
net/bluetooth/hci_core.c:436

if (!verify_area(VERIFY_WRITE, ptr, sizeof(ir) +
		(sizeof(struct inquiry_info) * ir.num_rsp))) {
    copy_to_user(ptr, &ir, sizeof(ir));
    ptr += sizeof(ir);
    copy_to_user(ptr, buf, sizeof(struct inquiry_info) * ir.num_rsp);	} else
    err = -EFAULT;

I'm presuming verify_area() does its job fine returning 0 if the memory
is valid and -EFAULT if not. Thus, given the exact check that's been
done, there seems indeed to exist no need to check each call to
copy_to_user() below. Or is there?

Thanks in advance,


		Paulo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-05-25 15:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-25 11:46 Question on verify_area() and friends wrt Paulo Andre'
2003-05-25 12:07 ` Christoph Hellwig
2003-05-25 13:53   ` Paulo Andre'
2003-05-24 22:46     ` dan carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®