Young giant planets and brown dwarf companions emit near-infrared radiation that can be linearly polarized up to several percent. This polarization can reveal the presence of a circumsubstellar accretion disk, rotation-induced oblateness of the atmosphere, or an inhomogeneous distribution of atmospheric dust clouds. We measured the near-infrared linear polarization of 20 known directly imaged exoplanets and brown dwarf companions with the high-contrast imager SPHERE-IRDIS at the VLT. We reduced the data using the IRDAP pipeline to correct for the instrumental polarization and crosstalk with an absolute polarimetric accuracy <0.1% in the degree of polarization. We report the first detection of polarization originating from substellar companions, with a polarization of several tenths of a percent for DH Tau B and GSC 6214-210 B in H-band. By comparing the measured polarization with that of nearby stars, we find that the polarization is unlikely to be caused by interstellar dust. Because the companions have previously measured hydrogen emission lines and red colors, the polarization most likely originates from circumsubstellar disks. Through radiative transfer modeling, we constrain the position angles of the disks and find that the disks must have high inclinations. The presence of these disks as well as the misalignment of the disk of DH Tau B with the disk around its primary star suggest in situ formation of the companions. For the 18 other companions, we do not detect significant polarization and place subpercent upper limits on their degree of polarization. These non-detections may indicate the absence of circumsubstellar disks, a slow rotation rate of young companions, the upper atmospheres containing primarily submicron-sized dust grains, and/or limited cloud inhomogeneity. Finally, we present images of the circumstellar disks of DH Tau, GQ Lup, PDS 70, Beta Pic, and HD 106906.