[riot-commits] [RIOT-OS/RIOT] bfdeeb: gnrc_sock_[udp|ip]: store return value before rele...

Gaëtan Harter hartergaetan at gmail.com
Mon Nov 12 20:08:56 CET 2018


  Branch: refs/heads/2018.10-branch
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: bfdeebd132771f8477f2822bc0658c587a5dce20
      https://github.com/RIOT-OS/RIOT/commit/bfdeebd132771f8477f2822bc0658c587a5dce20
  Author: Robin <robin at chilio.net>
  Date:   2018-11-12 (Mon, 12 Nov 2018)

  Changed paths:
    M sys/net/gnrc/sock/ip/gnrc_sock_ip.c
    M sys/net/gnrc/sock/udp/gnrc_sock_udp.c

  Log Message:
  -----------
  gnrc_sock_[udp|ip]: store return value before release

sock_[udp|ip]_recv returns `pkt->size` after pkt was released via `gnrc_pktbuf_release(pkt)`.
This can result in wrong values returned by this functions and thus is not according to its sepecification.

Storing this values before releasing pkt returning the stored values should fix this.

(cherry picked from commit e9047063ca10e276943be3ebe59d28d958178bf7)


  Commit: 3ff78e1ee097edf50d4e77c1044f8903ab88dd7b
      https://github.com/RIOT-OS/RIOT/commit/3ff78e1ee097edf50d4e77c1044f8903ab88dd7b
  Author: Gaëtan Harter <hartergaetan at gmail.com>
  Date:   2018-11-12 (Mon, 12 Nov 2018)

  Changed paths:
    M sys/net/gnrc/sock/ip/gnrc_sock_ip.c
    M sys/net/gnrc/sock/udp/gnrc_sock_udp.c

  Log Message:
  -----------
  Merge pull request #10374 from miri64/backport/2018.10/gnrc_udp_use_after_free

gnrc_sock_[udp|ip]: read return value for _recv after release [backport 2018.10]


Compare: https://github.com/RIOT-OS/RIOT/compare/f234a57672f7...3ff78e1ee097
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the commits mailing list