see kern_exec.c line 600
--
Sent from a phone, apologies for poor formatting.
On 29 April 2025 21:00:26 Lloyd <ng2d68@proton.me> wrote:
Sorry for the duplicate message but I have some more information to share:I instrumented some fake sendmail binaries/scripts to I can insert myselfin between and execute a ktrace. Note that below the "/usr/sbin/send-mail"is just a symlink to smtpctl to trigger "sendmail compat mode" of smtpd.Unfortunately in both cases below this is the entire ktrace. I've alreadyeliminated mailwrapper(8) as the source of any issues as it successfullycalls smtpctl and that's where the hang is happening. Below two examplesshow a call to smtpctl with default Alpine args and a forced "-t" arg:14906 ktrace RET ktrace 014906 ktrace CALL execve(0x6fd7f687e0ff,0x6fd7f687df88,0x6fd7f687dfb0)14906 ktrace NAMI "/usr/sbin/send-mail"14906 ktrace ARGS[0] = "/usr/sbin/send-mail"[1] = "-bs"[2] = "-odb"[3] = "-oem"18856 ktrace RET ktrace 018856 ktrace CALL execve(0x77fb458a4f7f,0x77fb458a4e18,0x77fb458a4e30)18856 ktrace NAMI "/usr/sbin/send-mail"18856 ktrace ARGS[0] = "/usr/sbin/send-mail"[1] = "-t"RegardsLloydOn Tuesday, April 29th, 2025, Lucas Gabriel Vuotto wrote:Hey Lloyd,On Tue, Apr 29, 2025 at 02:00:17AM +0000, Lloyd wrote:There is a bug in Alpine whereby out of the box it is unable to send email onan OpenBSD box, even locally. By default, sending a message in unconfiguredAlpine will fork out to sendmail(8) which hangs for some unknown reason andthe sendmail wrapper process needs to be killed. Receiving mail works fine.Running /usr/sbin/sendmail -t < ~/dead.letter against the abandoned messageworks fine, so the interface between Alpine and the sendmail wrapper isbroken.I ran a ktrace but couldn't find anything substantiative. Rather than debugthis further, there is a much simpler patch to get Alpine working in thedefault install. The below change sets the value of smtp-server to localhostin the file which gets copied to /etc/pine.conf on installation. With thisvariable set, Alpine connects to the local smtpd over TCP rather than usingthe sendmail(8) utility, if the user has no smtp server defined./etc/pine.conf is overridden by the user's ~/.pinerc so this should be anon-destructive change that will not impact anything but an unconfiguredinstallation which falls back to using sendmail(8), which does not work.If it did work, then I believe --with-smtp-msa-flags=-t should be set inthe Makefile as well since the hard-coded defaults pass bogus flags tosendmail(8). This didn't work either so it really doesn't matter, I believethe issue lies somewhere in the threading mechanism and how it forks outto sendmail. It's possible a prior security-related change broke something.This issue dates back to at least OpenBSD 6.8:https://marc.info/?l=openbsd-misc&m=161141614219034&w=2I'm not an alpine user, but got curious about this issue. Would you mindsharing the bits of `ktrace -di alpine` related to exec functions withme? It's important you share only those bits, as ktrace output mightinclude data like passwords.For the record, I verified that adding --with-smtp-msa-flags=-t doesindeed set it in the code, so that should be working.Lucas
No comments:
Post a Comment