Bug 1298726

Summary: third-party (Brother) drivers blocked by SELinux
Product: [Fedora] Fedora Reporter: Jehan <jehan.marmottard>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: bmason, dwalsh, jpopelka, lvrabec, mgrepl, nobody+bjmason, plautrba, pmoore, ppywlkiqletw, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.14.2-15.fc29 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-29 12:08:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Troubleshoot logs from one of my many tests.
none
SELinux alert: brcupsconfpt1 tries to execute /etc/ld.so.cache
none
Text when clicking on "Details" button in SELinux dialog.
none
SELinux alert: brprintconf_mc tries to execute /etc/ld.so.cache
none
Contents of "Details" with the second alert. none

Description Jehan 2016-01-14 20:18:54 UTC
Created attachment 1114946 [details]
Troubleshoot logs from one of my many tests.

Description of problem:

I cannot print with my brand new Brother MFC-J6920DW on Fedora 23 (from 2 computers both under Fedora 23) as a network printer (I have not tried USB and don't intend to. I am only interested into it working as a network printer shared for all machine on my locale network).

I tried with bare Fedora, and also installed the drivers from Brother: http://support.brother.com/g/b/downloadlist.aspx?c=fr&lang=fr&prod=mfcj6920dw_us_eu_as&os=127&flang=English

The rpm driver installation went all fine (i.e. no error displayed), but it just won't print anything (neither the test print, nor any random file I could try). No error would be ever displayed. If I try the "Print Test Page" button for instance, I get a "Processing" and "Jobs 1 active" for maybe half a second, then it goes back to "Read" and "0 active" as if all went fine.

`journalctl -u cups -e --boot` shows no visible error:

-----------------------------------
Jan 14 21:06:16 darkmarmot cupsd[2333]: [Job ???] Request file type is application/vnd.cups-pdf-banner.
Jan 14 21:06:16 darkmarmot cupsd[2333]: Adding start banner page "none".
Jan 14 21:06:16 darkmarmot cupsd[2333]: Adding end banner page "none".
Jan 14 21:06:16 darkmarmot cupsd[2333]: File of type application/vnd.cups-pdf-banner queued by "jehan".
Jan 14 21:06:16 darkmarmot cupsd[2333]: Queued on "MFC-J6920DW" by "jehan".
Jan 14 21:06:16 darkmarmot systemd[1]: Started CUPS Scheduler.
Jan 14 21:06:16 darkmarmot cupsd[2333]: Started filter /usr/lib/cups/filter/bannertopdf (PID 5456)
Jan 14 21:06:16 darkmarmot cupsd[2333]: Started filter /usr/lib/cups/filter/pdftopdf (PID 5457)
Jan 14 21:06:16 darkmarmot cupsd[2333]: Started filter /usr/lib/cups/filter/pdftops (PID 5458)
Jan 14 21:06:16 darkmarmot cupsd[2333]: Started filter /usr/lib/cups/filter/brother_lpdwrapper_mfcj6920dw (PID 5459)
Jan 14 21:06:16 darkmarmot cupsd[2333]: Started backend /usr/lib/cups/backend/dnssd (PID 5460)
Jan 14 21:06:16 darkmarmot cupsd[2333]: REQUEST localhost - - "POST /printers/MFC-J6920DW HTTP/1.1" 200 413 Print-Job successful-ok
Jan 14 21:06:17 darkmarmot cupsd[2333]: REQUEST localhost - - "POST / HTTP/1.1" 200 4732020 CUPS-Get-PPDs -
Jan 14 21:06:17 darkmarmot cupsd[2333]: Job completed.
-------------------------------------

I also tried the Help > Troubleshoot from system-config-printer which did not help much except from the logs (attached), which showed up this error:

>                                     'missing     /var/spool/cups/tmp '
>                                    '(Permission denied)'],

Not sure, but could it be the problem?
Checking the directory, it does exist:

> # ls /var/spool/cups/tmp -ltr
> total 0
> -rw-------. 1 lp lp 0 Jan 14 20:59 cups-dbus-notifier-lockfile
> [root@darkmarmot Devis]# ls /var/spool/cups/tmp -ltrd
> drwxrwx--T. 2 root lp 4096 Jan 14 21:07 /var/spool/cups/tmp

For information, I also tried in a live Fedora, and it did not work either. I tried on a live Ubuntu though, and it worked fine.
Also the network scanner works fine on both Ubuntu and Fedora. Only the printer is a problem here.
I would appreciate a fix, and a workaround as well for the time being. I even tried something as dirty as `chmod o+rwx` on this directory, but this change seems to be overridden immediately at the next print attempt.

