Skip to contentSkip to conversation

tcp: Export tcp_write_queue_purge()

PATCH In review Florian Fainelli 3 participants 6 messages Jul 30, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: Export tcp_write_queue_purge()

After tcp_write_queue_purge() got uninlined with commit ac3f09ba3e49 ("tcp: uninline tcp_write_queue_purge()"), it became no longer possible to reference this symbol from kernel modules.

Fixes ac3f09ba3e49 ("tcp: uninline tcp_write_queue_purge()")
---
 net/ipv4/tcp.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +1 -0
index 6f0caf9a866d..ea9d296a8380 100644
@@ -2626,6 +2626,7 @@ void tcp_write_queue_purge(struct sock *sk)
 	tcp_sk(sk)->packets_out = 0;
 	inet_csk(sk)->icsk_backoff = 0;
 }
+EXPORT_SYMBOL(tcp_write_queue_purge);
 
 int tcp_disconnect(struct sock *sk, int flags)
 {
Signature · 1 line
2.17.1
#1 lore raw
Quoted 24 lines · Florian Fainelli

After tcp_write_queue_purge() got uninlined with commit ac3f09ba3e49 ("tcp: uninline tcp_write_queue_purge()"), it became no longer possible to reference this symbol from kernel modules.

Fixes ac3f09ba3e49 ("tcp: uninline tcp_write_queue_purge()")
---
 net/ipv4/tcp.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +1 -1
index 6f0caf9a866d..ea9d296a8380 100644
@@ -2626,6 +2626,7 @@ void tcp_write_queue_purge(struct sock *sk)
        tcp_sk(sk)->packets_out = 0;
        inet_csk(sk)->icsk_backoff = 0;
 }
+EXPORT_SYMBOL(tcp_write_queue_purge);
 
 int tcp_disconnect(struct sock *sk, int flags)
 {
--
Quoted 2 lines

2.17.1

Hmmm.... which module would need this exactly ?

How come it took 3 years to discover this issue ?

#2 lore raw
Quoted 22 lines · Eric Dumazet
Quoted 21 lines · Florian Fainelli

After tcp_write_queue_purge() got uninlined with commit ac3f09ba3e49 ("tcp: uninline tcp_write_queue_purge()"), it became no longer possible to reference this symbol from kernel modules.

Fixes ac3f09ba3e49 ("tcp: uninline tcp_write_queue_purge()")
---
 net/ipv4/tcp.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +1 -0
index 6f0caf9a866d..ea9d296a8380 100644
@@ -2626,6 +2626,7 @@ void tcp_write_queue_purge(struct sock *sk)
        tcp_sk(sk)->packets_out = 0;
        inet_csk(sk)->icsk_backoff = 0;
 }
+EXPORT_SYMBOL(tcp_write_queue_purge);
 
Quoted 7 lines
Quoted 5 lines
net/ipv4/tcp.c +0 -1
 int tcp_disconnect(struct sock *sk, int flags)
 {
--

2.17.1

Hmmm.... which module would need this exactly ?

None in tree unfortunately, and I doubt it would be published one day. For consistency one could argue that given it used to be accessible, and other symbols within net/ipv4/tcp.c are also exported, so this should one be. Not going to hold that line of argumentation more than in this email, if you object to it, that would be completely fine with me.

Quoted 2 lines

How come it took 3 years to discover this issue ?

We just upgraded our downstream kernel from 4.9 to 5.4 and this is why it took so long.

Signature · 1 line
Florian
maintainer
#3 lore raw

From: Florian Fainelli <[email protected]>
Date: Thu, 30 Jul 2020 14:23:50 -0700

Quoted 11 lines · Eric Dumazet
Quoted 2 lines · Florian Fainelli

Hmmm.... which module would need this exactly ?

None in tree unfortunately, and I doubt it would be published one day. For consistency one could argue that given it used to be accessible, and other symbols within net/ipv4/tcp.c are also exported, so this should one be. Not going to hold that line of argumentation more than in this email, if you object to it, that would be completely fine with me.

Quoted 1 line
Quoted 4 lines
Quoted 1 line

How come it took 3 years to discover this issue ?

We just upgraded our downstream kernel from 4.9 to 5.4 and this is why it took so long.

We really can't do this, sorry.

#4 lore raw
In reply to Florian Fainelli
Quoted 32 lines · Florian Fainelli
Quoted 22 lines · Eric Dumazet
Quoted 21 lines · Florian Fainelli

After tcp_write_queue_purge() got uninlined with commit ac3f09ba3e49 ("tcp: uninline tcp_write_queue_purge()"), it became no longer possible to reference this symbol from kernel modules.

Fixes ac3f09ba3e49 ("tcp: uninline tcp_write_queue_purge()")
---
 net/ipv4/tcp.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +1 -0
index 6f0caf9a866d..ea9d296a8380 100644
@@ -2626,6 +2626,7 @@ void tcp_write_queue_purge(struct sock *sk)
        tcp_sk(sk)->packets_out = 0;
        inet_csk(sk)->icsk_backoff = 0;
 }
