mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 14:48:57 +00:00
in6_pcb.c:
Remove a bogus (redundant, just weird, etc.) key_freeso(so). There are no consumers of it now, nor does it seem there ever will be. in6?_pcb.c: Add an if (inp->in6?p_sp != NULL) before the call to ipsec[46]_delete_pcbpolicy(inp). In low-memory conditions this can cause a crash because in6?_sp can be NULL...
This commit is contained in:
parent
ec29d1783a
commit
333aa64d05
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=58452
@ -527,7 +527,8 @@ in_pcbdetach(inp)
|
|||||||
struct inpcbinfo *ipi = inp->inp_pcbinfo;
|
struct inpcbinfo *ipi = inp->inp_pcbinfo;
|
||||||
|
|
||||||
#ifdef IPSEC
|
#ifdef IPSEC
|
||||||
ipsec4_delete_pcbpolicy(inp);
|
if (inp->inp_sp != NULL)
|
||||||
|
ipsec4_delete_pcbpolicy(inp);
|
||||||
#endif /*IPSEC*/
|
#endif /*IPSEC*/
|
||||||
inp->inp_gencnt = ++ipi->ipi_gencnt;
|
inp->inp_gencnt = ++ipi->ipi_gencnt;
|
||||||
in_pcbremlists(inp);
|
in_pcbremlists(inp);
|
||||||
|
@ -719,9 +719,8 @@ in6_pcbdetach(inp)
|
|||||||
struct inpcbinfo *ipi = inp->inp_pcbinfo;
|
struct inpcbinfo *ipi = inp->inp_pcbinfo;
|
||||||
|
|
||||||
#ifdef IPSEC
|
#ifdef IPSEC
|
||||||
if (sotoinpcb(so) != 0)
|
if (inp->in6p_sp != NULL)
|
||||||
key_freeso(so);
|
ipsec6_delete_pcbpolicy(inp);
|
||||||
ipsec6_delete_pcbpolicy(inp);
|
|
||||||
#endif /* IPSEC */
|
#endif /* IPSEC */
|
||||||
inp->inp_gencnt = ++ipi->ipi_gencnt;
|
inp->inp_gencnt = ++ipi->ipi_gencnt;
|
||||||
in_pcbremlists(inp);
|
in_pcbremlists(inp);
|
||||||
|
Loading…
Reference in New Issue
Block a user