* [PATCH] dm-crypt: fix endianess annotations around org_sector_of_dmreq
@ 2019-04-04 16:33 Christoph Hellwig
2019-04-17 5:22 ` Christoph Hellwig
2019-04-17 13:28 ` Bart Van Assche
0 siblings, 2 replies; 4+ messages in thread
From: Christoph Hellwig @ 2019-04-04 16:33 UTC (permalink / raw)
To: dm-devel
The sector used here is a little endian value, so use the right
type for it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/md/dm-crypt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index dd6565798778..692cddf3fe2a 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1034,11 +1034,11 @@ static u8 *org_iv_of_dmreq(struct crypt_config *cc,
return iv_of_dmreq(cc, dmreq) + cc->iv_size;
}
-static uint64_t *org_sector_of_dmreq(struct crypt_config *cc,
+static __le64 *org_sector_of_dmreq(struct crypt_config *cc,
struct dm_crypt_request *dmreq)
{
u8 *ptr = iv_of_dmreq(cc, dmreq) + cc->iv_size + cc->iv_size;
- return (uint64_t*) ptr;
+ return (__le64 *) ptr;
}
static unsigned int *org_tag_of_dmreq(struct crypt_config *cc,
@@ -1074,7 +1074,7 @@ static int crypt_convert_block_aead(struct crypt_config *cc,
struct bio_vec bv_out = bio_iter_iovec(ctx->bio_out, ctx->iter_out);
struct dm_crypt_request *dmreq;
u8 *iv, *org_iv, *tag_iv, *tag;
- uint64_t *sector;
+ __le64 *sector;
int r = 0;
BUG_ON(cc->integrity_iv_size && cc->integrity_iv_size != cc->iv_size);
@@ -1169,7 +1169,7 @@ static int crypt_convert_block_skcipher(struct crypt_config *cc,
struct scatterlist *sg_in, *sg_out;
struct dm_crypt_request *dmreq;
u8 *iv, *org_iv, *tag_iv;
- uint64_t *sector;
+ __le64 *sector;
int r = 0;
/* Reject unexpected unaligned bio. */
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] dm-crypt: fix endianess annotations around org_sector_of_dmreq
2019-04-04 16:33 [PATCH] dm-crypt: fix endianess annotations around org_sector_of_dmreq Christoph Hellwig
@ 2019-04-17 5:22 ` Christoph Hellwig
2019-04-17 13:28 ` Bart Van Assche
1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2019-04-17 5:22 UTC (permalink / raw)
To: dm-devel
ping?
On Thu, Apr 04, 2019 at 06:33:34PM +0200, Christoph Hellwig wrote:
> The sector used here is a little endian value, so use the right
> type for it.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/md/dm-crypt.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
> index dd6565798778..692cddf3fe2a 100644
> --- a/drivers/md/dm-crypt.c
> +++ b/drivers/md/dm-crypt.c
> @@ -1034,11 +1034,11 @@ static u8 *org_iv_of_dmreq(struct crypt_config *cc,
> return iv_of_dmreq(cc, dmreq) + cc->iv_size;
> }
>
> -static uint64_t *org_sector_of_dmreq(struct crypt_config *cc,
> +static __le64 *org_sector_of_dmreq(struct crypt_config *cc,
> struct dm_crypt_request *dmreq)
> {
> u8 *ptr = iv_of_dmreq(cc, dmreq) + cc->iv_size + cc->iv_size;
> - return (uint64_t*) ptr;
> + return (__le64 *) ptr;
> }
>
> static unsigned int *org_tag_of_dmreq(struct crypt_config *cc,
> @@ -1074,7 +1074,7 @@ static int crypt_convert_block_aead(struct crypt_config *cc,
> struct bio_vec bv_out = bio_iter_iovec(ctx->bio_out, ctx->iter_out);
> struct dm_crypt_request *dmreq;
> u8 *iv, *org_iv, *tag_iv, *tag;
> - uint64_t *sector;
> + __le64 *sector;
> int r = 0;
>
> BUG_ON(cc->integrity_iv_size && cc->integrity_iv_size != cc->iv_size);
> @@ -1169,7 +1169,7 @@ static int crypt_convert_block_skcipher(struct crypt_config *cc,
> struct scatterlist *sg_in, *sg_out;
> struct dm_crypt_request *dmreq;
> u8 *iv, *org_iv, *tag_iv;
> - uint64_t *sector;
> + __le64 *sector;
> int r = 0;
>
> /* Reject unexpected unaligned bio. */
> --
> 2.20.1
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
---end quoted text---
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dm-crypt: fix endianess annotations around org_sector_of_dmreq
2019-04-04 16:33 [PATCH] dm-crypt: fix endianess annotations around org_sector_of_dmreq Christoph Hellwig
2019-04-17 5:22 ` Christoph Hellwig
@ 2019-04-17 13:28 ` Bart Van Assche
2019-04-18 19:57 ` Mike Snitzer
1 sibling, 1 reply; 4+ messages in thread
From: Bart Van Assche @ 2019-04-17 13:28 UTC (permalink / raw)
To: Christoph Hellwig, dm-devel
On 4/4/19 9:33 AM, Christoph Hellwig wrote:
> The sector used here is a little endian value, so use the right
> type for it.
Hi Christoph,
You may want to fix the spelling of "endianness" in the subject. Anyway:
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: dm-crypt: fix endianess annotations around org_sector_of_dmreq
2019-04-17 13:28 ` Bart Van Assche
@ 2019-04-18 19:57 ` Mike Snitzer
0 siblings, 0 replies; 4+ messages in thread
From: Mike Snitzer @ 2019-04-18 19:57 UTC (permalink / raw)
To: Bart Van Assche; +Cc: dm-devel, Christoph Hellwig
On Wed, Apr 17 2019 at 9:28am -0400,
Bart Van Assche <bvanassche@acm.org> wrote:
> On 4/4/19 9:33 AM, Christoph Hellwig wrote:
> > The sector used here is a little endian value, so use the right
> > type for it.
>
> Hi Christoph,
>
> You may want to fix the spelling of "endianness" in the subject. Anyway:
I fixed the subject's typo and staged this for 5.2, thanks.
Mike
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-04-18 19:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04 16:33 [PATCH] dm-crypt: fix endianess annotations around org_sector_of_dmreq Christoph Hellwig
2019-04-17 5:22 ` Christoph Hellwig
2019-04-17 13:28 ` Bart Van Assche
2019-04-18 19:57 ` Mike Snitzer
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.