Thanks for this SRU Alessio

Two things:

a) I updated the test plan so that it installs a package from proposed,
and not your ppa. We always must test the package that will end up in
the user's systems, and that is the package from proposed.

b) In your test plan, thanks for including a check for the built module,
and not only that the build succeeds. If you could, please also add a
check for loading the module, to make sure it works. I realize this
depends on hardware availability, but thinkpads might not be so hard to
obtain. Not a blocker if you can't.

c) Usually for such bugs that relate to an HWE kernel, we ask for the
test plan to always cover both the GA and the HWE kernel. Here we don't
have an HWE kernel yet for resolute, but I'm considering the stonking
test plan as covering for this lack of coverage in the resolute case,
i.e., stonking has a 7.3 kernel. And also because the change is trivial.
Just to be clear, no action needed for this point, it was just an FYI.


** Description changed:

  SRU Justification
  
  [ Impact ]
  
  tp-smapi cannot be compiled against Kernels 7.2+ as strncpy has been
  replaced by strscpy.
  
  Both upstream https://github.com/linux-
  thinkpad/tp_smapi/pull/81/changes/0483993a64f6d922d71dddd8f7f353d8bc22d1bf
  and debian unstable (# 1146537) already contain the fix.
  
  Fixing Resolute as well in anticipation of HWE Kernels.
  
  [ Fix ]
  
  Merge debian unstable fix
  
  [ Test Case ]
  
  Follow the following steps:
  
- - Install the correct series package from
- https://launchpad.net/~alessiofaina/+archive/ubuntu/20261123-dkms-fixes/
+ - Install the proposed package for the ubuntu release being tested
  
  - Check the new package correctly installs in the system
  
  - Verify the compiled tp-smapi module file exists and inspect its module 
metadata (verifies successful build and vermagic match without requiring 
hardware):
     $ MOD=$(ls /lib/modules/$(uname -r)/updates/dkms/thinkpad_ec.ko* | head 
-n1)
     $ modinfo "$MOD"
     $ MOD=$(ls /lib/modules/$(uname -r)/updates/dkms/tp_smapi.ko* | head -n1)
     $ modinfo "$MOD"
     $ MOD=$(ls /lib/modules/$(uname -r)/updates/dkms/hdaps.ko* | head -n1)
     $ modinfo "$MOD"
     Expected result: modinfo outputs valid module metadata with vermagic 
matching $(uname -r) and no errors.
  
  [ What could go wrong ]
  
  Resolute ships the 7.0 GA kernel and will later get HWE kernels up to 7.3.
  Kernels from 7.2 onwards no longer provide strncpy(), so tp-smapi fails to 
build there. Without this fix, users of the 7.2+ HWE kernels would hit a DKMS 
build failure when the HWE kernel is installed and would lose the thinkpad_ec, 
tp_smapi and hdaps modules (battery charge thresholds, battery info and HDD 
active protection) after the upgrade.
  
  The change is not version-conditional: strncpy() is replaced by strscpy() for 
all kernels. strscpy() has been available since Linux 4.3, so the package still 
builds and behaves the same way on the 7.0 GA kernel and on the 7.3 HWE kernel.
  A build failure on either one would show up as a DKMS error on installation 
or kernel upgrade, and the test case covers that.
  
  There is one small change in behaviour. strncpy(buf, src, maxlen) copied up 
to maxlen characters, but strscpy(buf, src, maxlen) copies at most maxlen-1 
characters and then adds the NUL terminator. A battery string from the EC that 
fills its whole field will lose its last character in sysfs. This affects 
/sys/devices/platform/smapi/BAT*/manufacturer, model and barcoding (maxlen  
TP_CONTROLLER_ROW_LEN-2) and chemistry (maxlen 5), so a 5-character chemistry  
value would show as 4 characters. Nothing else changes: the explicit 
buf[maxlen] = 0 is kept, the output is still NUL-terminated, and there is no 
risk of overflow.
  Only tools that read these sysfs strings for display could notice. Charge 
control, the numeric battery values and hdaps are not touched by this change.
  
  [ Discussion ]
  
  This cannot be a sync as Ubuntu has a different Architecture field in
  d/control, removing i386 from it.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2173763

Title:
  tp-smapi DKMS cannot build against Kernel 7.2+

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tp-smapi/+bug/2173763/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to