Bug 1898038 - pkttyagent dumps core when user hits Ctrl-D
Summary: pkttyagent dumps core when user hits Ctrl-D
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: polkit
Version: 8.3
Hardware: All
OS: Linux
medium
high
Target Milestone: rc
: 8.0
Assignee: Polkit Maintainers
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-16 08:48 UTC by Renaud Métrich
Modified: 2022-06-30 07:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-30 07:27:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5981511 0 None None None 2021-04-21 08:50:13 UTC

Description Renaud Métrich 2020-11-16 08:48:33 UTC
Description of problem:

When the prompt for authentication appears and the user just hits Ctrl-D to abort, pkttyagent dumps core with following backtrace:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Core was generated by `/usr/bin/pkttyagent --notify-fd 5 --fallback'.
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
#0  0x00007eff7b5e45f5 in _g_log_abort (breakpoint=1) at gmessages.c:580
580	    G_BREAKPOINT ();
[Current thread is 1 (Thread 0x7eff759cc700 (LWP 11071))]
(gdb) bt
#0  0x00007eff7b5e45f5 in _g_log_abort (breakpoint=1) at gmessages.c:580
#1  0x00007eff7b5e56a1 in g_log_default_handler (log_domain=log_domain@entry=0x0, log_level=log_level@entry=6, 
    message=message@entry=0x7eff6800c220 "Got unexpected EOF while reading from controlling terminal.", 
    unused_data=unused_data@entry=0x0) at gmessages.c:3158
#2  0x00007eff7b5e58ef in g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=<optimized out>, 
    args=args@entry=0x7eff759cb2e0) at gmessages.c:1370
#3  0x00007eff7b5e5ae3 in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>)
    at gmessages.c:1432
#4  0x00007eff7bb045f3 in on_request () from /lib64/libpolkit-agent-1.so.0
#5  0x00007eff7b8ba3bd in g_closure_invoke (closure=0x7eff6c009d90, return_value=0x0, n_param_values=3, 
    param_values=0x7eff759cb640, invocation_hint=0x7eff759cb5c0) at gclosure.c:804
#6  0x00007eff7b8cd945 in signal_emit_unlocked_R (node=node@entry=0x55738748e7b0, detail=detail@entry=0, 
    instance=instance@entry=0x7eff68007b00, emission_return=emission_return@entry=0x0, 
    instance_and_params=instance_and_params@entry=0x7eff759cb640) at gsignal.c:3635
#7  0x00007eff7b8d6a06 in g_signal_emit_valist (instance=instance@entry=0x7eff68007b00, 
    signal_id=signal_id@entry=10, detail=detail@entry=0, var_args=var_args@entry=0x7eff759cb878) at gsignal.c:3391
#8  0x00007eff7b8d7526 in g_signal_emit_by_name (instance=0x7eff68007b00, detailed_signal=<optimized out>)
    at gsignal.c:3487
#9  0x00007eff7bb023f7 in io_watch_have_data () from /lib64/libpolkit-agent-1.so.0
#10 0x00007eff7b5de67d in g_main_dispatch (context=0x7eff6c000b20) at gmain.c:3176
#11 g_main_context_dispatch (context=context@entry=0x7eff6c000b20) at gmain.c:3829
#12 0x00007eff7b5dea48 in g_main_context_iterate (context=0x7eff6c000b20, block=block@entry=1, 
    dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3902
#13 0x00007eff7b5ded72 in g_main_loop_run (loop=0x7eff6c003610) at gmain.c:4098
#14 0x00007eff7bb02ed7 in server_thread_func () from /lib64/libpolkit-agent-1.so.0
#15 0x00007eff7b606d9a in g_thread_proxy (data=0x55738747eb70) at gthread.c:784
#16 0x00007eff7b3792de in start_thread (arg=<optimized out>) at pthread_create.c:486
#17 0x00007eff7b0aa133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


Version-Release number of selected component (if applicable):

polkit-0.115-9.el8.x86_64


How reproducible:

Always


Steps to Reproduce:
1. As a normal user, issue some command requiring authentication

  $ systemctl start foo

  ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ====
  Authentication is required to start 'foo.service'.
  Authenticating as: rmetrich
  Password: 

2. Hit Ctrl-D

Actual results:

  ** (pkttyagent:11148): ERROR **: 09:47:16.382: Got unexpected EOF while reading from controlling terminal.
  polkit-agent-helper-1: pam_authenticate failed: Authentication failure

  + coredump

Comment 1 Renaud Métrich 2021-04-21 07:32:21 UTC
See also BZ #1951905 on RHEL7.

Comment 2 Michael Catanzaro 2021-04-26 13:35:10 UTC
Proposal: pkexec should use no higher than g_warning() for this. g_critical() is for programmer error and g_error() is to crash, neither of which are suitable for issues caused by user input.

Comment 4 RHEL Program Management 2022-06-30 07:27:27 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


Note You need to log in before you can comment on or make changes to this bug.