Bug#1071575: dahdi-dkms: module fails to build for Linux 6.8.9: error: implicit declaration of function 'strlcpy'

2024-05-28 Thread Harald Welte
Please note that the osmocom fork does have a CI job to exactly
prevent a situation like this:  We're continuously building our fork against
Linus Torvalds' git, see 
https://jenkins.osmocom.org/jenkins/job/master-dahdi-linux-torvalds-master/

It seems the strlcpy was fixed in
https://gitea.osmocom.org/retronetworking/dahdi-linux/commit/b4a35fb6984a7693ec82b99af03d368c2f5a8c0b

Maybe the debian pacakge was using an outdated version and not following
https://gitea.osmocom.org/retronetworking/dahdi-linux/commits/branch/master ?

The Osmocom fork introduces some modern hardware support which is not present in
sangoma (Osmocom icE1usb, the only open source hardware E1 interface I am aware 
of),
and it re-introduces support for some older Digium hardware [with active users]
that Digium/Sangoma have removed from their official version.

Regards,
Harald
-- 
- Harald Welte   https://laforge.gnumonks.org/

"Privacy in residential applications is a desirable marketing option."
  (ETSI EN 300 175-7 Ch. A6)



Bug#1071575: dahdi-dkms: module fails to build for Linux 6.8.9: error: implicit declaration of function 'strlcpy'

2024-05-27 Thread Tzafrir Cohen
Hi,

On Mon, May 27, 2024 at 10:26:45AM +0200, Diederik de Haas via 
Pkg-voip-maintainers wrote:
> Control: tag -1 upstream fixed-upstream patch

Thanks for that. Just one note regarding the word "upstream". The
current upstream of the package is the osmo fork. At the time when
uploading previous version, that fork was looking more reliable than the
main branch.

This bug and its fix finally proves that the main Sangoma repo is the
one to follow.

Note to self: remove version.patch .

-- 
mail / xmpp / matrix: tzaf...@cohens.org.il



Bug#1071575: dahdi-dkms: module fails to build for Linux 6.8.9: error: implicit declaration of function 'strlcpy'

2024-05-27 Thread Diederik de Haas
On Monday, 27 May 2024 17:25:02 CEST Tzafrir Cohen wrote:
> Thanks for that. Just one note regarding the word "upstream". The
> current upstream of the package is the osmo fork. At the time when
> uploading previous version, that fork was looking more reliable than the
> main branch.

Yeah, it was/is a bit confusing, hence my next reply contained:

On 27 May 2024 10:40:24 +0200 Diederik de Haas  wrote:
> Forgot to mention that that commit is part of upstream's 3.4.0~rc1, 
> but it's unclear to me what is considered upstream now.

The ``debian/watch`` file points to one repo, but the ``upstream`` branch 
(indeed) indicated that came from another repo.

signature.asc
Description: This is a digitally signed message part.


Bug#1071575: dahdi-dkms: module fails to build for Linux 6.8.9: error: implicit declaration of function 'strlcpy'

2024-05-27 Thread Diederik de Haas
On 27 May 2024 10:26:45 +0200 Diederik de Haas  wrote:
> Control: tag -1 upstream fixed-upstream patch
> 
> On Tue, 21 May 2024 14:57:47 +0200 Andreas Beckmann  wrote:
> > Package: dahdi-dkms
> > Version: 1:3.1.0+git20230717~dfsg-5
> > Severity: serious
> 
> Attached is the upstream patch for compatibility with 6.8/6.9 kernels added
> to ``debian/patches``.

Forgot to mention that that commit is part of upstream's 3.4.0~rc1, 
but it's unclear to me what is considered upstream now.

https://github.com/asterisk/dahdi-linux/commit/497f11466688d9e76a7b68ffdd2c3859279f5fce

signature.asc
Description: This is a digitally signed message part.


Bug#1071575: dahdi-dkms: module fails to build for Linux 6.8.9: error: implicit declaration of function 'strlcpy'

2024-05-27 Thread Diederik de Haas
Control: tag -1 upstream fixed-upstream patch

On Tue, 21 May 2024 14:57:47 +0200 Andreas Beckmann  wrote:
> Package: dahdi-dkms
> Version: 1:3.1.0+git20230717~dfsg-5
> Severity: serious
> 
> DKMS make.log for dahdi-3.1.0+git20230717 for kernel 6.8.9-amd64 (x86_64)
> Sun May 19 19:55:53 UTC 2024
> make -C /lib/modules/6.8.9-amd64/build KBUILD_EXTMOD=/var/lib/dkms/dahdi/
> 3.1.0+git20230717/build/drivers/dahdi DAHDI_INCLUDE=/var/lib/dkms/dahdi/
> 3.1.0+git20230717/build/include DAHDI_MODULES_EXTRA="dahdi_dummy.o 
> dahdi_echocan_oslec.o " HOTPLUG_FIRMWARE=yes m
> ...
> /var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/wct4xxp/base.c:
> In function 'free_wc':
> /usr/src/linux-headers-6.8.9-common/include/linux/workqueue.h:625:9: 
> warning: call to '__warn_flushing_systemwide_wq' declared with attribute 
> warning: Please avoid flushing system-wide workqueues. [-Wattribute-warning]
>   625 | __warn_flushing_systemwide_wq();  
>   
>   \
>   | ^~~

