[doc] backup-redmine/2018-08-24, backup-redmine/2019-09-14, master: doc: open-mesh/Emulation_Debug: fix support for linux 4.15-rc8 (a159354)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2018-08-24,backup-redmine/2019-09-14,master
>---------------------------------------------------------------
commit a1593542f367e00ef89095cb54dcd0cc0c115b60
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Fri Jan 19 10:20:12 2018 +0000
doc: open-mesh/Emulation_Debug: fix support for linux 4.15-rc8
>---------------------------------------------------------------
a1593542f367e00ef89095cb54dcd0cc0c115b60
open-mesh/Emulation_Debug.textile | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/open-mesh/Emulation_Debug.textile b/open-mesh/Emulation_Debug.textile
index 9330094..bc6605a 100644
--- a/open-mesh/Emulation_Debug.textile
+++ b/open-mesh/Emulation_Debug.textile
@@ -65,18 +65,31 @@ CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_64BIT=y
CONFIG_X86_VSYSCALL_EMULATION=n
CONFIG_IA32_EMULATION=n
+CONFIG_VOP_BUS=y
+CONFIG_VOP=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_NET_9P_VIRTIO=y
+CONFIG_VIRTIO_MENU=y
CONFIG_SCSI_VIRTIO=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_VIRTIO_INPUT=y
-CONFIG_VIRTIO_MMIO=y
-CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_PCI_LEGACY=y
+CONFIG_VIRTIO_BALLOON=y
+CONFIG_VIRTIO_BLK_SCSI=y
+CONFIG_VIRTIO_INPUT=y
+CONFIG_VIRTIO_MMIO=y
+CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
+CONFIG_RPMSG_VIRTIO=y
+CONFIG_VSOCKETS=y
+CONFIG_VIRTIO_VSOCKETS=y
+CONFIG_DRM=y
+CONFIG_DRM_VIRTIO_GPU=y
+CONFIG_CAIF=y
+CONFIG_CAIF_VIRTIO=y
CONFIG_CRC16=y
CONFIG_LIBCRC32C=y
CONFIG_CRYPTO_SHA512=y
@@ -197,6 +210,8 @@ CONFIG_DEBUG_WQ_FORCE_RR_CPU=y
CONFIG_OPTIMIZE_INLINING=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_DEBUG_SECTION_MISMATCH=y
+CONFIG_UNWINDER_ORC=y
EOF
# for GCC 5+
@@ -205,6 +220,7 @@ CONFIG_KASAN=y
CONFIG_KASAN_INLINE=y
CONFIG_UBSAN_SANITIZE_ALL=y
CONFIG_UBSAN=y
+CONFIG_UBSAN_NULL=y
EOF
make olddefconfig
2 years, 9 months
[doc] backup-redmine/2018-08-24, backup-redmine/2019-09-14, master: doc: open-mesh/News-draft: stub for 2018.0 (7a2f2e7)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2018-08-24,backup-redmine/2019-09-14,master
>---------------------------------------------------------------
commit 7a2f2e700481d459928abafcb0d0f7f87d460a36
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Tue Dec 26 13:46:24 2017 +0000
doc: open-mesh/News-draft: stub for 2018.0
>---------------------------------------------------------------
7a2f2e700481d459928abafcb0d0f7f87d460a36
open-mesh/News-draft.textile | 169 +++++++++++++++++++++++++++++++++++++------
1 file changed, 148 insertions(+), 21 deletions(-)
diff --git a/open-mesh/News-draft.textile b/open-mesh/News-draft.textile
index 509f3f4..801f7ec 100644
--- a/open-mesh/News-draft.textile
+++ b/open-mesh/News-draft.textile
@@ -1,52 +1,179 @@
-h1. DRAFT: Batman-adv 2017.4 released
+h1. DRAFT: Batman-adv 2018.0 released
-Dec 05th, 2017. Today the B.A.T.M.A.N. team publishes the December 2017 update to batman-adv, batctl and alfred! This release contains mostly bugfixes, code cleanups and documentation updates.
+Jan 30th, 2018. Today the B.A.T.M.A.N. team publishes the January 2018 update to batman-adv, batctl and alfred! This release *TODO*
+
+This release doesn't contain the flow dissector support for batman-adv unicast packets. We highly recommend to apply the "flow dissector patchset":https://patchwork.open-mesh.org/cover/17240/ on the target system's kernel.
As the kernel module always depends on the Linux kernel it is compiled against, it does not make sense to provide binaries on our website. As usual, you will find the signed tarballs in our download section:
-https://downloads.open-mesh.org/batman/releases/batman-adv-2017.4/
+https://downloads.open-mesh.org/batman/releases/batman-adv-2018.0/
h2. Thanks
Thanks to all people sending in patches:
-* David Ahern <dsahern(a)gmail.com>
-* Gao Feng <gfree.wind(a)vip.163.com>
-* Kees Cook <keescook(a)chromium.org>
-* Simon Wunderlich <sw(a)simonwunderlich.de
+* Denys Vlasenko <dvlasenk(a)redhat.com>
+* Simon Wunderlich <sw(a)simonwunderlich.de>
* Sven Eckelmann <sven(a)narfation.org>
h2. batman-adv
-* support latest kernels (3.2 - 4.15)
+<pre>
+$ git describe origin/master
+v2017.4-30-g47777a90
+$ git shortlog --email --no-merges v2017.4..v2017.4-30-g47777a90
+
+new kernel support
+==================
+
+
+
+bugfixes
+========
+
+
+coding style cleanup/refactoring
+================================
+
+ batman-adv: Deinline batadv_orig_hash_find, save 7339 bytes
+ batman-adv: Let packet.h include its headers directly
+ batman-adv: Remove usage of BIT(x) in packet.h
+ batman-adv: Remove kernel fixed width types in packet.h
+ batman-adv: Convert packet.h to uapi header
+ batman-adv: include gfp.h for GFP_* defines
+ batman-adv: include build_bug.h for BUILD_BUG_ON define
+ batman-adv: Include net.h for net_ratelimited_function
+ batman-adv: include kobject.h for kobject_* functions
+ batman-adv: Remove unused sched.h include
+ batman-adv: compat: Map to linux/nl80211.h for Linux < 3.7
+ batman-adv: Add missing kernel-doc to packet.h
+ batman-adv: Use parentheses in function kernel-doc
+ batman-adv: Use inline kernel-doc for enum/struct
+ batman-adv: Fix kernel-doc references to struct members
+ batman-adv: Add kernel-doc to structs in headers
+ batman-adv: Add kernel-doc to enums in headers
+ batman-adv: Add kernel-doc to functions in headers
+ batman-adv: Add kernel-doc to externally visible functions
+
+license stuff
+=============
+
+ batman-adv: Add GPL-2.0 as Linux's LICENSES/preferred/GPL-2.0
+ batman-adv: Add SPDX license identifier above copyright header
+ batman-adv: Add SPDX license identifier to batman-adv.rst
+ batman-adv: Add license header to Kconfig
+ batman-adv: Add license headers to compat files
+ batman-adv: Mark remaining files as GPL-2.0
+ batman-adv: Change batman_adv.h license to MIT
+ batman-adv: Import Linux's LICENSES/preferred/MIT
+
+
+
+
+2018.0 (2018-01-30)
+===================
+
+* support latest kernels (3.2 - 4.16)
* coding style cleanups and refactoring
-* documentation cleanup
* bugs squashed:
- * avoid spurious warnings from bat_v neigh_cmp implementation
- * fix check of gateway availability in B.A.T.M.A.N. V
- * fix locking for bidirectional TQ check counters
- * remove leak of stack bits in fragmentation header priority
+ -
+
+
+</pre>
h2. batctl
-* synchronization of batman-adv netlink header
+<pre>
+$ git describe origin/master
+v2017.4-14-ga9ad05d
+$ git shortlog --email --no-merges v2017.4..v2017.4-14-ga9ad05d
+
+bugfixes
+========
+
+
+coding style cleanup/refactoring
+================================
+
+ batctl: Let packet.h include its headers directly
+ batctl: Remove usage of BIT(x) in packet.h
+ batctl: Remove kernel fixed width types in packet.h
+ batctl: Convert packet.h to uapi header
+ batctl: Add missing kernel-doc to packet.h
+ batctl: Remove unused __packed compat macro
+
+license stuff
+=============
+
+ batctl: Add GPL-2.0 as Linux's LICENSES/preferred/GPL-2.0
+ batctl: Add License-Filename to GPL-2.0 files
+ batctl: Import Linux's LICENSES/preferred/MIT
+ batctl: Add SPDX license identifier above copyright header
+ batctl: Mark remaining files as GPL-2.0
+ batctl: Change batman_adv.h license to MIT
+ batctl: Remove License-Filename from packet.h
+
+
+
+
+2018.0 (2018-01-30)
+===================
+
+* synchronization of batman-adv netlink and packet headers
* coding style cleanups and refactoring
-* documentation cleanup
* bugs squashed:
- * improve error handling for libnl related errors
- * add checks for various allocation errors
+ -
+</pre>
h2. alfred
-* synchronization of batman-adv netlink header
+<pre>
+$ git describe origin/master
+v2017.4-7-g04d42f0
+$ git shortlog --email --no-merges v2017.4..v2017.4-7-g04d42f0
+
+
+
+Sven Eckelmann <sven(a)narfation.org> (6):
+
+
+bugs
+====
+
+
+
+coding style cleanup/refactoring
+================================
+
+license stuff
+=============
+
+ alfred: Rename LICENSE to Linux's LICENSES/preferred/GPL-2.0
+ alfred: Add License-Filename to GPL-2.0 files
+ alfred: Import Linux's LICENSES/preferred/MIT
+ alfred: Add SPDX license identifier above copyright header
+ alfred: Change batman_adv.h license to MIT
+ alfred: Mark remaining files as GPL-2.0
+
+documentation updates
+=====================
+
+
+
+
+
+
+2018.0 (2018-01-30)
+===================
+
+* synchronization of batman-adv netlink and packet headers
* coding style cleanups and refactoring
-* documentation cleanup
* bugs squashed:
- * only query debugfs when netlink failed
- * handle allocation errors in hashtable iterator
+ -
+</pre>
Happy routing,
2 years, 9 months
[linux-merge]linux integration; annotated tag, v5.3-rc8, created. v5.3-rc8
by postmaster@open-mesh.org
The annotated tag, v5.3-rc8 has been created
at ed9a681803ae0aac98b7932541dde8f17e3da543 (tag)
tagging f74c2bb98776e2de508f4d607cd519873065118e (commit)
replaces v5.3-rc7
tagged by Linus Torvalds
on Sun Sep 8 13:33:22 2019 -0700
- Shortlog ------------------------------------------------------------
Linux 5.3-rc8
-----BEGIN PGP SIGNATURE-----
iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAl11ZZIeHHRvcnZhbGRz
QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGUEYH/3dOHJ00BhSQNL39
KSk1cuVq0UHIGcdOK+qp+3YLzaO6rpKJ7HYuQQ4ddLJwZ8wWGUZ03eDkp689axkb
XMMhcbuaQ5AZT017UPPU/9ECqJtKmLHZEm3y4cU2ybFhI76eDD4S07xfC/L5h/xc
aWyRRPBQhjZHIdCejg9eSJNMQJycW7l7npMEBeE9qDRmCWxZUHten2jBcL0XpXPw
BJ0T7XKFHsbh/RP7K/7GHFxVZXPO8rl8pIlRaX+3bKqgUV721LwR+gyHbFYYntlC
7tfL4KcG9lQvCoUuh1cMtnZuMzc88TGdI5xb7Y1Gq6HtR7LTLLrfpp3nwqst912u
xq8iHpw=
=WnfD
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
2 years, 9 months
[linux-merge]linux integration; annotated tag, v5.3-rc7, created. v5.3-rc7
by postmaster@open-mesh.org
The annotated tag, v5.3-rc7 has been created
at 980d0783eab87f4dea7f03737641ead5121ec738 (tag)
tagging 089cf7f6ecb266b6a4164919a2e69bd2f938374a (commit)
replaces v5.3-rc6
tagged by Linus Torvalds
on Mon Sep 2 09:57:50 2019 -0700
- Shortlog ------------------------------------------------------------
Linux 5.3-rc7
-----BEGIN PGP SIGNATURE-----
iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAl1tSg4eHHRvcnZhbGRz
QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiG018IAJGV7SbXggW/iC+e
cSMlo8kPnuU7dKCUW+ngXnZY1xuDYWPhXMX9+yDYf2NfMYGdDGYZ+GRjSFim816w
HsNsovnYiyxhkh+wA/DmZPWKdTgYrIxbPRO+MlO5ZfbxWNaLgSjqirz0iBITSv3S
r2XLmFw8GVACv/GkNGrWBM53wpkJLHzvwaV9hg6dr8HFDipaEn7vEY9/LAN3S3fw
reVwW6Q4N4+RSofM1eIGgAZsTYbYBDfri94mRQZ3y+Q8EkRGkJ270WKA0OAVFYS7
KA6nrjvGSYVtmDK3HORjbINQn3bXwIKeMZHl15c+LGM9ePwoHbsN3+smBswRX+R3
JDQjkhY=
=DV37
-----END PGP SIGNATURE-----
Eric Dumazet (1):
batman-adv: fix uninit-value in batadv_netlink_get_ifindex()
Sven Eckelmann (2):
batman-adv: Only read OGM tvlv_len after buffer len check
batman-adv: Only read OGM2 tvlv_len after buffer len check
-----------------------------------------------------------------------
--
linux integration
2 years, 9 months
[batctl] master: batctl: Add missing detached license text for ISC (3c98a91)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 3c98a91c7989b22f77869bcb089d6353d6fe2954
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Mon Sep 2 15:48:28 2019 +0200
batctl: Add missing detached license text for ISC
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
3c98a91c7989b22f77869bcb089d6353d6fe2954
LICENSES/deprecated/ISC | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/LICENSES/deprecated/ISC b/LICENSES/deprecated/ISC
new file mode 100644
index 0000000..8953c31
--- /dev/null
+++ b/LICENSES/deprecated/ISC
@@ -0,0 +1,24 @@
+Valid-License-Identifier: ISC
+SPDX-URL: https://spdx.org/licenses/ISC.html
+Usage-Guide:
+ To use the ISC License put the following SPDX tag/value pair into a
+ comment according to the placement guidelines in the licensing rules
+ documentation:
+ SPDX-License-Identifier: ISC
+License-Text:
+
+ISC License
+
+Copyright (c) <year> <copyright holders>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2 years, 9 months
[batman-adv] maint, master: batman-adv: Only read OGM2 tvlv_len after buffer len check (18f77da3)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branches: maint,master
>---------------------------------------------------------------
commit 18f77da3761c5550f42a2d131f0fe5cac62e022d
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Fri Aug 23 14:34:28 2019 +0200
batman-adv: Only read OGM2 tvlv_len after buffer len check
Multiple batadv_ogm2_packet can be stored in an skbuff. The functions
batadv_v_ogm_send_to_if() uses batadv_v_ogm_aggr_packet() to check if there
is another additional batadv_ogm2_packet in the skb or not before they
continue processing the packet.
The length for such an OGM2 is BATADV_OGM2_HLEN +
batadv_ogm2_packet->tvlv_len. The check must first check that at least
BATADV_OGM2_HLEN bytes are available before it accesses tvlv_len (which is
part of the header. Otherwise it might try read outside of the currently
available skbuff to get the content of tvlv_len.
Fixes: 667996ebeab4 ("batman-adv: OGMv2 - implement originators logic")
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
18f77da3761c5550f42a2d131f0fe5cac62e022d
net/batman-adv/bat_v_ogm.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/net/batman-adv/bat_v_ogm.c b/net/batman-adv/bat_v_ogm.c
index fad95ef6..bc06e3cd 100644
--- a/net/batman-adv/bat_v_ogm.c
+++ b/net/batman-adv/bat_v_ogm.c
@@ -631,17 +631,23 @@ batadv_v_ogm_process_per_outif(struct batadv_priv *bat_priv,
* batadv_v_ogm_aggr_packet() - checks if there is another OGM aggregated
* @buff_pos: current position in the skb
* @packet_len: total length of the skb
- * @tvlv_len: tvlv length of the previously considered OGM
+ * @ogm2_packet: potential OGM2 in buffer
*
* Return: true if there is enough space for another OGM, false otherwise.
*/
-static bool batadv_v_ogm_aggr_packet(int buff_pos, int packet_len,
- __be16 tvlv_len)
+static bool
+batadv_v_ogm_aggr_packet(int buff_pos, int packet_len,
+ const struct batadv_ogm2_packet *ogm2_packet)
{
int next_buff_pos = 0;
- next_buff_pos += buff_pos + BATADV_OGM2_HLEN;
- next_buff_pos += ntohs(tvlv_len);
+ /* check if there is enough space for the header */
+ next_buff_pos += buff_pos + sizeof(*ogm2_packet);
+ if (next_buff_pos > packet_len)
+ return false;
+
+ /* check if there is enough space for the optional TVLV */
+ next_buff_pos += ntohs(ogm2_packet->tvlv_len);
return (next_buff_pos <= packet_len) &&
(next_buff_pos <= BATADV_MAX_AGGREGATION_BYTES);
@@ -818,7 +824,7 @@ int batadv_v_ogm_packet_recv(struct sk_buff *skb,
ogm_packet = (struct batadv_ogm2_packet *)skb->data;
while (batadv_v_ogm_aggr_packet(ogm_offset, skb_headlen(skb),
- ogm_packet->tvlv_len)) {
+ ogm_packet)) {
batadv_v_ogm_process(skb, ogm_offset, if_incoming);
ogm_offset += BATADV_OGM2_HLEN;
2 years, 9 months
[batman-adv] master: Merge branch 'maint' (8a4c1058)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 8a4c10586a0fa6cd4ad2b92e9f6cc186e9efb5f6
Merge: 9b5ed2dd 18f77da3
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Sep 1 08:47:17 2019 +0200
Merge branch 'maint'
>---------------------------------------------------------------
8a4c10586a0fa6cd4ad2b92e9f6cc186e9efb5f6
net/batman-adv/bat_iv_ogm.c | 20 +++++++++++++-------
net/batman-adv/bat_v_ogm.c | 18 ++++++++++++------
2 files changed, 25 insertions(+), 13 deletions(-)
2 years, 9 months
[batman-adv] master: batman-adv: Add Sven to MAINTAINERS file (bcadeaa3)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit bcadeaa38b307e44f825f3cf0a68496129bc767e
Author: Simon Wunderlich <sw(a)simonwunderlich.de>
Date: Fri Aug 16 10:26:26 2019 +0200
batman-adv: Add Sven to MAINTAINERS file
Sven is taking care of tracking our patches and merging most of them in
our tree. Let's add him to the MAINTAINERS file so he will get all
patch e-mails.
Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de>
Acked-by: Antonio Quartulli <a(a)unstable.cc>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
bcadeaa38b307e44f825f3cf0a68496129bc767e
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 4b1b53d5..9f0f421e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2,6 +2,7 @@ BATMAN ADVANCED
M: Marek Lindner <mareklindner(a)neomailbox.ch>
M: Simon Wunderlich <sw(a)simonwunderlich.de>
M: Antonio Quartulli <a(a)unstable.cc>
+M: Sven Eckelmann <sven(a)narfation.org>
L: b.a.t.m.a.n(a)lists.open-mesh.org (moderated for non-subscribers)
W: https://www.open-mesh.org/
B: https://www.open-mesh.org/projects/batman-adv/issues
2 years, 9 months
[batman-adv] maint, master: batman-adv: Only read OGM tvlv_len after buffer len check (07b6051e)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branches: maint,master
>---------------------------------------------------------------
commit 07b6051ebcfaa7ea89b4f278eca2ff4070d29e56
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Fri Aug 23 14:34:27 2019 +0200
batman-adv: Only read OGM tvlv_len after buffer len check
Multiple batadv_ogm_packet can be stored in an skbuff. The functions
batadv_iv_ogm_send_to_if()/batadv_iv_ogm_receive() use
batadv_iv_ogm_aggr_packet() to check if there is another additional
batadv_ogm_packet in the skb or not before they continue processing the
packet.
The length for such an OGM is BATADV_OGM_HLEN +
batadv_ogm_packet->tvlv_len. The check must first check that at least
BATADV_OGM_HLEN bytes are available before it accesses tvlv_len (which is
part of the header. Otherwise it might try read outside of the currently
available skbuff to get the content of tvlv_len.
Fixes: 0b6aa0d43767 ("batman-adv: tvlv - basic infrastructure")
Reported-by: syzbot+355cab184197dbbfa384(a)syzkaller.appspotmail.com
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Acked-by: Antonio Quartulli <a(a)unstable.cc>
>---------------------------------------------------------------
07b6051ebcfaa7ea89b4f278eca2ff4070d29e56
net/batman-adv/bat_iv_ogm.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 240ed709..d78938e3 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -277,17 +277,23 @@ static u8 batadv_hop_penalty(u8 tq, const struct batadv_priv *bat_priv)
* batadv_iv_ogm_aggr_packet() - checks if there is another OGM attached
* @buff_pos: current position in the skb
* @packet_len: total length of the skb
- * @tvlv_len: tvlv length of the previously considered OGM
+ * @ogm_packet: potential OGM in buffer
*
* Return: true if there is enough space for another OGM, false otherwise.
*/
-static bool batadv_iv_ogm_aggr_packet(int buff_pos, int packet_len,
- __be16 tvlv_len)
+static bool
+batadv_iv_ogm_aggr_packet(int buff_pos, int packet_len,
+ const struct batadv_ogm_packet *ogm_packet)
{
int next_buff_pos = 0;
- next_buff_pos += buff_pos + BATADV_OGM_HLEN;
- next_buff_pos += ntohs(tvlv_len);
+ /* check if there is enough space for the header */
+ next_buff_pos += buff_pos + sizeof(*ogm_packet);
+ if (next_buff_pos > packet_len)
+ return false;
+
+ /* check if there is enough space for the optional TVLV */
+ next_buff_pos += ntohs(ogm_packet->tvlv_len);
return (next_buff_pos <= packet_len) &&
(next_buff_pos <= BATADV_MAX_AGGREGATION_BYTES);
@@ -315,7 +321,7 @@ static void batadv_iv_ogm_send_to_if(struct batadv_forw_packet *forw_packet,
/* adjust all flags and log packets */
while (batadv_iv_ogm_aggr_packet(buff_pos, forw_packet->packet_len,
- batadv_ogm_packet->tvlv_len)) {
+ batadv_ogm_packet)) {
/* we might have aggregated direct link packets with an
* ordinary base packet
*/
@@ -1704,7 +1710,7 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb,
/* unpack the aggregated packets and process them one by one */
while (batadv_iv_ogm_aggr_packet(ogm_offset, skb_headlen(skb),
- ogm_packet->tvlv_len)) {
+ ogm_packet)) {
batadv_iv_ogm_process(skb, ogm_offset, if_incoming);
ogm_offset += BATADV_OGM_HLEN;
2 years, 9 months