summaryrefslogtreecommitdiffstats
path: root/include/net/ax25.h
diff options
context:
space:
mode:
authorRalf Baechle DL5RB <ralf@linux-mips.org>2006-03-19 22:20:06 +0100
committerDavid S. Miller <davem@davemloft.net>2006-03-19 22:20:06 +0100
commitc7c694d196a39af6e644e24279953d04f30362db (patch)
treecb78fead47ce86245179fe0a52119c70b30b59cb /include/net/ax25.h
parent[PATCH] Kconfig: swap VIDEO_CX88_ALSA and VIDEO_CX88_DVB (diff)
downloadlinux-c7c694d196a39af6e644e24279953d04f30362db.tar.xz
linux-c7c694d196a39af6e644e24279953d04f30362db.zip
[AX.25]: Fix potencial memory hole.
If the AX.25 dialect chosen by the sysadmin is set to DAMA master / 3 (or DAMA slave / 2, if CONFIG_AX25_DAMA_SLAVE=n) ax25_kick() will fall through the switch statement without calling ax25_send_iframe() or any other function that would eventually free skbn thus leaking the packet. Fix by restricting the sysctl inferface to allow only actually supported AX.25 dialects. The system administration mistake needed for this to happen is rather unlikely, so this is an uncritical hole. Coverity #651. Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ax25.h')
-rw-r--r--include/net/ax25.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 2250a18b0cbb..d052b221dbcd 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -110,8 +110,15 @@ enum {
enum {
AX25_PROTO_STD_SIMPLEX,
AX25_PROTO_STD_DUPLEX,
+#ifdef CONFIG_AX25_DAMA_SLAVE
AX25_PROTO_DAMA_SLAVE,
- AX25_PROTO_DAMA_MASTER
+#ifdef CONFIG_AX25_DAMA_MASTER
+ AX25_PROTO_DAMA_MASTER,
+#define AX25_PROTO_MAX AX25_PROTO_DAMA_MASTER
+#endif
+#endif
+ __AX25_PROTO_MAX,
+ AX25_PROTO_MAX = __AX25_PROTO_MAX -1
};
enum {