Skip to content

Commit 316b090

Browse files
Eric Biggersgregkh
authored andcommitted
crypto: af_alg - Fix incorrect boolean values in af_alg_ctx
commit d0ca0df upstream. Commit 1b34cbb ("crypto: af_alg - Disallow concurrent writes in af_alg_sendmsg") changed some fields from bool to 1-bit bitfields of type u32. However, some assignments to these fields, specifically 'more' and 'merge', assign values greater than 1. These relied on C's implicit conversion to bool, such that zero becomes false and nonzero becomes true. With a 1-bit bitfields of type u32 instead, mod 2 of the value is taken instead, resulting in 0 being assigned in some cases when 1 was intended. Fix this by restoring the bool type. Fixes: 1b34cbb ("crypto: af_alg - Disallow concurrent writes in af_alg_sendmsg") Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 494ebb7 commit 316b090

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/crypto/if_alg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ struct af_alg_ctx {
152152
size_t used;
153153
atomic_t rcvused;
154154

155-
u32 more:1,
155+
bool more:1,
156156
merge:1,
157157
enc:1,
158158
write:1,

0 commit comments

Comments
 (0)