Skip to content

PCSC does not work when hidepid is used for /proc #224

@xoores

Description

@xoores

On my system (Gentoo) I have a /proc mounted with hidepid=2 and it prevents PCSC from working as it tries to access info about a process that does not belong to my user. When the PID check fails, the PCSC reject sign request.

When I remount /proc with hidepid=0 (1 does not work also), everything works. This started happening (I believe) when I upgraded to 2.3.0, it did not happen before.

Kernel: 6.13.2-gentoo
PCSC: 2.3.0

PCSC is running under pcscd user and therefore it does not have access to /proc folders of my user (UID 1000) - as is intended for hidepid:

# ps aux | grep pcsc
pcscd     4204  0.0  0.0 239316  3464 ?        Sl   16:20   0:00 /usr/sbin/pcscd

/etc/fstab

...
proc   /proc   proc   nosuid,nodev,noexec,hidepid=2,gid=proc   0 0

/etc/polkit-1/rules.d/pcsc.rules

polkit.addRule(function(action, subject) {
	if (action.id == "org.debian.pcsc-lite.access_pcsc" ||
		action.id == "org.debian.pcsc-lite.access_card")
	{
		polkit.log("PCSC: action=" + action + "  subject=" + subject);
		return polkit.Result.YES;
	}
	
	polkit.log("PCSC-UNHANDLED: action=" + action + "  subject=" + subject);
});

Relevant logs:

17.02 13:16:38  pcscd[12454]: ../pcsc-lite-2.3.0/src/auth.c:127:IsClientAuthorized() Error in authorization: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dfile_2derror_2dquark.Code4: Failed to open file “/proc/12699/status”: No such file or directory
17.02 13:16:38  pcscd[12454]: ../pcsc-lite-2.3.0/src/auth.c:145:IsClientAuthorized() Process 12699 (user: 1000) is NOT authorized for action: access_pcsc
17.02 13:16:38  pcscd[12454]: ../pcsc-lite-2.3.0/src/winscard_svc.c:357:ContextThread() Rejected unauthorized PC/SC client
17.02 13:16:41  pcscd[12454]: ../pcsc-lite-2.3.0/src/auth.c:127:IsClientAuthorized() Error in authorization: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dfile_2derror_2dquark.Code4: Failed to open file “/proc/12699/status”: No such file or directory
17.02 13:16:41  pcscd[12454]: ../pcsc-lite-2.3.0/src/auth.c:145:IsClientAuthorized() Process 12699 (user: 1000) is NOT authorized for action: access_pcsc
17.02 13:16:41  pcscd[12454]: ../pcsc-lite-2.3.0/src/winscard_svc.c:357:ContextThread() Rejected unauthorized PC/SC client

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions