s390/crypto: fix scatterwalk_unmap() callers in AES-GCM
Subsystems (3)
PATCH 1/1 s390/crypto: fix scatterwalk_unmap() callers in AES-GCM
The argument of scatterwalk_unmap() is supposed to be the void* that was returned by the previous scatterwalk_map() call.
The s390 AES-GCM implementation was instead passing the pointer to the struct scatter_walk.
This doesn't actually break anything because scatterwalk_unmap() only uses its argument under CONFIG_HIGHMEM and ARCH_HAS_FLUSH_ON_KUNMAP.
Note that I have not tested this patch in any way, not even compile-tested it.
---
IDK which tree this has to go through - s390 or crypto? maybe s390 is better, since they can actually test it?
arch/s390/crypto/aes_s390.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/s390/crypto/aes_s390.c +2 -2
@@ -701,7 +701,7 @@ static inline void _gcm_sg_unmap_and_advance(struct gcm_sg_walk *gw, unsigned int nbytes) { gw->walk_bytes_remain -= nbytes; -scatterwalk_unmap (&gw->walk); +scatterwalk_unmap (gw->walk_ptr);scatterwalk_advance (&gw->walk, nbytes);scatterwalk_done (&gw->walk,0 , gw->walk_bytes_remain); gw->walk_ptr =NULL ;
@@ -776,7 +776,7 @@ static int gcm_out_walk_go(struct gcm_sg_walk *gw, unsigned int minbytesneeded) goto out; } -scatterwalk_unmap (&gw->walk); +scatterwalk_unmap (gw->walk_ptr); gw->walk_ptr =NULL ; gw->ptr = gw->buf;
base-commit: 42226c989789d8da4af1de0c31070c96726d990c
Signature · 1 line
2.36.0.550.gb090851708-goog
Heiko Carstens
maintainerQuoted 11 lines · Jann Horn
The argument of
scatterwalk_unmap()is supposed to be the void* that was returned by the previousscatterwalk_map()call.
The s390 AES-GCM implementation was instead passing the pointer to the structscatter_walk.This doesn't actually break anything because
scatterwalk_unmap()only uses its argument underCONFIG_HIGHMEMandARCH_HAS_FLUSH_ON_KUNMAP.Note that I have not tested this patch in any way, not even compile-tested it.
Quoted 8 lines
Fixes bf7fa038707c ("s390/crypto: add s390 platform specific aes gcm support.")Signed-off-by Jann Horn <[email protected]>---
IDK which tree this has to go through - s390 or crypto? maybe s390 is better, since they can actually test it?arch/s390/crypto/aes_s390.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
This can go via the s390 tree, however I'd like to have an ACK from Harald, who wrote the original code.
Quoted 27 lines
arch/s390/crypto/aes_s390.c +2
-2@@ -701,7 +701,7 @@ static inline void _gcm_sg_unmap_and_advance(struct gcm_sg_walk *gw, unsigned int nbytes) { gw->walk_bytes_remain -= nbytes; -scatterwalk_unmap (&gw->walk); +scatterwalk_unmap (gw->walk_ptr);scatterwalk_advance (&gw->walk, nbytes);scatterwalk_done (&gw->walk,0 , gw->walk_bytes_remain); gw->walk_ptr =NULL ;@@ -776,7 +776,7 @@ static int gcm_out_walk_go(struct gcm_sg_walk *gw, unsigned int minbytesneeded) goto out; } -scatterwalk_unmap (&gw->walk); +scatterwalk_unmap (gw->walk_ptr); gw->walk_ptr =NULL ; gw->ptr = gw->buf;base-commit:
42226c989789d8da4af1de0c31070c96726d990cSignature · 1 line
2.36.0.550.gb090851708-goog
Harald Freudenberger
maintainerQuoted 47 lines · Heiko Carstens
Quoted 11 lines · Jann Horn
The argument of
scatterwalk_unmap()is supposed to be the void* that was returned by the previousscatterwalk_map()call.
The s390 AES-GCM implementation was instead passing the pointer to the structscatter_walk.This doesn't actually break anything because
scatterwalk_unmap()only uses its argument underCONFIG_HIGHMEMandARCH_HAS_FLUSH_ON_KUNMAP.Note that I have not tested this patch in any way, not even compile-tested it.
Quoted 8 lines
Fixes bf7fa038707c ("s390/crypto: add s390 platform specific aes gcm support.")Signed-off-by Jann Horn <[email protected]>---
IDK which tree this has to go through - s390 or crypto? maybe s390 is better, since they can actually test it?arch/s390/crypto/aes_s390.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)This can go via the s390 tree, however I'd like to have an ACK from Harald, who wrote the original code.
Quoted 23 lines
arch/s390/crypto/aes_s390.c +1
-1@@ -701,7 +701,7 @@ static inline void _gcm_sg_unmap_and_advance(struct gcm_sg_walk *gw, unsigned int nbytes) { gw->walk_bytes_remain -= nbytes; -scatterwalk_unmap (&gw->walk); +scatterwalk_unmap (gw->walk_ptr);scatterwalk_advance (&gw->walk, nbytes);scatterwalk_done (&gw->walk,0 , gw->walk_bytes_remain);arch/s390/crypto/aes_s390.c +1
-1gw->walk_ptr =NULL ;@@ -776,7 +776,7 @@ static int gcm_out_walk_go(struct gcm_sg_walk *gw, unsigned int minbytesneeded) goto out; } -scatterwalk_unmap (&gw->walk); +scatterwalk_unmap (gw->walk_ptr); gw->walk_ptr =NULL ;
Quoted 6 lines
Quoted 6 lines
gw->ptr=gw->buf;base-commit:
42226c989789d8da4af1de0c31070c96726d990c--
2.36.0.550.gb090851708-goog
Give me a chance to test this and when the testcases all pass, I'll give a green light....
Harald Freudenberger
maintainerQuoted 47 lines · Heiko Carstens
Quoted 11 lines · Jann Horn
The argument of
scatterwalk_unmap()is supposed to be the void* that was returned by the previousscatterwalk_map()call.
The s390 AES-GCM implementation was instead passing the pointer to the structscatter_walk.This doesn't actually break anything because
scatterwalk_unmap()only uses its argument underCONFIG_HIGHMEMandARCH_HAS_FLUSH_ON_KUNMAP.Note that I have not tested this patch in any way, not even compile-tested it.
Quoted 8 lines
Fixes bf7fa038707c ("s390/crypto: add s390 platform specific aes gcm support.")Signed-off-by Jann Horn <[email protected]>---
IDK which tree this has to go through - s390 or crypto? maybe s390 is better, since they can actually test it?arch/s390/crypto/aes_s390.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)This can go via the s390 tree, however I'd like to have an ACK from Harald, who wrote the original code.
Quoted 23 lines
arch/s390/crypto/aes_s390.c +1
-1@@ -701,7 +701,7 @@ static inline void _gcm_sg_unmap_and_advance(struct gcm_sg_walk *gw, unsigned int nbytes) { gw->walk_bytes_remain -= nbytes; -scatterwalk_unmap (&gw->walk); +scatterwalk_unmap (gw->walk_ptr);scatterwalk_advance (&gw->walk, nbytes);scatterwalk_done (&gw->walk,0 , gw->walk_bytes_remain);arch/s390/crypto/aes_s390.c +1
-1gw->walk_ptr =NULL ;@@ -776,7 +776,7 @@ static int gcm_out_walk_go(struct gcm_sg_walk *gw, unsigned int minbytesneeded) goto out; } -scatterwalk_unmap (&gw->walk); +scatterwalk_unmap (gw->walk_ptr); gw->walk_ptr =NULL ;
Quoted 6 lines
Quoted 6 lines
gw->ptr=gw->buf;base-commit:
42226c989789d8da4af1de0c31070c96726d990c--
2.36.0.550.gb090851708-goog
Ok, tests pass. Here is my Acked-by: Harald Freudenberger <[email protected]>
Quoted 8 lines · Jann Horn
The argument of
scatterwalk_unmap()is supposed to be the void* that was returned by the previousscatterwalk_map()call.
The s390 AES-GCM implementation was instead passing the pointer to the structscatter_walk.This doesn't actually break anything because
scatterwalk_unmap()only uses its argument underCONFIG_HIGHMEMandARCH_HAS_FLUSH_ON_KUNMAP.
Quoted 8 lines
Note that I have not tested this patch in any way, not even compile-tested it.
Fixes bf7fa038707c ("s390/crypto: add s390 platform specific aes gcm support.")Signed-off-by Jann Horn <[email protected]>---
IDK which tree this has to go through - s390 or crypto? maybe s390 is better, since they can actually test it?
Applied to s390 tree. Thanks!