mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Herrmann <dh.herrmann@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Daniel Mack <daniel@zonque.org>,
	Djalal Harouni <tixxdz@opendz.org>,
	David Herrmann <dh.herrmann@gmail.com>
Subject: [PATCH] kdbus: fix sparse address-space annotation
Date: Fri, 24 Jul 2015 12:57:20 +0200	[thread overview]
Message-ID: <1437735440-8160-1-git-send-email-dh.herrmann@gmail.com> (raw)

Make sure to properly annotate casts in 'struct iovec' if we cross
address-spaces, to make sure sparse does not warn about them.

All those conversions are fine, as we are allowed to pass those kvecs
through the iovec importer.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
---
 ipc/kdbus/message.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipc/kdbus/message.c b/ipc/kdbus/message.c
index 3520f45..27a5021 100644
--- a/ipc/kdbus/message.c
+++ b/ipc/kdbus/message.c
@@ -920,7 +920,7 @@ struct kdbus_pool_slice *kdbus_staging_emit(struct kdbus_staging *staging,
 
 	/* msg.size */
 	v->iov_len = sizeof(msg_size);
-	v->iov_base = &msg_size;
+	v->iov_base = (void __user *)&msg_size;
 	++v;
 
 	/* msg (after msg.size) plus items */
@@ -937,7 +937,7 @@ struct kdbus_pool_slice *kdbus_staging_emit(struct kdbus_staging *staging,
 	if (meta_size > 0) {
 		/* metadata items */
 		v->iov_len = meta_size;
-		v->iov_base = meta_items;
+		v->iov_base = (void __user *)meta_items;
 		++v;
 
 		/* padding after metadata */
-- 
2.4.6


                 reply	other threads:[~2015-07-24 11:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437735440-8160-1-git-send-email-dh.herrmann@gmail.com \
    --to=dh.herrmann@gmail.com \
    --cc=daniel@zonque.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tixxdz@opendz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®