summaryrefslogtreecommitdiff
path: root/packages/linux-kernel/patches
diff options
context:
space:
mode:
Diffstat (limited to 'packages/linux-kernel/patches')
-rw-r--r--packages/linux-kernel/patches/accel-ppp/0001-L2TP-Include-Calling-Number-to-Calling-Station-ID-RA.patch183
-rw-r--r--packages/linux-kernel/patches/kernel/0001-linkstate-ip-device-attribute.patch38
-rw-r--r--packages/linux-kernel/patches/kernel/0002-inotify-support-for-stackable-filesystems.patch12
-rw-r--r--packages/linux-kernel/patches/kernel/0003-ship-perf-debian-package.patch92
4 files changed, 208 insertions, 117 deletions
diff --git a/packages/linux-kernel/patches/accel-ppp/0001-L2TP-Include-Calling-Number-to-Calling-Station-ID-RA.patch b/packages/linux-kernel/patches/accel-ppp/0001-L2TP-Include-Calling-Number-to-Calling-Station-ID-RA.patch
new file mode 100644
index 00000000..0c3141a0
--- /dev/null
+++ b/packages/linux-kernel/patches/accel-ppp/0001-L2TP-Include-Calling-Number-to-Calling-Station-ID-RA.patch
@@ -0,0 +1,183 @@
+From 12778d1e9296b6dbf190a80dcf407b24f9821f95 Mon Sep 17 00:00:00 2001
+From: zsdc <taras@vyos.io>
+Date: Tue, 4 Apr 2023 11:15:26 +0300
+Subject: [PATCH] L2TP: Include Calling-Number to Calling-Station-ID RADIUS
+ attribute
+
+Patch authored by Alexander Serkin from
+https://phabricator.accel-ppp.org/T59
+---
+ accel-pppd/ctrl/l2tp/l2tp.c | 112 ++++++++++++++++++++++++++++++------
+ 1 file changed, 93 insertions(+), 19 deletions(-)
+
+diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c
+index 027d710..c541c60 100644
+--- a/accel-pppd/ctrl/l2tp/l2tp.c
++++ b/accel-pppd/ctrl/l2tp/l2tp.c
+@@ -123,6 +123,11 @@ struct l2tp_sess_t
+ struct l2tp_conn_t *paren_conn;
+ uint16_t sid;
+ uint16_t peer_sid;
++/* We will keep l2tp attributes Calling-Number/Called-Number and their length while the session exists */
++ char *calling_num;
++ int calling_num_len;
++ char *called_num;
++ int called_num_len;
+
+ unsigned int ref_count;
+ int state1;
+@@ -979,6 +984,10 @@ static void __session_destroy(struct l2tp_sess_t *sess)
+ _free(sess->ctrl.calling_station_id);
+ if (sess->ctrl.called_station_id)
+ _free(sess->ctrl.called_station_id);
++ if (sess->calling_num)
++ _free(sess->calling_num);
++ if (sess->called_num)
++ _free(sess->called_num);
+
+ log_session(log_info2, sess, "session destroyed\n");
+
+@@ -1771,25 +1780,52 @@ static int l2tp_session_start_data_channel(struct l2tp_sess_t *sess)
+ sess->ctrl.max_mtu = conf_ppp_max_mtu;
+ sess->ctrl.mppe = conf_mppe;
+
+- sess->ctrl.calling_station_id = _malloc(17);
+- if (sess->ctrl.calling_station_id == NULL) {
+- log_session(log_error, sess,
+- "impossible to start data channel:"
+- " allocation of calling station ID failed\n");
+- goto err;
++ /* If l2tp calling number avp exists, we use it, otherwise we use lac ip */
++ if (sess->calling_num != NULL) {
++ sess->ctrl.calling_station_id = _malloc(sess->calling_num_len+1);
++ if (sess->ctrl.calling_station_id == NULL) {
++ log_session(log_error, sess,
++ "impossible to start data channel:"
++ " allocation of calling station ID failed\n");
++ goto err;
++ }else {
++ strcpy(sess->ctrl.calling_station_id, sess->calling_num);
++ }
++ } else {
++ sess->ctrl.calling_station_id = _malloc(17);
++ if (sess->ctrl.calling_station_id == NULL) {
++ log_session(log_error, sess,
++ "impossible to start data channel:"
++ " allocation of calling station ID failed\n");
++ goto err;
++ } else {
++ u_inet_ntoa(sess->paren_conn->peer_addr.sin_addr.s_addr,
++ sess->ctrl.calling_station_id);
++ }
+ }
+- u_inet_ntoa(sess->paren_conn->peer_addr.sin_addr.s_addr,
+- sess->ctrl.calling_station_id);
+-
+- sess->ctrl.called_station_id = _malloc(17);
+- if (sess->ctrl.called_station_id == NULL) {
+- log_session(log_error, sess,
+- "impossible to start data channel:"
+- " allocation of called station ID failed\n");
+- goto err;
++ /* If l2tp called number avp exists, we use it, otherwise we use my ip */
++ if (sess->called_num != NULL) {
++ sess->ctrl.called_station_id = _malloc(sess->called_num_len+1);
++ if (sess->ctrl.called_station_id == NULL) {
++ log_session(log_error, sess,
++ "impossible to start data channel:"
++ " allocation of called station ID failed\n");
++ goto err;
++ } else {
++ strcpy(sess->ctrl.called_station_id, sess->called_num);
++ }
++ } else {
++ sess->ctrl.called_station_id = _malloc(17);
++ if (sess->ctrl.called_station_id == NULL) {
++ log_session(log_error, sess,
++ "impossible to start data channel:"
++ " allocation of called station ID failed\n");
++ goto err;
++ } else {
++ u_inet_ntoa(sess->paren_conn->host_addr.sin_addr.s_addr,
++ sess->ctrl.called_station_id);
++ }
+ }
+- u_inet_ntoa(sess->paren_conn->host_addr.sin_addr.s_addr,
+- sess->ctrl.called_station_id);
+
+ if (conf_ip_pool) {
+ sess->ppp.ses.ipv4_pool_name = _strdup(conf_ip_pool);
+@@ -3295,6 +3331,10 @@ static int l2tp_recv_ICRQ(struct l2tp_conn_t *conn,
+ uint16_t sid = 0;
+ uint16_t res = 0;
+ uint16_t err = 0;
++ uint8_t *calling[254] = {0};
++ uint8_t *called[254] = {0};
++ int n = 0;
++ int m = 0;
+
+ if (conn->state != STATE_ESTB && conn->lns_mode) {
+ log_tunnel(log_warn, conn, "discarding unexpected ICRQ\n");
+@@ -3332,7 +3372,17 @@ static int l2tp_recv_ICRQ(struct l2tp_conn_t *conn,
+ case Call_Serial_Number:
+ case Bearer_Type:
+ case Calling_Number:
++ /* Save Calling-Number L2TP attribute locally */
++ if (attr->attr->id == Calling_Number) {
++ n = attr->length;
++ memcpy(calling,attr->val.octets,n);
++ }
+ case Called_Number:
++ /* Save Called-Number L2TP attribute locally */
++ if (attr->attr->id == Called_Number) {
++ m = attr->length;
++ memcpy(called,attr->val.octets,m);
++ }
+ case Sub_Address:
+ case Physical_Channel_ID:
+ break;
+@@ -3371,6 +3421,30 @@ static int l2tp_recv_ICRQ(struct l2tp_conn_t *conn,
+ sess->peer_sid = peer_sid;
+ sid = sess->sid;
+
++ /* Allocate memory for Calling-Number if exists, and put it to l2tp_sess_t structure */
++ if (calling != NULL && n > 0) {
++ sess->calling_num = _malloc(n+1);
++ if (sess->calling_num == NULL) {
++ log_tunnel(log_warn, conn, "can't allocate memory for Calling Number attribute. Will use LAC IP instead\n");
++ }else{
++ memcpy(sess->calling_num, calling, n);
++ sess->calling_num[n] = '\0';
++ sess->calling_num_len = n;
++ }
++ }
++
++ /* Allocate memory for Called-Number if exists, and put it to l2tp_sess_t structure */
++ if (called != NULL && m > 1) {
++ sess->called_num = _malloc(m+1);
++ if (sess->called_num == NULL) {
++ log_tunnel(log_warn, conn, "can't allocate memory for Called Number attribute. Will use my IP instead\n");
++ } else {
++ memcpy(sess->called_num, called, m);
++ sess->called_num[m] = '\0';
++ sess->called_num_len = m;
++ }
++ }
++
+ if (unknown_attr) {
+ log_tunnel(log_error, conn, "impossible to handle ICRQ:"
+ " unknown mandatory attribute type %i,"
+@@ -3390,8 +3464,8 @@ static int l2tp_recv_ICRQ(struct l2tp_conn_t *conn,
+ goto out_reject;
+ }
+
+- log_tunnel(log_info1, conn, "new session %hu-%hu created following"
+- " reception of ICRQ\n", sid, peer_sid);
++ log_tunnel(log_info1, conn, "new session %hu-%hu with calling num %s len %d, called num %s len %d created following"
++ " reception of ICRQ\n", sid, peer_sid, sess->calling_num, sess->calling_num_len, sess->called_num, sess->called_num_len);
+
+ return 0;
+
+--
+2.34.1
+
diff --git a/packages/linux-kernel/patches/kernel/0001-linkstate-ip-device-attribute.patch b/packages/linux-kernel/patches/kernel/0001-linkstate-ip-device-attribute.patch
index 5efe2b92..9c79e4f5 100644
--- a/packages/linux-kernel/patches/kernel/0001-linkstate-ip-device-attribute.patch
+++ b/packages/linux-kernel/patches/kernel/0001-linkstate-ip-device-attribute.patch
@@ -18,10 +18,10 @@ Backport of earlier Vyatta patch.
8 files changed, 34 insertions(+)
diff --git a/Documentation/networking/ip-sysctl.rst b/Documentation/networking/ip-sysctl.rst
-index e7b3fa7bb3f7..081b344ea52b 100644
+index a66054d0763a..53440098fa98 100644
--- a/Documentation/networking/ip-sysctl.rst
+++ b/Documentation/networking/ip-sysctl.rst
-@@ -1592,6 +1592,17 @@ src_valid_mark - BOOLEAN
+@@ -1734,6 +1734,17 @@ src_valid_mark - BOOLEAN
Default value is 0.
@@ -52,10 +52,10 @@ index ddb27fc0ee8c..8ee3191d9558 100644
struct in_ifaddr {
struct hlist_node hash;
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
-index 37dfdcfcdd54..d549006be04c 100644
+index af8a771a053c..ece8ac89d317 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
-@@ -83,6 +83,7 @@ struct ipv6_devconf {
+@@ -84,6 +84,7 @@ struct ipv6_devconf {
__u8 ndisc_evict_nocarrier;
struct ctl_table_header *sysctl_header;
@@ -64,10 +64,10 @@ index 37dfdcfcdd54..d549006be04c 100644
struct ipv6_params {
diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h
-index 874a92349bf5..37a9c7c7b56c 100644
+index 283dec7e3645..8067941a635e 100644
--- a/include/uapi/linux/ip.h
+++ b/include/uapi/linux/ip.h
-@@ -172,6 +172,7 @@ enum
+@@ -173,6 +173,7 @@ enum
IPV4_DEVCONF_DROP_GRATUITOUS_ARP,
IPV4_DEVCONF_BC_FORWARDING,
IPV4_DEVCONF_ARP_EVICT_NOCARRIER,
@@ -76,22 +76,22 @@ index 874a92349bf5..37a9c7c7b56c 100644
};
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
-index 81f4243bebb1..9e001ea84841 100644
+index cf592d7b630f..e8915701aa73 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
-@@ -197,6 +197,7 @@ enum {
- DEVCONF_IOAM6_ID_WIDE,
+@@ -199,6 +199,7 @@ enum {
DEVCONF_NDISC_EVICT_NOCARRIER,
DEVCONF_ACCEPT_UNTRACKED_NA,
+ DEVCONF_ACCEPT_RA_MIN_LFT,
+ DEVCONF_LINK_FILTER,
DEVCONF_MAX
};
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
-index e8b9a9202fec..1bb48732e619 100644
+index ca0ff15dc8fa..67a55fec5b29 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
-@@ -2561,6 +2561,7 @@ static struct devinet_sysctl_table {
+@@ -2582,6 +2582,7 @@ static struct devinet_sysctl_table {
"route_localnet"),
DEVINET_SYSCTL_FLUSHING_ENTRY(DROP_UNICAST_IN_L2_MULTICAST,
"drop_unicast_in_l2_multicast"),
@@ -100,18 +100,18 @@ index e8b9a9202fec..1bb48732e619 100644
};
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
-index 9c3f5202a97b..fbc072c3534e 100644
+index b007d098ffe2..865d7be4fd29 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
-@@ -5591,6 +5591,7 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf,
- array[DEVCONF_IOAM6_ID_WIDE] = cnf->ioam6_id_wide;
+@@ -5639,6 +5639,7 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf,
array[DEVCONF_NDISC_EVICT_NOCARRIER] = cnf->ndisc_evict_nocarrier;
array[DEVCONF_ACCEPT_UNTRACKED_NA] = cnf->accept_untracked_na;
+ array[DEVCONF_ACCEPT_RA_MIN_LFT] = cnf->accept_ra_min_lft;
+ array[DEVCONF_LINK_FILTER] = cnf->link_filter;
}
static inline size_t inet6_ifla6_size(void)
-@@ -7016,6 +7017,13 @@ static const struct ctl_table addrconf_sysctl[] = {
+@@ -7067,6 +7068,13 @@ static const struct ctl_table addrconf_sysctl[] = {
.extra1 = (void *)SYSCTL_ZERO,
.extra2 = (void *)SYSCTL_ONE,
},
@@ -126,10 +126,10 @@ index 9c3f5202a97b..fbc072c3534e 100644
.procname = "ioam6_id",
.data = &ipv6_devconf.ioam6_id,
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
-index 2f355f0ec32a..388e0342c989 100644
+index 56525b5b95a2..e3af0e704291 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
-@@ -675,6 +675,14 @@ static inline void rt6_probe(struct fib6_nh *fib6_nh)
+@@ -676,6 +676,14 @@ static inline void rt6_probe(struct fib6_nh *fib6_nh)
}
#endif
@@ -144,7 +144,7 @@ index 2f355f0ec32a..388e0342c989 100644
/*
* Default Router Selection (RFC 2461 6.3.6)
*/
-@@ -716,6 +724,8 @@ static int rt6_score_route(const struct fib6_nh *nh, u32 fib6_flags, int oif,
+@@ -717,6 +725,8 @@ static int rt6_score_route(const struct fib6_nh *nh, u32 fib6_flags, int oif,
if (!m && (strict & RT6_LOOKUP_F_IFACE))
return RT6_NUD_FAIL_HARD;
@@ -154,5 +154,5 @@ index 2f355f0ec32a..388e0342c989 100644
m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(fib6_flags)) << 2;
#endif
--
-2.30.2
+2.39.2
diff --git a/packages/linux-kernel/patches/kernel/0002-inotify-support-for-stackable-filesystems.patch b/packages/linux-kernel/patches/kernel/0002-inotify-support-for-stackable-filesystems.patch
index fdb8de0a..31544af4 100644
--- a/packages/linux-kernel/patches/kernel/0002-inotify-support-for-stackable-filesystems.patch
+++ b/packages/linux-kernel/patches/kernel/0002-inotify-support-for-stackable-filesystems.patch
@@ -190,7 +190,7 @@ index 1c4bfdab008d..cf567cc33679 100644
struct inotify_inode_mark *i_mark)
{
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
-index 3d14a3f1465d..adee0c20295a 100644
+index 3fa2416264a4..38930c1e70d8 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -15,6 +15,7 @@
@@ -199,9 +199,9 @@ index 3d14a3f1465d..adee0c20295a 100644
#include <linux/exportfs.h>
+#include <linux/inotify.h>
#include <linux/file.h>
- #include "overlayfs.h"
-
-@@ -2202,6 +2203,18 @@ static void ovl_inode_init_once(void *foo)
+ #include <linux/fs_context.h>
+ #include <linux/fs_parser.h>
+@@ -1525,6 +1526,18 @@ static void ovl_inode_init_once(void *foo)
inode_init_once(&oi->vfs_inode);
}
@@ -220,7 +220,7 @@ index 3d14a3f1465d..adee0c20295a 100644
static int __init ovl_init(void)
{
int err;
-@@ -2217,18 +2230,24 @@ static int __init ovl_init(void)
+@@ -1540,18 +1553,24 @@ static int __init ovl_init(void)
err = ovl_aio_request_cache_init();
if (!err) {
err = register_filesystem(&ovl_fs_type);
@@ -294,5 +294,5 @@ index 8d20caa1b268..c126e2f93a73 100644
+
#endif /* _LINUX_INOTIFY_H */
--
-2.30.2
+2.39.2
diff --git a/packages/linux-kernel/patches/kernel/0003-ship-perf-debian-package.patch b/packages/linux-kernel/patches/kernel/0003-ship-perf-debian-package.patch
deleted file mode 100644
index 30219961..00000000
--- a/packages/linux-kernel/patches/kernel/0003-ship-perf-debian-package.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From: Riku Voipio <riku.voipio@linaro.org>
-
-Perf is shipped in debian in linux-tools-$version package. Extend
-the existing to builddeb script to build perf if BUILD_TOOLS=y
-is added the make deb-pkg line
-
-Some features of this patch I'm uncomfortable with:
-
-1. Relative paths are resoved to absolute ones
- Especially with separate O= buildd, perf build from tools/perf dir
- fail.
-
-2. Unsetting LDFLAGS
- make -> shell (builddeb) -> make expands variables. The LDFLAGS as
- set by toplevel makefile are for kernel, so we just unset the flag
- here.
-
-3. Replaces ubuntu/debian packages instead attempting to fit to
- the linux-base/linux-tools-common frameworks. I think people who
- want to run "make deb-pkg" for their kernels would rather keep this
- simple.
-
-4. More tools than just perf could be built - unfortunately most
- tools fail to have a working "install" target and/or else have
- build process inconsistent with other tools. A topic for another
- patch series.
-
-Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
-
----
- scripts/package/builddeb | 31 ++++++++++++++++++++++++++++++-
- 1 file changed, 30 insertions(+), 1 deletion(-)
-
-diff --git a/scripts/package/builddeb b/scripts/package/builddeb
-index 91a502bb97e8..79987641bed5 100755
---- a/scripts/package/builddeb
-+++ b/scripts/package/builddeb
-@@ -109,8 +109,10 @@ deploy_libc_headers () {
- version=$KERNELRELEASE
- tmpdir=debian/linux-image
- dbg_dir=debian/linux-image-dbg
-+tools_dir="$objtree/debian/toolstmp"
- packagename=linux-image-$version
- dbg_packagename=$packagename-dbg
-+tools_packagename=linux-tools-$version
-
- if [ "$ARCH" = "um" ] ; then
- packagename=user-mode-linux-$version
-@@ -133,7 +135,7 @@ esac
- BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes)
-
- # Setup the directory structure
--rm -rf "$tmpdir" "$dbg_dir" debian/files
-+rm -rf "$tmpdir" "$dbg_dir" "$tools_dir" debian/files
- mkdir -m 755 -p "$tmpdir/DEBIAN"
- mkdir -p "$tmpdir/lib" "$tmpdir/boot"
-
-@@ -234,4 +236,31 @@ if [ -n "$BUILD_DEBUG" ] ; then
- create_package "$dbg_packagename" "$dbg_dir"
- fi
-
-+if [ -n "$BUILD_TOOLS" ]
-+then
-+ # HACK - change output dir from relative to absolute
-+ mkdir -p $tools_dir
-+ tools_dest=`readlink -f $tools_dir`
-+ if [ -n "$O" ]
-+ then
-+ output=`readlink -f $objtree`
-+ mkdir -p $output/tools/perf
-+ output="O=$output/tools/perf"
-+ fi
-+ $MAKE -C $srctree/tools/perf $output LDFLAGS= srctree=$KBUILD_SRC prefix=$tools_dest/usr install
-+ cat <<EOF >> debian/control
-+
-+Package: $tools_packagename
-+Architecture: any
-+Replaces: linux-base, linux-tools-common
-+Depends: \${shlibs:Depends}
-+Description: Performance analysis tools for Linux $version
-+ This package contains the 'perf' performance analysis tools for Linux
-+ kernel version $version .
-+EOF
-+
-+ dpkg-shlibdeps $tools_dest/usr/bin/* $tools_dest/usr/lib*/traceevent/plugins/*
-+ create_package "$tools_packagename" "$tools_dir"
-+fi
-+
- exit 0
---
-2.20.1
-