From patchwork Sun Apr 7 17:03:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1920591 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VCJVJ6BhGz1yYf for ; Mon, 8 Apr 2024 03:04:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 72DAA81400; Sun, 7 Apr 2024 17:04:20 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id u_GYl2xxDybc; Sun, 7 Apr 2024 17:04:19 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 1FE48813D9 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 1FE48813D9; Sun, 7 Apr 2024 17:04:19 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 4A94B1BF326 for ; Sun, 7 Apr 2024 17:04:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 428FD40741 for ; Sun, 7 Apr 2024 17:04:18 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id CaLkeRevFqaW for ; Sun, 7 Apr 2024 17:04:16 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::334; helo=mail-wm1-x334.google.com; envelope-from=fontaine.fabrice@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 5485E4073D DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 5485E4073D Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by smtp4.osuosl.org (Postfix) with ESMTPS id 5485E4073D for ; Sun, 7 Apr 2024 17:04:16 +0000 (UTC) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-41650ee55faso5085345e9.1 for ; Sun, 07 Apr 2024 10:04:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712509454; x=1713114254; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=melSqkSc/G0hd4MLplv1To5j5ku4BSJYq+YTYlN1Bmc=; b=ghlfBbvbelUprI4/mz8Y3LnlLNOcm3MHm/sx5RBn5yCto7gar+n4sc1I2oLyMhfuoX x+B3dgeghJWXtI7KRUOyRJ4xWhrv2LEg6fWtkiWSeHHBhQIlYyFHFysWOXJgawjtq10r Skoh1Q+b9hjvXSXeDYbaqJy0361nRKWncYjjbuOhO49ytYZvB6b97xtUOoFlz5vhNfW6 4tV62BOynOAKbOhZ4ujEQrKgBxa5m2xhOkhT5re2mywSYegiZczn0CIs+R0FV6PlV8fP BlGkArBugYJZllsEgwIQQ6PdXNNllZZ/GR6VVIX+v7FT38Q0+eebxtiIiTXYl9vuWExO WmmA== X-Gm-Message-State: AOJu0Yx4gFzpaYCsSD8TQYgmtBSEhwklowqWpGkmlCdnk1SREAn/CN54 Ue+PBvYOzgFQgkDo20p80TKniVV9YEvaPFx7vDYhpLL2UtlFF66kl8RM3ALx X-Google-Smtp-Source: AGHT+IEvFTRXWsiLq9+QYGLnO+2r1Md6CQHnXuPv4Gxmi5yFhd6RKr7pibB1pDKlEQh1rda5E7EL5g== X-Received: by 2002:a05:600c:1e1c:b0:416:4a4a:7d87 with SMTP id ay28-20020a05600c1e1c00b004164a4a7d87mr1871796wmb.11.1712509453765; Sun, 07 Apr 2024 10:04:13 -0700 (PDT) Received: from kali.home (lfbn-ren-1-787-165.w83-197.abo.wanadoo.fr. [83.197.114.165]) by smtp.gmail.com with ESMTPSA id t12-20020a05600c450c00b004161bffa48csm10429990wmo.40.2024.04.07.10.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 10:04:13 -0700 (PDT) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Sun, 7 Apr 2024 19:03:27 +0200 Message-ID: <20240407170327.2783623-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712509454; x=1713114254; darn=buildroot.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=melSqkSc/G0hd4MLplv1To5j5ku4BSJYq+YTYlN1Bmc=; b=iT4mMpjLlKZY2o4jMORPl2rLJ8sOTnTj8vCj5bmtT3pv+vyYSPi8lToy0ff4i5NBt2 LutG2h6jnZGRlg8oJ4kn36z1lxtOv2ukklbwEym/FMs4+317rzxTTfH3b9lgcl2jgfpC JCKK8RnXPNXMPGMD9CA97q4uPYz/aGBqhla+zdOWpuQUZa3Z7GoJj2Qfu6U48M+oVEVO A4xPQT1iTITXm4hprb51iIUxfN1YVVwEu5gnmqCQ/vLpvBlj6VX2DQtSfZxunMvCN+Ra pXvH1x+qr3yJ0emKX0d25UzaEL6/MzLe8LLG7I4snZwGmq+rAEY0PQGNrJeXjCAP6Y54 Tijg== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=iT4mMpjL Subject: [Buildroot] [PATCH 1/1] package/dahdi-linux: fix build with kernel >= 6.8 X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Yann E . MORIN" , Fabrice Fontaine Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Fix the following build failure with kernel >= 6.8: /home/autobuild/autobuild/instance-8/output-1/build/dahdi-linux-3.3.0/drivers/dahdi/xpp/card_global.c: In function ‘parse_chip_command’: /home/autobuild/autobuild/instance-8/output-1/build/dahdi-linux-3.3.0/drivers/dahdi/xpp/card_global.c:345:9: error: implicit declaration of function ‘strlcpy’; did you mean ‘strscpy’? [-Werror=implicit-function-declaration] 345 | strlcpy(buf, cmdline, MAX_PROC_WRITE); /* Save a copy */ | ^~~~~~~ | strscpy Fixes: - http://autobuild.buildroot.org/results/a0d2dcd10af9bf465ded2da83eccf2d137187477 Signed-off-by: Fabrice Fontaine --- ...ilation-issue-for-6-8-y-6-9-y-kernel.patch | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 package/dahdi-linux/0002-Fix-compilation-issue-for-6-8-y-6-9-y-kernel.patch diff --git a/package/dahdi-linux/0002-Fix-compilation-issue-for-6-8-y-6-9-y-kernel.patch b/package/dahdi-linux/0002-Fix-compilation-issue-for-6-8-y-6-9-y-kernel.patch new file mode 100644 index 0000000000..776d74218e --- /dev/null +++ b/package/dahdi-linux/0002-Fix-compilation-issue-for-6-8-y-6-9-y-kernel.patch @@ -0,0 +1,230 @@ +From 497f11466688d9e76a7b68ffdd2c3859279f5fce Mon Sep 17 00:00:00 2001 +From: Pushkar Singh +Date: Thu, 4 Apr 2024 01:15:01 +0530 +Subject: [PATCH] Fix compilation issue for 6.8.y/6.9.y kernel + +Upstream: https://github.com/asterisk/dahdi-linux/commit/497f11466688d9e76a7b68ffdd2c3859279f5fce +Signed-off-by: Fabrice Fontaine +--- + drivers/dahdi/dahdi-base.c | 40 ++++++++++++++--------------- + drivers/dahdi/dahdi_dynamic.c | 4 +-- + drivers/dahdi/dahdi_dynamic_eth.c | 4 +-- + drivers/dahdi/dahdi_dynamic_ethmf.c | 2 +- + drivers/dahdi/dahdi_transcode.c | 2 +- + drivers/dahdi/xpp/card_global.c | 2 +- + 6 files changed, 27 insertions(+), 27 deletions(-) + +diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c +index b96f72b1..87177a69 100644 +--- a/drivers/dahdi/dahdi-base.c ++++ b/drivers/dahdi/dahdi-base.c +@@ -4359,7 +4359,7 @@ static int dahdi_ioctl_getparams(struct file *file, unsigned long data) + param.pulsebreaktime = chan->pulsebreaktime; + param.pulseaftertime = chan->pulseaftertime; + param.spanno = (chan->span) ? chan->span->spanno : 0; +- strlcpy(param.name, chan->name, sizeof(param.name)); ++ strscpy(param.name, chan->name, sizeof(param.name)); + param.chanpos = chan->chanpos; + param.sigcap = chan->sigcap; + /* Return current law */ +@@ -4447,8 +4447,8 @@ static int dahdi_ioctl_spanstat(struct file *file, unsigned long data) + + spaninfo.spanno = s->spanno; /* put the span # in here */ + spaninfo.totalspans = span_count(); +- strlcpy(spaninfo.desc, s->desc, sizeof(spaninfo.desc)); +- strlcpy(spaninfo.name, s->name, sizeof(spaninfo.name)); ++ strscpy(spaninfo.desc, s->desc, sizeof(spaninfo.desc)); ++ strscpy(spaninfo.name, s->name, sizeof(spaninfo.name)); + spaninfo.alarms = s->alarms; /* get alarm status */ + spaninfo.rxlevel = s->rxlevel; /* get rx level */ + spaninfo.txlevel = s->txlevel; /* get tx level */ +@@ -4475,18 +4475,18 @@ static int dahdi_ioctl_spanstat(struct file *file, unsigned long data) + spaninfo.lineconfig = s->lineconfig; + spaninfo.irq = 0; + spaninfo.linecompat = s->linecompat; +- strlcpy(spaninfo.lboname, dahdi_lboname(s->lbo), ++ strscpy(spaninfo.lboname, dahdi_lboname(s->lbo), + sizeof(spaninfo.lboname)); + if (s->parent->manufacturer) { +- strlcpy(spaninfo.manufacturer, s->parent->manufacturer, ++ strscpy(spaninfo.manufacturer, s->parent->manufacturer, + sizeof(spaninfo.manufacturer)); + } + if (s->parent->devicetype) { +- strlcpy(spaninfo.devicetype, s->parent->devicetype, ++ strscpy(spaninfo.devicetype, s->parent->devicetype, + sizeof(spaninfo.devicetype)); + } + if (s->parent->location) { +- strlcpy(spaninfo.location, s->parent->location, ++ strscpy(spaninfo.location, s->parent->location, + sizeof(spaninfo.location)); + } + if (s->spantype) { +@@ -4505,11 +4505,11 @@ static int dahdi_ioctl_spanstat(struct file *file, unsigned long data) + const char *st = dahdi_spantype2str(s->spantype); + switch (s->spantype) { + case SPANTYPE_DIGITAL_BRI_NT: +- strlcpy(spaninfo.spantype, "NT", ++ strscpy(spaninfo.spantype, "NT", + sizeof(spaninfo.spantype)); + break; + case SPANTYPE_DIGITAL_BRI_TE: +- strlcpy(spaninfo.spantype, "TE", ++ strscpy(spaninfo.spantype, "TE", + sizeof(spaninfo.spantype)); + break; + default: +@@ -4519,7 +4519,7 @@ static int dahdi_ioctl_spanstat(struct file *file, unsigned long data) + * so no backward compatibility for this + * broken interface. + */ +- strlcpy(spaninfo.spantype, st, ++ strscpy(spaninfo.spantype, st, + sizeof(spaninfo.spantype)); + break; + } +@@ -4568,10 +4568,10 @@ static int dahdi_ioctl_spanstat_v1(struct file *file, unsigned long data) + spaninfo_v1.spanno = s->spanno; /* put the span # in here */ + spaninfo_v1.totalspans = 0; + spaninfo_v1.totalspans = span_count(); +- strlcpy(spaninfo_v1.desc, ++ strscpy(spaninfo_v1.desc, + s->desc, + sizeof(spaninfo_v1.desc)); +- strlcpy(spaninfo_v1.name, ++ strscpy(spaninfo_v1.name, + s->name, + sizeof(spaninfo_v1.name)); + spaninfo_v1.alarms = s->alarms; +@@ -4593,25 +4593,25 @@ static int dahdi_ioctl_spanstat_v1(struct file *file, unsigned long data) + spaninfo_v1.lineconfig = s->lineconfig; + spaninfo_v1.irq = 0; + spaninfo_v1.linecompat = s->linecompat; +- strlcpy(spaninfo_v1.lboname, ++ strscpy(spaninfo_v1.lboname, + dahdi_lboname(s->lbo), + sizeof(spaninfo_v1.lboname)); + + if (s->parent->manufacturer) { +- strlcpy(spaninfo_v1.manufacturer, s->parent->manufacturer, ++ strscpy(spaninfo_v1.manufacturer, s->parent->manufacturer, + sizeof(spaninfo_v1.manufacturer)); + } + + if (s->parent->devicetype) { +- strlcpy(spaninfo_v1.devicetype, s->parent->devicetype, ++ strscpy(spaninfo_v1.devicetype, s->parent->devicetype, + sizeof(spaninfo_v1.devicetype)); + } + +- strlcpy(spaninfo_v1.location, s->parent->location, ++ strscpy(spaninfo_v1.location, s->parent->location, + sizeof(spaninfo_v1.location)); + + if (s->spantype) { +- strlcpy(spaninfo_v1.spantype, ++ strscpy(spaninfo_v1.spantype, + dahdi_spantype2str(s->spantype), + sizeof(spaninfo_v1.spantype)); + } +@@ -5285,7 +5285,7 @@ static int dahdi_ioctl_attach_echocan(unsigned long data) + * always use it instead of any configured software + * echocan. This matches the behavior in dahdi 2.4.1.2 + * and earlier releases. */ +- strlcpy(ae.echocan, hwec_def_name, sizeof(ae.echocan)); ++ strscpy(ae.echocan, hwec_def_name, sizeof(ae.echocan)); + + } else if (strcasecmp(ae.echocan, hwec_def_name) != 0) { + chan_dbg(GENERAL, chan, +@@ -5384,7 +5384,7 @@ static int dahdi_ioctl_get_version(unsigned long data) + bool have_hwec = dahdi_any_hwec_available(); + + memset(&vi, 0, sizeof(vi)); +- strlcpy(vi.version, dahdi_version, sizeof(vi.version)); ++ strscpy(vi.version, dahdi_version, sizeof(vi.version)); + spin_lock(&ecfactory_list_lock); + list_for_each_entry(cur, &ecfactory_list, list) { + const char * const ec_name = cur->ec->get_name(NULL); +@@ -5640,7 +5640,7 @@ static int ioctl_dahdi_dial(struct dahdi_chan *chan, unsigned long data) + rv = -EBUSY; + break; + } +- strlcpy(chan->txdialbuf + strlen(chan->txdialbuf), tdo->dialstr, ++ strscpy(chan->txdialbuf + strlen(chan->txdialbuf), tdo->dialstr, + DAHDI_MAX_DTMF_BUF - strlen(chan->txdialbuf)); + if (!chan->dialing) { + chan->dialing = 1; +diff --git a/drivers/dahdi/dahdi_dynamic.c b/drivers/dahdi/dahdi_dynamic.c +index b1df408d..be58aff8 100644 +--- a/drivers/dahdi/dahdi_dynamic.c ++++ b/drivers/dahdi/dahdi_dynamic.c +@@ -622,8 +622,8 @@ static int _create_dynamic(struct dahdi_dynamic_span *dds) + } + + /* Setup parameters properly assuming we're going to be okay. */ +- strlcpy(d->dname, dds->driver, sizeof(d->dname)); +- strlcpy(d->addr, dds->addr, sizeof(d->addr)); ++ strscpy(d->dname, dds->driver, sizeof(d->dname)); ++ strscpy(d->addr, dds->addr, sizeof(d->addr)); + d->timing = dds->timing; + snprintf(d->span.name, sizeof(d->span.name), "DYN/%s/%s", + dds->driver, dds->addr); +diff --git a/drivers/dahdi/dahdi_dynamic_eth.c b/drivers/dahdi/dahdi_dynamic_eth.c +index 0209489b..c7a293dd 100644 +--- a/drivers/dahdi/dahdi_dynamic_eth.c ++++ b/drivers/dahdi/dahdi_dynamic_eth.c +@@ -292,12 +292,12 @@ static int ztdeth_create(struct dahdi_dynamic *dyn, const char *addr) + memset(z, 0, sizeof(struct ztdeth)); + + /* Address should be /[/subaddr] */ +- strlcpy(tmp, addr, sizeof(tmp)); ++ strscpy(tmp, addr, sizeof(tmp)); + tmp2 = strchr(tmp, '/'); + if (tmp2) { + *tmp2 = '\0'; + tmp2++; +- strlcpy(z->ethdev, tmp, sizeof(z->ethdev)); ++ strscpy(z->ethdev, tmp, sizeof(z->ethdev)); + } else { + printk(KERN_NOTICE "Invalid TDMoE address (no device) '%s'\n", addr); + kfree(z); +diff --git a/drivers/dahdi/dahdi_dynamic_ethmf.c b/drivers/dahdi/dahdi_dynamic_ethmf.c +index 73290d8d..f7c067fb 100644 +--- a/drivers/dahdi/dahdi_dynamic_ethmf.c ++++ b/drivers/dahdi/dahdi_dynamic_ethmf.c +@@ -573,7 +573,7 @@ static int ztdethmf_create(struct dahdi_dynamic *dyn, const char *addr) + z->rcvbuf = kmalloc(bufsize, GFP_KERNEL); + + /* Address should be //subaddr */ +- strlcpy(src, addr, sizeof(src)); ++ strscpy(src, addr, sizeof(src)); + /* replace all / with space; otherwise kernel sscanf does not work */ + src_ptr = src; + while (*src_ptr) { +diff --git a/drivers/dahdi/dahdi_transcode.c b/drivers/dahdi/dahdi_transcode.c +index 6021aac2..7645e2f1 100644 +--- a/drivers/dahdi/dahdi_transcode.c ++++ b/drivers/dahdi/dahdi_transcode.c +@@ -329,7 +329,7 @@ static long dahdi_tc_getinfo(unsigned long data) + return -ENOSYS; + } + +- strlcpy(info.name, tc->name, sizeof(info.name)); ++ strscpy(info.name, tc->name, sizeof(info.name)); + info.numchannels = tc->numchannels; + info.srcfmts = tc->srcfmts; + info.dstfmts = tc->dstfmts; +diff --git a/drivers/dahdi/xpp/card_global.c b/drivers/dahdi/xpp/card_global.c +index 9e679bbc..064edbb3 100644 +--- a/drivers/dahdi/xpp/card_global.c ++++ b/drivers/dahdi/xpp/card_global.c +@@ -342,7 +342,7 @@ int parse_chip_command(xpd_t *xpd, char *cmdline) + XBUS_DBG(GENERAL, xbus, "Dropped packet. Disconnected.\n"); + return -EBUSY; + } +- strlcpy(buf, cmdline, MAX_PROC_WRITE); /* Save a copy */ ++ strscpy(buf, cmdline, MAX_PROC_WRITE); /* Save a copy */ + if (buf[0] == '#' || buf[0] == ';') + XPD_DBG(REGS, xpd, "Note: '%s'\n", buf); + if ((p = strchr(buf, '#')) != NULL) /* Truncate comments */