Comment 1 Jehan 2016-02-12 15:05:53 UTC
Created attachment 1123533 [details]
SELinux alert: brcupsconfpt1 tries to execute /etc/ld.so.cache

Ok. After weeks, I finally understood what was the problem. The print jobs were blocked by SELinux. I understood this after noticing an alert icon appearing in the bottom left bar (GNOME 3).

Following indications in details, I fixed by running:

> sudo setsebool -P cups_execmem 1

Following indications of SELinux which says "If you believe that brcupsconfpt1 should be allowed execmem access on processes labeled cupsd_t by default." I leave the bug report opened though because this is not user-friendly, especially when you buy a printer with linux drivers!
I have installed official Brother drivers, which has explicit support of Linux. This is rare and cool enough in printer makers for Linux distributions to not block these, right?

So I know these RPM are not made by the Fedora community, hence they are not in the official package repository. But it would be great if they were, and if not, could we "plan" for the possibility of these being installed by the user, and having SELinux not blocking its normal functioning?

Also I will note that the CUPSWrapper printer drivers is GPLv2.
All other drivers (LPR printer, scanner, scan-key tool, fax…) use some kind of "AS IS" license. I can't see if it corresponds to any known Free license (I don't know them all by heart) but it seems to be pretty much some kind of Free license anyway. Extract from it:

>  Brother grants User a non-exclusive license: to reproduce and/or distribute (via Internet or in any other manner) the Software. Further, Brother grants User a non-exclusive license to modify, alter, translate or otherwise prepare derivative works of the Software and to reproduce and distribute (via Internet or in any other manner) such modification, alteration, translation or other derivative works for any purpose. 

Disclaimer: I'm not a lawyer. I propose you have a look at any of the official Brother RPMs. Just before every download, the license is displayed.

In any case, it looks to me like we could have these redistributed in the Fedora package repository. No?

Comment 2 Jehan 2016-02-12 15:07:39 UTC
Created attachment 1123534 [details]
Text when clicking on "Details" button in SELinux dialog.

Attached the text from SELinux when clicking "Details" button after receiving the alert. In case it is useful.

Comment 3 Jehan 2016-02-19 15:35:00 UTC
Created attachment 1128570 [details]
SELinux alert: brprintconf_mc tries to execute /etc/ld.so.cache

Additional info: even though now, I can print, I noticed that SELinux outputted another alert when trying to print, this time on brprintconf_mc, which also tried to execute /etc/ld.so.cache.

It did not prevent printing, but maybe it blocks some of my printer feature which I would discover later along the road?
Anyway I leave here the info for you to evaluate what brprintconf_mc does.
Thanks!

Comment 4 Jehan 2016-02-19 15:37:16 UTC
Created attachment 1128571 [details]
Contents of "Details" with the second alert.

And the contents when clicking "Details" button on this second alert.

Comment 5 Fedora Admin XMLRPC Client 2016-06-24 10:30:55 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 6 Jehan 2016-09-27 10:58:04 UTC
Note: I installed Fedora 24 and the problem still exists there.

Comment 7 Fedora End Of Life 2016-11-24 14:57:31 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Bryan Mason 2016-12-15 16:46:06 UTC
Moving to Fedora 24 based on Comment #6.

Comment 10 Fedora End Of Life 2017-07-25 19:46:50 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 11 Jehan 2017-07-25 20:02:19 UTC
Moving to Fedora 25.

Comment 12 Villy Kruse 2017-11-10 19:22:21 UTC
Issue is being fixed in bugzilla 1478602

Comment 13 Fedora End Of Life 2017-11-16 19:13:29 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 14 Jehan 2017-11-16 19:17:38 UTC
Last I tried, the issue was still happening in Fedora 26. Comment 12 seems to indicate this has been fixed in Fedora 26 though. I'm not sure, I'll have to try soon. But for the time being, I'll bump the version on the bug report.

Comment 15 Bryan Mason 2018-03-12 22:04:22 UTC
Despite the changes introduced by Bug 1478602, this still isn't completely resolved in Fedora 26, and my QL-570 won't print unless I "setenforce permissive" before printing something.

The audit message is now:

type=AVC msg=audit(1520890850.331:60004): avc:  denied  { execute } for  pid=31610 comm="rastertobrpt1" path="/var/tmp/Stdshared2005102601" dev="dm-3" ino=2729 scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:cupsd_tmp_t:s0 tclass=file permissive=1

Comment 16 Zdenek Dohnal 2018-03-13 06:53:22 UTC
Ok, it is really selinux issue, reassigning to selinux policy.

Comment 17 Fedora End Of Life 2018-05-03 08:26:11 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 18 Fedora End Of Life 2018-05-29 12:08:05 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.