Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
OpenXG-RAN
Commits
d442e21f
Commit
d442e21f
authored
1 year ago
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deep-copy PUSCH&PUCCH_ConfigCommon to prevent double-free
parent
38a6e92f
Branches unavailable
2024.w43
2024.w42
2024.w41
2024.w40
2024.w39
2024.w38
2024.w36
2024.w35
2024.w34
2024.w33
2024.w32
2024.w31
2024.w30
2024.w29
2024.w28
2024.w27
2024.w26
2024.w25
2024.w24
2024.w23
2024.w22
2024.w21
2024.w18
2024.w17
2024.w16
2024.w15
2024.w14
2024.w13
2024.w12
2024.w11
2024.w10
2024.w09
2024.w08
2024.w06
2024.w05
2024.w04
2024.w03
2024.w02
2024.w01
2023.w51
2023.w50
2023.w49
2023.w48
2023.w47
2023.w45
2023.w43
v2.1.0
ARC_1.3
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
3 deletions
+38
-3
openair2/RRC/NR/nr_rrc_config.c
openair2/RRC/NR/nr_rrc_config.c
+38
-3
No files found.
openair2/RRC/NR/nr_rrc_config.c
View file @
d442e21f
...
...
@@ -52,6 +52,40 @@ static NR_BWP_t clone_generic_parameters(const NR_BWP_t *gp)
return
clone
;
}
static
NR_SetupRelease_PUSCH_ConfigCommon_t
*
clone_pusch_configcommon
(
const
NR_SetupRelease_PUSCH_ConfigCommon_t
*
pcc
)
{
if
(
pcc
==
NULL
||
pcc
->
present
==
NR_SetupRelease_PUSCH_ConfigCommon_PR_NOTHING
)
return
NULL
;
NR_SetupRelease_PUSCH_ConfigCommon_t
*
clone
=
calloc_or_fail
(
1
,
sizeof
(
*
clone
));
clone
->
present
=
pcc
->
present
;
if
(
clone
->
present
==
NR_SetupRelease_PUSCH_ConfigCommon_PR_release
)
return
clone
;
uint8_t
buf
[
1024
];
asn_enc_rval_t
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_PUSCH_ConfigCommon
,
NULL
,
pcc
->
choice
.
setup
,
buf
,
sizeof
(
buf
));
AssertFatal
(
enc_rval
.
encoded
>
0
&&
enc_rval
.
encoded
<
sizeof
(
buf
),
"could not clone NR_PUSCH_ConfigCommon: problem while encoding
\n
"
);
asn_dec_rval_t
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_NR_PUSCH_ConfigCommon
,
(
void
**
)
&
clone
->
choice
.
setup
,
buf
,
enc_rval
.
encoded
,
0
,
0
);
AssertFatal
(
dec_rval
.
code
==
RC_OK
&&
dec_rval
.
consumed
==
enc_rval
.
encoded
,
"could not clone NR_PUSCH_ConfigCommon: problem while decoding
\n
"
);
return
clone
;
}
static
NR_SetupRelease_PUCCH_ConfigCommon_t
*
clone_pucch_configcommon
(
const
NR_SetupRelease_PUCCH_ConfigCommon_t
*
pcc
)
{
if
(
pcc
==
NULL
||
pcc
->
present
==
NR_SetupRelease_PUCCH_ConfigCommon_PR_NOTHING
)
return
NULL
;
NR_SetupRelease_PUCCH_ConfigCommon_t
*
clone
=
calloc_or_fail
(
1
,
sizeof
(
*
clone
));
clone
->
present
=
pcc
->
present
;
if
(
clone
->
present
==
NR_SetupRelease_PUCCH_ConfigCommon_PR_release
)
return
clone
;
uint8_t
buf
[
1024
];
asn_enc_rval_t
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_PUCCH_ConfigCommon
,
NULL
,
pcc
->
choice
.
setup
,
buf
,
sizeof
(
buf
));
AssertFatal
(
enc_rval
.
encoded
>
0
&&
enc_rval
.
encoded
<
sizeof
(
buf
),
"could not clone NR_PUCCH_ConfigCommon: problem while encoding
\n
"
);
asn_dec_rval_t
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_NR_PUCCH_ConfigCommon
,
(
void
**
)
&
clone
->
choice
.
setup
,
buf
,
enc_rval
.
encoded
,
0
,
0
);
AssertFatal
(
dec_rval
.
code
==
RC_OK
&&
dec_rval
.
consumed
==
enc_rval
.
encoded
,
"could not clone NR_PUCCH_ConfigCommon: problem while decoding
\n
"
);
return
clone
;
}
static
NR_SearchSpace_t
*
rrc_searchspace_config
(
bool
is_common
,
int
searchspaceid
,
int
coresetid
)
{
...
...
@@ -1284,7 +1318,7 @@ static void config_uplinkBWP(NR_BWP_Uplink_t *ubwp,
int
curr_bwp
=
NRRIV2BW
(
ubwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
ubwp
->
bwp_Common
->
rach_ConfigCommon
=
is_SA
?
NULL
:
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
rach_ConfigCommon
;
ubwp
->
bwp_Common
->
pusch_ConfigCommon
=
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
pusch_ConfigCommon
;
ubwp
->
bwp_Common
->
pusch_ConfigCommon
=
clone_pusch_configcommon
(
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
pusch_ConfigCommon
)
;
ubwp
->
bwp_Common
->
pucch_ConfigCommon
=
CALLOC
(
1
,
sizeof
(
struct
NR_SetupRelease_PUCCH_ConfigCommon
));
ubwp
->
bwp_Common
->
pucch_ConfigCommon
->
present
=
NR_SetupRelease_PUCCH_ConfigCommon_PR_setup
;
ubwp
->
bwp_Common
->
pucch_ConfigCommon
->
choice
.
setup
=
CALLOC
(
1
,
sizeof
(
struct
NR_PUCCH_ConfigCommon
));
...
...
@@ -1910,10 +1944,11 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const NR_ServingCellConfigCommon_t *scc, c
UL
->
initialUplinkBWP
.
genericParameters
=
clone_generic_parameters
(
&
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
genericParameters
);
UL
->
initialUplinkBWP
.
rach_ConfigCommon
=
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
rach_ConfigCommon
;
UL
->
initialUplinkBWP
.
pusch_ConfigCommon
=
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
pusch_ConfigCommon
;
UL
->
initialUplinkBWP
.
pusch_ConfigCommon
=
clone_pusch_configcommon
(
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
pusch_ConfigCommon
);
free
(
UL
->
initialUplinkBWP
.
pusch_ConfigCommon
->
choice
.
setup
->
groupHoppingEnabledTransformPrecoding
);
UL
->
initialUplinkBWP
.
pusch_ConfigCommon
->
choice
.
setup
->
groupHoppingEnabledTransformPrecoding
=
NULL
;
UL
->
initialUplinkBWP
.
pucch_ConfigCommon
=
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
pucch_ConfigCommon
;
UL
->
initialUplinkBWP
.
pucch_ConfigCommon
=
clone_pucch_configcommon
(
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
pucch_ConfigCommon
)
;
UL
->
timeAlignmentTimerCommon
=
NR_TimeAlignmentTimer_infinity
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment