Send inn-workers mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.isc.org/mailman/listinfo/inn-workers
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of inn-workers digest..."
Today's Topics:
1. [PATCH] drop unused filterPath (Dominik 'Rathann' Mierzejewski)
2. RE: [PATCH] drop unused filterPath (Julien ?LIE)
3. Re: [PATCH] drop unused filterPath
(Dominik 'Rathann' Mierzejewski)
4. Re: [PATCH] drop unused filterPath (Julien ?LIE)
5. Re: [PATCH] drop unused filterPath (Russ Allbery)
----------------------------------------------------------------------
Message: 1
Date: Fri, 11 Sep 2020 14:37:24 +0200
From: Dominik 'Rathann' Mierzejewski <[email protected]>
To: [email protected]
Subject: [PATCH] drop unused filterPath
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
Dear list,
while building INN-2.6.3 on Fedora rawhide (with GCC-10.2.1 and LTO
enabled), I encountered a linking error:
$ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu
--program-prefix= --disable-dependency-tracking --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
--libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib
--mandir=/usr/share/man --infodir=/usr/share/info --disable-static
--enable-largefiles --enable-shared --enable-uucp-rnews
--bindir=/usr/libexec/news --exec-prefix=/usr/libexec/news
--sysconfdir=/etc/news --with-db-dir=/var/lib/news
--with-http-dir=/var/lib/news/http
--with-libperl-dir=/usr/share/perl5/vendor_perl --with-log-dir=/var/log/news
--with-openssl --with-perl --with-pic --with-python --with-run-dir=/run/news
--with-sasl --with-sendmail=/usr/sbin/sendmail --with-spool-dir=/var/spool/news
--with-tmp-dir=/var/lib/news/tmp --with-news-group=news --with-news-master=news
--with-news-user=news
...
../libtool --mode=link gcc -pie -Wl,-z,relro -Wl,--as-needed -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o innd art.o cc.o chan.o icd.o
innd.o keywords.o lc.o nc.o newsfeeds.o ng.o perl.o proc.o python.o rc.o site.o
status.o util.o wip.o /builddir/build/BUILD/inn-2.6.3/storage/libstorage.la
/builddir/build/BUILD/inn-2.6.3/history/libinnhist.la
/builddir/build/BUILD/inn-2.6.3/lib/libinn.la -ldb
/builddir/build/BUILD/inn-2.6.3/lib/perl.o -Wl,--enable-new-dtags -Wl,-z,relro
-Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-Wl,-z,relro -Wl,--as-needed -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong
-L/usr/local/lib -L/usr/lib64/perl5/CORE -lperl -lpthread -lresolv -ldl -lm
-lcrypt -lutil -L/usr/lib64 -lpython3.9 -lcrypt -lpthread -ldl -lutil -lm -lm
-Xlinker -export-dynamic -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -g
-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -g
libtool: link: gcc -pie -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o .libs/innd art.o cc.o chan.o
icd.o innd.o keywords.o lc.o nc.o newsfeeds.o ng.o perl.o proc.o python.o rc.o
site.o status.o util.o wip.o /builddir/build/BUILD/inn-2.6.3/lib/perl.o
-Wl,--enable-new-dtags -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-z -Wl,relro -Wl,--as-needed
-Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-fstack-protector-strong -Wl,-export-dynamic -Wl,-z -Wl,relro -Wl,--as-needed
-Wl,-z -Wl,now -g -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -g
/builddir/build/BUILD/inn-2.6.3/storage/.libs/libstorage.so
/builddir/build/BUILD/inn-2.6.3/history/.libs/libinnhist.so
/builddir/build/BUILD/inn-2.6.3/lib/.libs/libinn.so -ldb -L/usr/local/lib
-L/usr/lib64/perl5/CORE -lperl -lresolv -L/usr/lib64 -lpython3.9 -lcrypt
-lpthread -ldl -lutil -lm
/usr/bin/ld: python.o (symbol from plugin): in function `PYFilterObject':
(.text+0x0): multiple definition of `filterPath'; art.o (symbol from
plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
...
Upon further inspection, it seems that filterPath is declared in both
innd/art.c:81 and innd/python.c:63 (without const), set in
innd/art.c:2076, but never used. Shall we drop it, then? Patch attached.
Regards,
Dominik
--
Fedora https://getfedora.org | RPM Fusion http://rpmfusion.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
-------------- next part --------------
diff -up inn-2.6.3/innd/art.c.fp inn-2.6.3/innd/art.c
--- inn-2.6.3/innd/art.c.fp 2019-02-07 16:02:22.000000000 +0100
+++ inn-2.6.3/innd/art.c 2020-09-11 14:24:21.055208612 +0200
@@ -77,10 +77,6 @@ static char ARTjnk[] = "junk";
static char hostcclass[256];
#define ARThostchar(c) ((hostcclass[(unsigned char)(c)]) != 0)
-#if defined(DO_PERL) || defined(DO_PYTHON)
-const char *filterPath;
-#endif /* DO_PERL || DO_PYTHON */
-
/* Prototypes. */
static void ARTerror(CHANNEL *cp, const char *format, ...)
__attribute__((__format__(printf, 2, 3)));
@@ -2072,10 +2068,6 @@ ARTpost(CHANNEL *cp)
}
}
-#if defined(DO_PERL) || defined(DO_PYTHON)
- filterPath = HDR(HDR__PATH);
-#endif /* DO_PERL || DO_PYHTON */
-
#if defined(DO_PYTHON)
TMRstart(TMR_PYTHON);
filterrc = PYartfilter(data, article->data + data->Body,
diff -up inn-2.6.3/innd/python.c.fp inn-2.6.3/innd/python.c
--- inn-2.6.3/innd/python.c.fp 2019-02-07 16:02:22.000000000 +0100
+++ inn-2.6.3/innd/python.c 2020-09-11 14:23:46.143958961 +0200
@@ -60,7 +60,6 @@
#include "innd.h"
bool PythonFilterActive;
-char *filterPath; /* This gets set in art.c. */
PyObject *PYFilterObject = NULL;
PyObject *PYFilterModule = NULL;
------------------------------
Message: 2
Date: Fri, 11 Sep 2020 13:06:39 +0000
From: Julien ?LIE <[email protected]>
To: Dominik 'Rathann' Mierzejewski <[email protected]>,
"[email protected]" <[email protected]>
Subject: RE: [PATCH] drop unused filterPath
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hi Dominik,
> (.text+0x0): multiple definition of `filterPath'; art.o (symbol from
> plugin):(.text+0x0): first defined here
>
> Upon further inspection, it seems that filterPath is declared in both
> innd/art.c:81 and innd/python.c:63 (without const), set in
> innd/art.c:2076, but never used. Shall we drop it, then? Patch attached.
Yes, exactly. Latest version of GCC triggers that warning.
Patch already present upstream (will be shipped with INN 2.6.4):
https://inn.eyrie.org/trac/changeset/10361
--
Julien
------------------------------
Message: 3
Date: Fri, 11 Sep 2020 18:34:27 +0200
From: Dominik 'Rathann' Mierzejewski <[email protected]>
To: "[email protected]" <[email protected]>
Subject: Re: [PATCH] drop unused filterPath
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1
Hello, Julien!
On Friday, 11 September 2020 at 15:06, Julien ?LIE wrote:
> Hi Dominik,
>
> > (.text+0x0): multiple definition of `filterPath'; art.o (symbol from
> > plugin):(.text+0x0): first defined here
> >
> > Upon further inspection, it seems that filterPath is declared in both
> > innd/art.c:81 and innd/python.c:63 (without const), set in
> > innd/art.c:2076, but never used. Shall we drop it, then? Patch attached.
>
> Yes, exactly. Latest version of GCC triggers that warning.
> Patch already present upstream (will be shipped with INN 2.6.4):
> https://inn.eyrie.org/trac/changeset/10361
Great! I have some more patches from Fedora package lined up for
submission. I'll post them here as time permits. I'll have to dig up the
rationale behind their existence, too, as they were created by previous
maintainers.
Regards,
Dominik
--
Fedora https://getfedora.org | RPM Fusion http://rpmfusion.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
------------------------------
Message: 4
Date: Sat, 12 Sep 2020 08:10:46 +0200
From: Julien ?LIE <[email protected]>
To: [email protected]
Subject: Re: [PATCH] drop unused filterPath
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
Hi Dominik,
> I have some more patches from Fedora package lined up for
> submission. I'll post them here as time permits. I'll have to dig up the
> rationale behind their existence, too, as they were created by previous
> maintainers.
FYI, we once discussed them (in 2013, long time ago already!) in the
thread about Fedora here:
https://lists.isc.org/pipermail/inn-workers/2013-May/018153.html
It seems that adding "-fPIE -pie" in CFLAGS could be worthwhile (because
INN is setuid), not only for rnews. The other patches do not seem
necessary. Especially the one about MADV_SEQUENTIAL / madvise.
https://lists.isc.org/pipermail/inn-workers/2013-May/018154.html
https://lists.isc.org/pipermail/inn-workers/2013-May/018156.html
https://lists.isc.org/pipermail/inn-workers/2013-May/018158.html
Time to do a bit of clean-up :)
Thanks for having taken the maintenance of the Fedora inn package!
--
Julien ?LIE
??Celui qui sait qu'il ne sait pas, ?duque-le.
Celui qui sait qu'il sait, ?coute-le.
Celui qui ne sait pas qu'il sait, ?veille-le.
Celui qui ne sait pas qu'il ne sait pas, fuis-le.?? (proverbe chinois)
------------------------------
Message: 5
Date: Fri, 11 Sep 2020 23:54:37 -0700
From: Russ Allbery <[email protected]>
To: [email protected]
Subject: Re: [PATCH] drop unused filterPath
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Julien ?LIE <[email protected]> writes:
> It seems that adding "-fPIE -pie" in CFLAGS could be worthwhile (because
> INN is setuid), not only for rnews.
I think Debian just changes GCC to do this by default so that each
application doesn't need to worry about it, although I'm not 100% sure. I
know it used to be part of the hardening flags and isn't any more, but
innd on Debian is still built PIE, so I think something makes it happen
automatically.
It's possible Fedora is now doing the same thing. I believe Ubuntu has
been doing this for a while.
(That said, I have no objections to adding the flags on platforms that
support them. The very minor speed hit seems unlikely to affect INN in
any significant way.)
I've in general not tried to add hardening compiler flags to the INN build
process since Debian injects them, but maybe it would be a good idea to
import some of them (-fstack-protector-strong, -Wl,-z,relro, and
-Wl,-z,now, for example).
--
Russ Allbery ([email protected]) <https://www.eyrie.org/~eagle/>
Please send questions to the list rather than mailing me directly.
<https://www.eyrie.org/~eagle/faqs/questions.html> explains why.
------------------------------
Subject: Digest Footer
_______________________________________________
inn-workers mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/inn-workers
------------------------------
End of inn-workers Digest, Vol 123, Issue 1
*******************************************