Linux Device Mapper development
 help / color / mirror / Atom feed
* [PATCH] Fix using of possible uninitialised params struct (secure flag)
@ 2011-03-08 19:35 Milan Broz
  2011-03-09 16:51 ` [PATCH] Wipe buffer even if vamlloc fails Milan Broz
  0 siblings, 1 reply; 2+ messages in thread
From: Milan Broz @ 2011-03-08 19:35 UTC (permalink / raw)
  To: dm-devel; +Cc: Milan Broz

If copy_param() fails, we cannot trust param structure,
so access it only if this call returned success.

Bug introduced in patch adding secure flag to dm-ioctl (currently in linux-next).

Found during regression tests.

Signed-off-by: Milan Broz <mbroz@redhat.com>
---
 drivers/md/dm-ioctl.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index e7af88b..516def2 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1611,14 +1611,15 @@ static int ctl_ioctl(uint command, struct dm_ioctl __user *user)
 	 * Copy the parameters into kernel space.
 	 */
 	r = copy_params(user, &param);
-	input_param_size = param->data_size;
-	wipe_buffer = param->flags & DM_SECURE_DATA_FLAG;
 
 	current->flags &= ~PF_MEMALLOC;
 
 	if (r)
 		return r;
 
+	input_param_size = param->data_size;
+	wipe_buffer = param->flags & DM_SECURE_DATA_FLAG;
+
 	r = validate_params(cmd, param);
 	if (r)
 		goto out;
-- 
1.7.2.3

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

end of thread, other threads:[~2011-03-09 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-08 19:35 [PATCH] Fix using of possible uninitialised params struct (secure flag) Milan Broz
2011-03-09 16:51 ` [PATCH] Wipe buffer even if vamlloc fails Milan Broz

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