Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG_ON in the tempesta/tls/bignum.c:294! #1892

Closed
EvgeniiMekhanik opened this issue Jun 1, 2023 · 2 comments
Closed

BUG_ON in the tempesta/tls/bignum.c:294! #1892

EvgeniiMekhanik opened this issue Jun 1, 2023 · 2 comments
Assignees
Labels
bug TLS Tempesta TLS module and related issues
Milestone

Comments

@EvgeniiMekhanik
Copy link
Contributor

kernel BUG at /home/evgeny/workdir/tempesta/tls/bignum.c:294!
[ 1951.002597] invalid opcode: 0000 [#1] SMP NOPTI
[ 1951.002889] CPU: 3 PID: 13906 Comm: wrk Tainted: G OE 5.10.35+ #230
[ 1951.003365] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
[ 1951.003370] RIP: 0010:ttls_mpi_shift_l+0xfc/0x170 [tempesta_tls]
[ 1951.003372] Code: 5b 41 5c 41 5d 41 5e 41 5f 5d c3 0f 0b 48 83 c4 08 5b 41 5c 41 5d 41 5e 41 5f 5d c3 48 39 fe 74 db 31 d2 e8 66 fa ff ff eb d2 <0f> 0b 48 c7 c7 60 92 91 c0 e8 91 9e 64 da 49 c1 e1 03 4b 8d 1c 0e
[ 1951.005968] RSP: 0018:ffffa9dbc01603d8 EFLAGS: 00010283
[ 1951.006731] RAX: 0000000000000800 RBX: ffffa9dbc0160590 RCX: 0000000000000022
[ 1951.007185] RDX: 0000000000000042 RSI: ffff917f9c172058 RDI: ffff917f9c172058
[ 1951.007969] RBP: ffffa9dbc0160408 R08: 00000000000006d8 R09: 0000000000000020
[ 1951.007970] R10: 0000000000000002 R11: 751023a164ca1480 R12: 0000000000000021
[ 1951.007970] R13: 0000000000000000 R14: 00000000000006d8 R15: ffff917f9c172058
[ 1951.007971] FS: 00007f4e26897640(0000) GS:ffff918077cc0000(0000) knlGS:0000000000000000
[ 1951.007972] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1951.007972] CR2: 00007f618b453100 CR3: 0000000134e02005 CR4: 0000000000770ee0
[ 1951.007974] PKRU: 55555554
[ 1951.007975] Call Trace:
[ 1951.007976]
[ 1951.007980] ? ttls_mpi_pool_alloc_mpi+0x22/0x30 [tempesta_tls]
[ 1951.007983] ttls_mpi_exp_mod+0x7b5/0x9d0 [tempesta_tls]
[ 1951.007985] ? bzero_fast+0xe/0x10 [tempesta_lib]
[ 1951.007987] ? ttls_mpi_copy_alloc+0x82/0xd0 [tempesta_tls]
[ 1951.007989] ? ttls_mpi_mul_mpi+0xdb/0x360 [tempesta_tls]
[ 1951.007991] ? ttls_mpi_sub_abs+0xf7/0x120 [tempesta_tls]
[ 1951.007992] ? bzero_fast+0xe/0x10 [tempesta_lib]
[ 1951.007994] ? ttls_mpi_div_mpi+0x5e5/0x970 [tempesta_tls]
[ 1951.007996] ? ttls_mpi_add_abs+0x82/0xd0 [tempesta_tls]
[ 1951.007999] ttls_rsa_private+0x3c1/0x540 [tempesta_tls]
[ 1951.008002] ttls_rsa_pkcs1_sign+0x94/0x140 [tempesta_tls]
[ 1951.010482] rsa_sign_wrap+0x4a/0x70 [tempesta_tls]
[ 1951.012935] ttls_pk_sign+0x65/0xb0 [tempesta_tls]

@EvgeniiMekhanik
Copy link
Contributor Author

This bug can be reproduced same as described in the #1779

@krizhanovsky krizhanovsky added bug TLS Tempesta TLS module and related issues labels Jun 2, 2023
@krizhanovsky krizhanovsky added this to the 0.8 - Beta milestone Jun 2, 2023
EvgeniiMekhanik added a commit that referenced this issue Jun 7, 2023
We should initialize `ctx->RP` and `ctx->RQ`
when we initialize rsa context not during key
signition, because key signition can be called
on different CPUs for one ctx, which lead to race.

Closes #1779, #1892
EvgeniiMekhanik added a commit that referenced this issue Jun 7, 2023
We should initialize `ctx->RP` and `ctx->RQ`
when we initialize rsa context not during key
signition, because key signition can be called
on different CPUs for one ctx, which lead to race.

Closes #1779, #1892
EvgeniiMekhanik added a commit that referenced this issue Jun 15, 2023
We should initialize `ctx->RP` and `ctx->RQ`
when we initialize rsa context not during key
signition, because key signition can be called
on different CPUs for one ctx, which lead to race.

Closes #1779, #1892
EvgeniiMekhanik added a commit that referenced this issue Jun 16, 2023
We should initialize `ctx->RP` and `ctx->RQ`
when we initialize rsa context not during key
signition, because key signition can be called
on different CPUs for one ctx, which lead to race.

Closes #1779, #1892
EvgeniiMekhanik added a commit that referenced this issue Jun 19, 2023
We should initialize `ctx->RP` and `ctx->RQ`
when we initialize rsa context not during key
signition, because key signition can be called
on different CPUs for one ctx, which lead to race.

Closes #1779, #1892
EvgeniiMekhanik added a commit that referenced this issue Jun 21, 2023
We should initialize `ctx->RP` and `ctx->RQ`
when we initialize rsa context not during key
signition, because key signition can be called
on different CPUs for one ctx, which lead to race.

Closes #1779, #1892
@EvgeniiMekhanik
Copy link
Contributor Author

Closed by PR1896

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug TLS Tempesta TLS module and related issues
Projects
None yet
Development

No branches or pull requests

2 participants