+EXPORT_SYMBOL(tcp_write_queue_purge);
 
Quoted 7 lines
Quoted 5 lines
net/ipv4/tcp.c +0 -1
 int tcp_disconnect(struct sock *sk, int flags)
 {
--

2.17.1

Hmmm.... which module would need this exactly ?

Quoted 5 lines

None in tree unfortunately, and I doubt it would be published one day. For consistency one could argue that given it used to be accessible, and other symbols within net/ipv4/tcp.c are also exported, so this should one be. Not going to hold that line of argumentation more than in this email, if you object to it, that would be completely fine with me.

:)

Quoted 6 lines
Quoted 3 lines

How come it took 3 years to discover this issue ?

We just upgraded our downstream kernel from 4.9 to 5.4 and this is why it took so long.

It is not because TCP used an inline function in the past that it means we have to keep
the equivalent function available for all possible out-of-tree modules.

Sorry, we can not accept that out-of-tree modules use TCP stack like that.

You will have to carry this change locally. Or even better get rid of it.

#5 lore raw
Quoted 48 lines · Eric Dumazet
Quoted 32 lines · Florian Fainelli
Quoted 22 lines · Eric Dumazet
Quoted 21 lines · Florian Fainelli

After tcp_write_queue_purge() got uninlined with commit ac3f09ba3e49 ("tcp: uninline tcp_write_queue_purge()"), it became no longer possible to reference this symbol from kernel modules.

Fixes ac3f09ba3e49 ("tcp: uninline tcp_write_queue_purge()")
---
 net/ipv4/tcp.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +1 -0
index 6f0caf9a866d..ea9d296a8380 100644
@@ -2626,6 +2626,7 @@ void tcp_write_queue_purge(struct sock *sk)
        tcp_sk(sk)->packets_out = 0;
        inet_csk(sk)->icsk_backoff = 0;
 }
+EXPORT_SYMBOL(tcp_write_queue_purge);
 
Quoted 7 lines
Quoted 5 lines
net/ipv4/tcp.c +0 -1
 int tcp_disconnect(struct sock *sk, int flags)
 {
--

2.17.1

Hmmm.... which module would need this exactly ?

Quoted 5 lines

None in tree unfortunately, and I doubt it would be published one day. For consistency one could argue that given it used to be accessible, and other symbols within net/ipv4/tcp.c are also exported, so this should one be. Not going to hold that line of argumentation more than in this email, if you object to it, that would be completely fine with me.

:)

Quoted 6 lines
Quoted 3 lines

How come it took 3 years to discover this issue ?

We just upgraded our downstream kernel from 4.9 to 5.4 and this is why it took so long.

Quoted 7 lines

It is not because TCP used an inline function in the past that it means we have to keep
the equivalent function available for all possible out-of-tree modules.

Sorry, we can not accept that out-of-tree modules use TCP stack like that.

You will have to carry this change locally. Or even better get rid of it.

Sure, that is completely fair, I had to try though :)

Signature · 1 line
Florian