This is something upstream should take a look at, but is not the cause of the 
build failure.

>   CC [M]  /var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/xpp/
>   card_global.o 
> /var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/xpp/card_global.c:
> In function 'parse_chip_command':
> /var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/xpp/card_global.c
> :344:9: error: implicit declaration of function 'strlcpy'; did you mean
> 'strscpy'? [-Werror=implicit-function-declaration]> 
>   344 | strlcpy(buf, cmdline, MAX_PROC_WRITE);  /* Save a copy */
>   
>   | ^~~
>   | strscpy
> 
> cc1: some warnings being treated as errors

But this is.
Attached is the upstream patch for compatibility with 6.8/6.9 kernels added to 
``debian/patches``.
>From e032b7936b75400f039ae8dfd40b1fdfdd56f2ce Mon Sep 17 00:00:00 2001
From: Diederik de Haas 
Date: Mon, 27 May 2024 10:18:08 +0200
Subject: [PATCH] d/patches: Add "Fix compilation issue for 6.8.y/6.9.y kernel"

Link: https://github.com/asterisk/dahdi-linux/commit/497f11466688d9e76a7b68ffdd2c3859279f5fce
---
 ...ilation-issue-for-6.8.y-6.9.y-kernel.patch | 231 ++
 debian/patches/series |   2 +
 2 files changed, 233 insertions(+)
 create mode 100644 debian/patches/Fix-compilation-issue-for-6.8.y-6.9.y-kernel.patch

diff --git a/debian/patches/Fix-compilation-issue-for-6.8.y-6.9.y-kernel.patch b/debian/patches/Fix-compilation-issue-for-6.8.y-6.9.y-kernel.patch
new file mode 100644
index 000..123428b
--- /dev/null
+++ b/debian/patches/Fix-compilation-issue-for-6.8.y-6.9.y-kernel.patch
@@ -0,0 +1,231 @@
+From: Pushkar Singh 
+Date: Thu, 4 Apr 2024 01:15:01 +0530
+Subject: Fix compilation issue for 6.8.y/6.9.y kernel
+Origin: upstream, https://github.com/asterisk/dahdi-linux.git/commit/497f11466688d9e76a7b68ffdd2c3859279f5fce
+
+---
+ 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 b96f72b..87177a6 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->manufa

Bug#1071575: dahdi-dkms: module fails to build for Linux 6.8.9: error: implicit declaration of function 'strlcpy'

2024-05-21 Thread Andreas Beckmann
Package: dahdi-dkms
Version: 1:3.1.0+git20230717~dfsg-5
Severity: serious

DKMS make.log for dahdi-3.1.0+git20230717 for kernel 6.8.9-amd64 (x86_64)
Sun May 19 19:55:53 UTC 2024
make -C /lib/modules/6.8.9-amd64/build 
KBUILD_EXTMOD=/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi 
DAHDI_INCLUDE=/var/lib/dkms/dahdi/3.1.0+git20230717/build/include 
DAHDI_MODULES_EXTRA="dahdi_dummy.o dahdi_echocan_oslec.o " HOTPLUG_FIRMWARE=yes 
m
odules DAHDI_BUILD_ALL=m
make[1]: Entering directory '/usr/src/linux-headers-6.8.9-amd64'
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/icE1usb/icE1usb.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_events.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_memory.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/apilib/bt/octapi_bt0.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/apilib/largmath/octapi_largmath.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/apilib/llman/octapi_llman.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/oct612x-user.o
  LD [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/oct612x/oct612x.o
  CC [M]  
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/wct4xxp/base.o
In file included from 
/usr/src/linux-headers-6.8.9-common/include/linux/srcu.h:21,
 from 
/usr/src/linux-headers-6.8.9-common/include/linux/notifier.h:16,
 from 
/usr/src/linux-headers-6.8.9-common/arch/x86/include/asm/uprobes.h:13,
 from 
/usr/src/linux-headers-6.8.9-common/include/linux/uprobes.h:49,
 from 
/usr/src/linux-headers-6.8.9-common/include/linux/mm_types.h:16,
 from 
/usr/src/linux-headers-6.8.9-common/include/linux/mmzone.h:22,
 from /usr/src/linux-headers-6.8.9-common/include/linux/gfp.h:7,
 from /usr/src/linux-headers-6.8.9-common/include/linux/umh.h:4,
 from 
/usr/src/linux-headers-6.8.9-common/include/linux/kmod.h:9,
 from 
/usr/src/linux-headers-6.8.9-common/include/linux/module.h:17,
 from 
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/wct4xxp/base.c:32:
/var/lib/dkms/dahdi/3.1.0+git20230717/build/drivers/dahdi/wct4xxp/base.c: In 
function 'free_wc':
/usr/src/linux-headers-6.8.9-common/include/linux/workqueue.h:625:9: warning: 
call to '__warn_flushing_systemwide_wq' declared with attribute warning: Please 
avoid flushing system-wide workqueues. [-Wattribute-warning]
  625 | __warn_flushing_systemwide_wq();
\
  | ^~~
/var/l