All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Kernel-janitors]  [patch 2.6.1] audit *_user, get rid of
@ 2004-01-16 22:10 Randy.Dunlap
  2004-01-16 22:28 ` [Kernel-janitors] [patch 2.6.1] audit *_user, Domen Puncer
  0 siblings, 1 reply; 2+ messages in thread
From: Randy.Dunlap @ 2004-01-16 22:10 UTC (permalink / raw)
  To: kernel-janitors

On Fri, 16 Jan 2004 22:45:32 +0100 Domen Puncer <domen@coderock.org> wrote:

| Hi.
| 
| To be aplied on top of CONFIG_LEDMAN patch, or you'll get -11 lines offsets.
| 
| I left one copy_*_user, because locking needs to be fixed around it too.
| About that s/break/return/ in switch: at end of switch there is a "return 0".
| Didn't compile test it, since it's a motorola driver.
| 
| 
| 	Domen
| 
| --- c/drivers/serial/mcfserial.c	2004-01-16 22:28:31.000000000 +0100
| +++ a/drivers/serial/mcfserial.c	2004-01-16 22:40:44.000000000 +0100
|  		case TIOCSERGSTRUCT:
| -			error = verify_area(VERIFY_WRITE, (void *) arg,
| -						sizeof(struct mcf_serial));
| -			if (error)
| -				return error;
| -			copy_to_user((struct mcf_serial *) arg,
| -				    info, sizeof(struct mcf_serial));
| -			return 0;
| +			if (copy_to_user((struct mcf_serial *) arg,
| +				    info, sizeof(struct mcf_serial)))
| +			return -EFAULT;

what if copy_to_user() above returns 0?
is it supposed to fall through?

rest of it looks fine.
Please fix & resend (unless it's correct as is)

|  		case TIOCMGET:
| -			if ((error = verify_area(VERIFY_WRITE, (void *) arg,
| -                            sizeof(unsigned int))))
| -                                return(error);
|  			val = mcfrs_getsignals(info);
| -			put_user(val, (unsigned int *) arg);
| -			break;
| +			return put_user(val, (unsigned int *) arg);
|  


--
~Randy
Everything is relative.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2004-01-16 22:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-16 22:10 [Kernel-janitors] [patch 2.6.1] audit *_user, get rid of Randy.Dunlap
2004-01-16 22:28 ` [Kernel-janitors] [patch 2.6.1] audit *_user, Domen Puncer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.